1
0
Fork 0
spectre/examples/input/InputExample.h
Henrik Hautakoski 24da7f45e0 Rename Display to Window.
It makes more sense to be consistent and always call it window.
2023-08-22 07:12:47 +02:00

42 lines
741 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::Window* 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*/