mirror of
https://github.com/baketnk/frame-yap.git
synced 2026-10-06 11:00:07 +02:00
15 lines
504 B
C++
15 lines
504 B
C++
#pragma once
|
|
#include <utility>
|
|
|
|
namespace frameyap {
|
|
// Follow docs/rendering-performance.md: retain initialized images throughout
|
|
// manipulation, leaving content invalidation pending until the next refresh.
|
|
template<class Render, class Upload>
|
|
bool refresh_texture(bool manipulating, bool initialized, Render&& render, Upload&& upload) {
|
|
if (manipulating && initialized) return false;
|
|
if (!std::forward<Render>(render)()) return false;
|
|
std::forward<Upload>(upload)();
|
|
return true;
|
|
}
|
|
}
|