-
Notifications
You must be signed in to change notification settings - Fork 0
/
LuaGraphics.h
48 lines (35 loc) · 869 Bytes
/
LuaGraphics.h
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
38
39
40
41
42
43
44
45
46
47
48
#pragma once
#include "RustyLib.h"
namespace LuaGraphics
{
extern "C"
{
std::string DrawRectString = "DrawRect";
static int DrawRect(lua_State* lua_state)
{
using RustyLib::Graphics::Renderer;
int minX,minY,maxX,maxY;
minX = LuaUtils::GetInt(1);
minY = LuaUtils::GetInt(2);
maxX = LuaUtils::GetInt(3);
maxY = LuaUtils::GetInt(4);
if(LuaUtils::GetErrorCode()) return 0;
Renderer* r = &Renderer::Instance();
r->RenderRect(minX,minY,maxX,maxY);
return 0;
}
std::string DrawTextString = "DrawText";
static int DrawText(lua_State* lua_state)
{
using RustyLib::Graphics::Renderer;
std::string text;
int minX,minY;
text = LuaUtils::GetString(1);
minX = LuaUtils::GetInt(2);
minY = LuaUtils::GetInt(3);
Renderer* r = &Renderer::Instance();
r->RenderText(text, minX, minY);
return 0;
}
}
}