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
<?php | |
var_dump(class_exists('TestClass')); die; | |
class TestClass { | |
} |
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
<script type="text/javascript"> | |
// Adding an extra 10% in here because both iPhone and Android are repeating the background despite | |
// the no-repeat and this fixes it | |
$('body').css('background', "url('/image.php?w=" + ($(window).width() * 1.1) + "&h=" + ($(window).height() * 1.1) + "')"); | |
</script> |
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 Component { | |
public: | |
Component() : next(0) {}; | |
~Component(); | |
// A stub function that will help us determine this class's type later | |
virtual void stub() {} | |
public: | |
Component* next; |
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 System { | |
public: | |
System(); | |
~System(); | |
// Add a new entity to this system by its component | |
void AddComponent(Component* component); | |
// Remove an entity by its component | |
void RemoveComponent(Component* component); |
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 Entity { | |
public: | |
Entity(); | |
~Entity(); | |
public: | |
void AddComponent(Component* component); | |
template<class T> | |
Component* GetComponent() { |
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
Renderable* renderable = (Renderable*)entity->GetComponent<Renderable>(); |
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 Renderable : public Component { | |
public: | |
Renderable(); | |
~Renderable(); | |
public: | |
// Position in world space | |
glm::vec3 position; | |
// Local rotation |
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 RenderSystem : System { | |
public: | |
RenderSystem(); | |
~RenderSystem(); | |
// Initialize/shut down the render system | |
void Initialize(); | |
void Shutdown(); | |
// Our main update function |
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 <GL/glew.h> | |
#include <GLFW/glfw3.h> | |
#include <glm/glm.hpp> | |
#include <glm/gtc/quaternion.hpp> | |
#include <error.h> | |
#include <component.h> | |
#include <system.h> | |
#include <rendersystem.h> | |
#include <renderable.h> |
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
/* INCLUDES */ | |
#include <GLFW/glfw3.h> | |
#include <component.h> | |
#include <system.h> | |
#include <rendersystem.h> | |
/* GLOBAL VARIABLES */ |
OlderNewer