This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <EntityPool.hpp> | |
#include <ScenePool.hpp> | |
Scene& Game::createScene(const std::string &name) | |
{ | |
return m_scenePool->createScene(name); | |
} | |
Entity& Game::createEntity() | |
{ | |
return m_entityPool->createEntity(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Game | |
{ | |
public: | |
// ... game loop functions and createX functions for scenes, systems and entities | |
// as well as functions like running a lua script in the global lua environment | |
EntityPool& getEntityPool(); | |
ScenePool& getScenePool(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
icmp_seq=17 ttl=64 time=1.07 ms | |
icmp_seq=18 ttl=64 time=0.836 ms | |
icmp_seq=19 ttl=64 time=0.887 ms | |
icmp_seq=20 ttl=64 time=0.907 ms | |
icmp_seq=21 ttl=64 time=0.895 ms | |
icmp_seq=22 ttl=64 time=0.874 ms | |
icmp_seq=23 ttl=64 time=0.916 ms | |
icmp_seq=24 ttl=64 time=0.795 ms | |
icmp_seq=25 ttl=64 time=3.29 ms | |
icmp_seq=26 ttl=64 time=197 ms |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace internal | |
{ | |
// Forward declare OpenAL dependant classes | |
class ALSourceWrapper; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print(type(SWAG)) | |
SWAG:Add(55) | |
SWAG:Print() | |
SWAG:Add("This should report an error, but it doesn't") | |
-- Everything below not called, since the above add call results in an error | |
SWAG:Print() | |
SWAG:Add() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Saurobyte::LuaEnvironment env; | |
env.createClass("Jebus", | |
{ | |
{ "Print", [] (Saurobyte::LuaEnvironment& env) -> int | |
{ | |
printf("\nVal %i\n", env.toObject<int>("Jebus")); | |
return 0; | |
} | |
}, | |
{ "Add", [] (Saurobyte::LuaEnvironment& env) -> int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Saurobyte::LuaEnvironment env; | |
env.createClass("Testeru", | |
{ | |
{ "Print", [] (Saurobyte::LuaEnvironment& env) -> int | |
{ | |
printf("\nVal %i\n", *env.toObject<int>("Testeru")); | |
return 0; | |
} | |
}, | |
{ "Add", [] (Saurobyte::LuaEnvironment& env) -> int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<typename TType, typename ...TArgs> | |
typename std::enable_if<std::is_arithmetic<TType>::value && !std::is_same<bool, TType>::value, int>::type pushArgToLua(TType arg, TArgs... args) | |
{ | |
lua_pushnumber(m_luaContext, arg); | |
return 1 + pushArgToLua(args...); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool AudioDevice::playSound(const std::string &name) | |
{ | |
auto threadFunc = [] (void *data) -> int | |
{ | |
AudioSource *audio = static_cast<AudioSource*>(data); | |
audio->updateData(); | |
AudioDevice::deleteSound(audio); | |
return 0; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function init() | |
print("INIT") | |
SubscribeEvent("KeyDown") | |
end | |
local r, g, b = 1,1,1 | |
function update(delta) | |
local x, y = GetMousePos() | |
if (IsMousePressed("left")) then |
NewerOlder