diff options
Diffstat (limited to 'src/libjin/render/jsl.h')
-rw-r--r-- | src/libjin/render/jsl.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/libjin/render/jsl.h b/src/libjin/render/jsl.h new file mode 100644 index 0000000..570235b --- /dev/null +++ b/src/libjin/render/jsl.h @@ -0,0 +1,44 @@ +#ifndef __JIN_JSL_H +#define __JIN_JSL_H +#include <string> +#include <map> +#include "image.h" +#include "3rdparty/GLee/GLee.h" +namespace jin +{ +namespace render +{ + /** + * A JSL program for shadering textures which is + * actually a glsl program. + */ + class JSLProgram + { + public: + + void init(const char* program); + + void use(); + + static void unuse(); + + void sendFloat(const char* name, float number); + void sendImage(const char* name, const Image* image); + //void sendMatrix(const char* name, int size, const GLfloat* m, int count); + //void sendCanvas(const char* name, const Canvas& canvas); + + private: + JSLProgram(); + + // only id for identify glsl program + GLuint pid; + + static GLint _current_texture_unit; + static GLint _max_texture_units; + static std::map<std::string, GLint> _texture_unit_pool; + static GLint getTextureUnit(const std::string& name); + }; +} +} + +#endif |