aboutsummaryrefslogtreecommitdiff
path: root/src/client/lua_api/load_game.cpp
blob: 469b219bfee007e8d5a4ad7cb642d3b8f6e4d3bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <map>
extern "C" {
  #include <lua.h>
  #include <lauxlib.h>
  #include <lualib.h>
}
#include <irrlicht.h>

#include "gui/iguibutton.hpp"
#include "gui/iguilabel.hpp"
#include "../callbackhandeler.hpp"
#include "guiparts.hpp"

using namespace irr;
using namespace gui;
using namespace core;

extern IrrlichtDevice* device;

//exit()
int exit_game(lua_State *L){
	device->closeDevice();
	return 0;
}

void load_gamefuncs(lua_State* L){
	lua_newtable(L);
	lua_setglobal(L,"GAME");

	lua_getglobal(L,"GAME");
	lua_pushcfunction(L,exit_game);
	lua_setfield(L,-2,"exit");
	lua_pop(L,1);
}