From e8e12b11db220160eb63727fb03548410bf3afd2 Mon Sep 17 00:00:00 2001 From: chai Date: Sun, 25 Nov 2018 00:11:28 +0800 Subject: *misc --- src/lua/modules/graphics/je_lua_graphics.cpp | 120 +++++++++++++++------------ 1 file changed, 66 insertions(+), 54 deletions(-) (limited to 'src/lua/modules/graphics/je_lua_graphics.cpp') diff --git a/src/lua/modules/graphics/je_lua_graphics.cpp b/src/lua/modules/graphics/je_lua_graphics.cpp index 36829ab..d2f663d 100644 --- a/src/lua/modules/graphics/je_lua_graphics.cpp +++ b/src/lua/modules/graphics/je_lua_graphics.cpp @@ -888,6 +888,17 @@ namespace JinEngine return 1; } + LUA_IMPLEMENT int l_newParticleSystem(lua_State* L) + { + // Definition table. + if (!luax_istable(L, 1)) + { + luax_typerror(L, 1, "particle system definition table"); + return 1; + } + + } + /* setFont(font) */ LUA_IMPLEMENT int l_setFont(lua_State* L) { @@ -920,13 +931,13 @@ namespace JinEngine LUA_IMPLEMENT int l_pushMatrix(lua_State* L) { - gl.push(); + gl.pushMatrix(); return 0; } LUA_IMPLEMENT int l_popMatrix(lua_State* L) { - gl.pop(); + gl.popMatrix(); return 0; } @@ -971,59 +982,60 @@ namespace JinEngine luaL_Reg methods[] = { /* window */ - { "init", l_init }, - { "setTitle", l_setTitle }, - { "getSize", l_getSize }, - { "getWidth", l_getWidth }, - { "getHeight", l_getHeight }, - { "destroy", l_destroy }, - { "hideWindow", l_hideWindow }, - { "showWindow", l_showWindow }, - /* creators */ - { "newBitmap", l_newBitmap }, - { "newTexture", l_newTexture }, - { "newShader", l_newShader }, - { "newShaderf", l_newShaderf }, - { "newCanvas", l_newCanvas }, - { "newTTFData", l_newTTFData }, - { "newText", l_newText }, - { "newTextureFont", l_newTextureFont }, - { "newSprite", l_newSprite }, - { "newSpriteSheet", l_newSpriteSheet }, - { "newAnimation", l_newAnimation }, - { "newAnimator", l_newAnimator }, + { "init", l_init }, + { "setTitle", l_setTitle }, + { "getSize", l_getSize }, + { "getWidth", l_getWidth }, + { "getHeight", l_getHeight }, + { "destroy", l_destroy }, + { "hideWindow", l_hideWindow }, + { "showWindow", l_showWindow }, + /* creators */ + { "newBitmap", l_newBitmap }, + { "newTexture", l_newTexture }, + { "newShader", l_newShader }, + { "newShaderf", l_newShaderf }, + { "newCanvas", l_newCanvas }, + { "newTTFData", l_newTTFData }, + { "newText", l_newText }, + { "newTextureFont", l_newTextureFont }, + { "newSprite", l_newSprite }, + { "newSpriteSheet", l_newSpriteSheet }, + { "newAnimation", l_newAnimation }, + { "newAnimator", l_newAnimator }, + { "newParticleSystem", l_newParticleSystem }, /* render */ - { "setClearColor", l_setClearColor }, - { "clear", l_clear }, - { "draw", l_draw }, - { "print", l_print }, - { "drawq", l_drawq }, - { "setColor", l_setColor }, - { "getColor", l_getColor }, - { "present", l_present }, - /* canvas */ - { "bindCanvas", l_bindCanvas }, - { "unbindCanvas", l_unbindCanvas }, - /* shader */ - { "useShader", l_useShader }, - /* shapes */ - { "point", l_point }, - { "line", l_line }, - { "rect", l_rect }, - { "circle", l_circle }, - { "triangle", l_triangle }, - { "polygon", l_polygon }, - /* font */ - { "setFont", l_setFont }, - { "unsetFont", l_unsetFont }, - /* transform */ - { "pushMatrix", l_pushMatrix }, - { "clearMatrix", l_clearMatrix }, - { "popMatrix", l_popMatrix }, - { "translate", l_translate }, - { "rotate", l_rotate }, - { "scale", l_scale }, - { 0, 0 } + { "setClearColor", l_setClearColor }, + { "clear", l_clear }, + { "draw", l_draw }, + { "print", l_print }, + { "drawq", l_drawq }, + { "setColor", l_setColor }, + { "getColor", l_getColor }, + { "present", l_present }, + /* canvas */ + { "bindCanvas", l_bindCanvas }, + { "unbindCanvas", l_unbindCanvas }, + /* shader */ + { "useShader", l_useShader }, + /* shapes */ + { "point", l_point }, + { "line", l_line }, + { "rect", l_rect }, + { "circle", l_circle }, + { "triangle", l_triangle }, + { "polygon", l_polygon }, + /* font */ + { "setFont", l_setFont }, + { "unsetFont", l_unsetFont }, + /* transform */ + { "pushMatrix", l_pushMatrix }, + { "clearMatrix", l_clearMatrix }, + { "popMatrix", l_popMatrix }, + { "translate", l_translate }, + { "rotate", l_rotate }, + { "scale", l_scale }, + { 0, 0 } }; // Load whole lib. luax_newlib(L, methods); -- cgit v1.1-26-g67d0