mirror of
https://github.com/baketnk/frame-yap.git
synced 2026-10-06 07:00:04 +02:00
Finish companion controls and retain panel textures during manipulation
This commit is contained in:
1 parent
b0767d1b36
commit
bcd330d42c
28 files changed
+906
-158
No files matched your search
@@ -0,0 +1,14 @@
|
||||
#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;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user