Scarab
A thin, game-agnostic 2D engine host built on the sunlight tile-map engine
Loading...
Searching...
No Matches
luarendererapi.h
Go to the documentation of this file.
1/*
2 * Copyright (c) since 2021 by PopolonY2k and Leidson Campos A. Ferreira
3 *
4 * This software is provided 'as-is', without any express or implied
5 * warranty. In no event will the authors be held liable for any damages
6 * arising from the use of this software.
7 *
8 * Permission is granted to anyone to use this software for any purpose,
9 * including commercial applications, and to alter it and redistribute it
10 * freely, subject to the following restrictions:
11 *
12 * 1. The origin of this software must not be misrepresented; you must not
13 * claim that you wrote the original software. If you use this software
14 * in a product, an acknowledgment in the product documentation would be
15 * appreciated but is not required.
16 * 2. Altered source versions must be plainly marked as such, and must not be
17 * misrepresented as being the original software.
18 * 3. This notice may not be removed or altered from any source distribution.
19 */
20
21#ifndef __LUARENDERERAPI_H__
22#define __LUARENDERERAPI_H__
23
24#include <string>
25
26extern "C"
27{
28 #include "lua.h"
29}
30
31
32namespace Scarab {
33 namespace Engine {
34 namespace Lua {
60
61 static int RendererCreate( lua_State *pLuaState );
62 static int RendererDestroy( lua_State *pLuaState );
63 static int RendererGetCurrent( lua_State *pLuaState );
64 static int RendererGetConfig( lua_State *pLuaState );
65 static int RendererGetDefaultView( lua_State *pLuaState );
66 static int RendererGetBackend( lua_State *pLuaState );
67 static int RendererGetViewCount( lua_State *pLuaState );
68
69 static void RegisterEnums( lua_State *pLuaState );
70
71 public:
72
73 static bool CheckHandle( lua_State *pLuaState, int nIndex, std :: string &strError );
74 static bool ValidateZoomFactor( double fFactor, unsigned &nZoomPos, std :: string &strError );
75 static void Register( lua_State *pLuaState );
76 };
77 }
78 }
79}
80
81#endif /* __LUARENDERERAPI_H__ */
Renderer lifecycle Lua primitives: create the process's one renderer from a script,...
Definition luarendererapi.h:59
static void Register(lua_State *pLuaState)
Register the renderer lifecycle Lua-callable functions and constants.
Definition luarendererapi.cpp:806
static bool ValidateZoomFactor(double fFactor, unsigned &nZoomPos, std ::string &strError)
Check a zoom FACTOR and convert it to sunlight's zoom position.
Definition luarendererapi.cpp:87
static bool CheckHandle(lua_State *pLuaState, int nIndex, std ::string &strError)
Check that argument nIndex names the current renderer.
Definition luarendererapi.cpp:410
Definition irendererprovider.h:32