CS488 PA6
SDLFrameBuffer.h
1 #ifndef edu_jmu_cs_SDLFrameBuffer_h
2 #define edu_jmu_cs_SDLFrameBuffer_h
3 
4 #include "FrameBuffer.h"
5 #include "Color.h"
6 #include "SDL2/SDL.h"
7 
11 class SDLFrameBuffer: public FrameBuffer {
12  public:
19  SDLFrameBuffer(int width, int height);
20 
25 
26  virtual void clear(const Color& color);
27 
28  virtual int getHeight() const;
29 
30  virtual int getWidth() const;
31 
40  virtual void setKeyboardHandler(void (*handler)(const SDL_Event& event));
41 
42  virtual void setPixel(int x, int y, const Color& color);
43 
44  virtual void show();
45 
46  private:
51 
55  SDL_Renderer* renderer;
56 
60  SDL_Window* window;
61 
67  void (*keyboardHandler)(const SDL_Event& event);
68 };
69 
70 #endif
virtual void setKeyboardHandler(void(*handler)(const SDL_Event &event))
Definition: SDLFrameBuffer.cpp:63
Definition: FrameBuffer.h:13
SDL_Renderer * renderer
Definition: SDLFrameBuffer.h:55
virtual void show()
Definition: SDLFrameBuffer.cpp:78
Definition: Color.h:7
SDLFrameBuffer(int width, int height)
Definition: SDLFrameBuffer.cpp:5
bool keepRunning
Definition: SDLFrameBuffer.h:50
SDL_Window * window
Definition: SDLFrameBuffer.h:60
int height
Definition: FrameBuffer.h:54
virtual void setPixel(int x, int y, const Color &color)
Definition: SDLFrameBuffer.cpp:68
virtual int getHeight() const
Definition: SDLFrameBuffer.cpp:53
~SDLFrameBuffer()
Definition: SDLFrameBuffer.cpp:38
virtual int getWidth() const
Definition: SDLFrameBuffer.cpp:58
void(* keyboardHandler)(const SDL_Event &event)
Definition: SDLFrameBuffer.h:67
virtual void clear(const Color &color)
Definition: SDLFrameBuffer.cpp:45
int width
Definition: FrameBuffer.h:59
Definition: SDLFrameBuffer.h:11