fixing put pixel, adding scene change checker

This commit is contained in:
2024-10-21 01:48:01 +02:00
parent 4f755f8a6f
commit 0304834008
28 changed files with 302 additions and 201 deletions

33
runtime/Includes/Utils/CallOnExit.h git.filemode.normal_file
View File

@@ -0,0 +1,33 @@
#ifndef __MLX_CALL_ON_EXIT__
#define __MLX_CALL_ON_EXIT__
namespace mlx
{
template <typename F>
class CallOnExit
{
public:
CallOnExit() = default;
CallOnExit(F&& functor);
CallOnExit(const CallOnExit&) = delete;
CallOnExit(CallOnExit&&) = delete;
void CallAndReset();
void Reset();
CallOnExit& operator=(const CallOnExit&) = delete;
CallOnExit& operator=(CallOnExit&&) = default;
~CallOnExit();
private:
std::optional<F> m_functor;
};
template<typename F>
CallOnExit(F) -> CallOnExit<F>;
}
#include <Utils/CallOnExit.inl>
#endif