OpenGTA/lua_addon/lua_screen.cpp
Anonymous Maarten 78c27f03c8 2006-12-10
2015-12-03 01:37:02 +01:00

32 lines
821 B
C++

#include "lua_screen.h"
namespace OpenGTA {
namespace Script {
using namespace OpenGL;
int Screen::getFullscreen(lua_State *L) {
bool b = ScreenHolder::Instance().getFullscreen();
lua_pushboolean(L, b);
return 1;
}
int Screen::setFullscreen(lua_State *L) {
bool b = ScreenHolder::Instance().getFullscreen();
bool v = lua_toboolean(L, 1);
if (b != v)
ScreenHolder::Instance().toggleFullscreen();
return 0;
}
int Screen::makeScreenShot(lua_State *L) {
ScreenHolder::Instance().makeScreenshot(luaL_checkstring(L, 1));
return 0;
}
#define method(name) {#name, Screen::name}
const luaL_reg Screen::methods[] = {
method(setFullscreen),
method(getFullscreen),
method(makeScreenShot),
{NULL, NULL}
};
}
}