SimpleFastOpenAtomicVisualiser
Loading...
Searching...
No Matches
utils.h
Go to the documentation of this file.
1#ifndef UTILS_H
2#define UTILS_H
3
13{
14 if (lua_gettop(lua) >= 1 && lua_isstring(lua, 1) && std::string(lua_tostring(lua, 1)) == "help")
15 {
16 lua_writestring("setText:\n Arguments:\n message [string]\n Set the info message.\n");
17 return 0;
18 };
19 int args = lua_gettop(lua);
20 if (args != 1)
21 {
22 const std::string msg = "setText expects a string as argument.\n";
23 lua_pushlstring(lua, msg.c_str(), msg.length());
24 return lua_error(lua);
25 }
26
28 s.read(lua, 1);
29
30 text = s.characters;
31
32 return 0;
33}
34
42{
43 if (lua_gettop(lua) >= 1 && lua_isstring(lua, 1) && std::string(lua_tostring(lua, 1)) == "help")
44 {
45 lua_writestring("getFrame:\n Arguments: none\n Get the current frame number.");
46 return 0;
47 };
49 return 1;
50}
51
52#endif /* UTILS_H */
glm::vec< L, float, glm::qualifier::highp > vec
Definition commandLine.h:214
Interop for a string in Lua.
Definition LuaString.h:12
void read(lua_State *lua, int index)
Read the string from stack index index.
Definition LuaString.h:28
int lua_setText(lua_State *lua)
Set the on screen text.
Definition utils.h:12
uint64_t frame
Definition visualisationState.h:126
int lua_getFrame(lua_State *lua)
Get the current frame number.
Definition utils.h:41
std::string text
Definition visualisationState.h:125