| 360 | // *********************************************************************** |
| 361 | |
| 362 | int BindGraphics(lua_State* pLua) { |
| 363 | |
| 364 | // Global functions |
| 365 | /////////////////// |
| 366 | |
| 367 | const luaL_Reg graphicsFuncs[] = { |
| 368 | { "begin_object_2d", LuaBeginObject2D }, |
| 369 | { "end_object_2d", LuaEndObject2D }, |
| 370 | { "vertex", LuaVertex }, |
| 371 | { "begin_object_3d", LuaBeginObject3D }, |
| 372 | { "end_object_3d", LuaEndObject3D }, |
| 373 | { "color", LuaColor }, |
| 374 | { "texcoord", LuaTexCoord }, |
| 375 | { "normal", LuaNormal }, |
| 376 | { "set_cull_mode", LuaSetCullMode }, |
| 377 | { "set_clear_color", LuaSetClearColor }, |
| 378 | { "matrix_mode", LuaMatrixMode }, |
| 379 | { "push_matrix", LuaPushMatrix }, |
| 380 | { "pop_matrix", LuaPopMatrix }, |
| 381 | { "load_matrix", LuaLoadMatrix }, |
| 382 | { "get_matrix", LuaGetMatrix }, |
| 383 | { "perspective", LuaPerspective }, |
| 384 | { "translate", LuaTranslate }, |
| 385 | { "rotate", LuaRotate }, |
| 386 | { "scale", LuaScale }, |
| 387 | { "identity", LuaIdentity }, |
| 388 | { "bind_texture", LuaBindTexture }, |
| 389 | { "unbind_texture", LuaUnbindTexture }, |
| 390 | { "normals_mode", LuaNormalsMode }, |
| 391 | { "enable_lighting", LuaEnableLighting }, |
| 392 | { "light", LuaLight }, |
| 393 | { "ambient", LuaAmbient }, |
| 394 | { "enable_fog", LuaEnableFog }, |
| 395 | { "set_fog_start", LuaSetFogStart }, |
| 396 | { "set_fog_end", LuaSetFogEnd }, |
| 397 | { "set_fog_color", LuaSetFogColor }, |
| 398 | { "draw_sprite", LuaDrawSprite }, |
| 399 | { "draw_sprite_rect", LuaDrawSpriteRect }, |
| 400 | { NULL, NULL } |
| 401 | }; |
| 402 | |
| 403 | lua_pushvalue(pLua, LUA_GLOBALSINDEX); |
| 404 | luaL_register(pLua, NULL, graphicsFuncs); |
| 405 | lua_pop(pLua, 1); |
| 406 | |
| 407 | return 0; |
| 408 | } |
| 409 | } |