17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 12:09:19 +02:00

pch migration to modules [wip]

This commit is contained in:
maj00r
2026-09-09 20:35:26 +02:00
parent c3007e3237
commit 3f7960aad5
350 changed files with 5958 additions and 3059 deletions

33
gl/bindable.cppm Normal file
View File

@@ -0,0 +1,33 @@
module;
export module eu07.gl.bindable;
export {
namespace gl
{
template <typename T>
class bindable
{
protected:
thread_local static bindable<T>* active;
public:
void bind()
{
if (active == this)
return;
active = this;
T::bind(*static_cast<T*>(active));
}
static void unbind()
{
active = nullptr;
T::bind(0);
}
};
template <typename T> thread_local bindable<T>* bindable<T>::active;
}
} // export