UniShader
1.0.0a
Interface for GPGPU and working with shader programs
|
00001 #pragma once 00002 #ifndef TEXTURE_UNIT_H 00003 #define TEXTURE_UNIT_CONTROLLER_H 00004 00005 #include <UniShader/Config.h> 00006 #include <UniShader/Utility.h> 00007 00008 #include <deque> 00009 00010 UNISHADER_BEGIN 00011 00013 00022 class TextureUnit{ 00023 public: 00024 TextureUnit(); 00025 ~TextureUnit(); 00026 00028 00031 void lock(); 00032 00034 00040 bool makeActive(); 00041 00043 00048 char getIndex() const; 00049 00051 00054 void release(); 00055 private: 00056 static std::deque<char> m_freeTextureUnits; 00057 static bool m_initialized; 00058 00059 char m_index; 00060 bool m_locked; 00061 }; 00062 00063 UNISHADER_END 00064 00065 #endif