1
0
Fork 0
spectre/examples/input/InputExample.h

42 lines
742 B
C++

#ifndef INPUT_EXAMPLE_H
#define INPUT_EXAMPLE_H
#include <Spectre/Scene/Camera2D.h>
#include <Spectre/Graphics/Texture.h>
#include <Spectre/Graphics/Sprite.h>
#include <Spectre/System/EventListener.h>
#include <Spectre/Game.h>
namespace sp {
class Renderer2D;
}
class InputExample : public sp::Game, sp::EventListener
{
protected :
void init();
void update(double dt);
void render();
void onSizeChanged(sp::Display* display, int width, int height);
void onEvent(const sp::Event& event);
private :
sp::Camera2D m_camera;
sp::Renderer2D *m_renderer;
sp::Sprite m_kb_sprite;
sp::Sprite m_mouse_sprite;
sp::Sprite m_mouse_event_sprite;
bool m_right_mouse_down;
sp::Texture m_tux_texture;
};
#endif /* INPUT_EXAMPLE_H*/