diff options
author | chai <chaifix@163.com> | 2018-08-16 14:21:56 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-08-16 14:21:56 +0800 |
commit | 8585c92b7d0744a1f1a39c872cf5096621161b6c (patch) | |
tree | 6aa02138f39f7b11ab17c7399064353092b8df0c /src/lua/graphics/JSL.h | |
parent | be9b27dbf550093b555ab3087c11b38c89ab9fd0 (diff) |
*update
Diffstat (limited to 'src/lua/graphics/JSL.h')
-rw-r--r-- | src/lua/graphics/JSL.h | 92 |
1 files changed, 0 insertions, 92 deletions
diff --git a/src/lua/graphics/JSL.h b/src/lua/graphics/JSL.h deleted file mode 100644 index af6c54d..0000000 --- a/src/lua/graphics/JSL.h +++ /dev/null @@ -1,92 +0,0 @@ -#ifndef __JIN_LUA_GRAPHICS_JSL_H -#define __JIN_LUA_GRAPHICS_JSL_H -#include "libjin/jin.h" -#include "../luaopen_types.h" -#include "Image.h" -#include "Color.h" -#include "Canvas.h" - -namespace jin -{ -namespace lua -{ -namespace graphics -{ - - class JSLProgram : public Object - { - public: - static JSLProgram* createJSLProgram(const char* program); - - inline void use() - { - currentJSLProgram = this; - jslprogram->use(); - } - - static inline void unuse() - { - currentJSLProgram = nullptr; - jin::graphics::JSLProgram::unuse(); - } - - void sendFloat(const char* name, float number) - { - jslprogram->sendFloat(name, number); - } - - void sendImage(const char* name, const Image* image) - { - jslprogram->sendTexture(name, image->getRawImage()); - } - - void sendVec2(const char* name, float x, float y) - { - jslprogram->sendVec2(name, x, y); - } - - void sendVec3(const char* name, float x, float y, float z) - { - jslprogram->sendVec3(name, x, y, z); - } - - void sendVec4(const char* name, float x, float y, float z, float w) - { - jslprogram->sendVec4(name, x, y, z, w); - } - - void sendCanvas(const char* name, const Canvas* canvas) - { - jslprogram->sendCanvas(name, canvas->getRawCanvas()); - } - - void sendColor(const char* name, const lua::graphics::color* col) - { - jslprogram->sendColor(name, col); - } - - static inline JSLProgram* getCurrentJSL() - { - return currentJSLProgram; - } - - private: - - static JSLProgram* currentJSLProgram; - - JSLProgram() {} - - ~JSLProgram() - { - delete jslprogram; - } - - jin::graphics::JSLProgram * jslprogram; - - }; - -} // graphics -} // lua -} // jin - -#endif // __JIN_LUA_GRAPHICS_JSL_H
\ No newline at end of file |