summaryrefslogtreecommitdiff
path: root/engines/kokompe/kokompe/KokompeUI/SDLPanel.h
blob: eabaa904d51137405952984ad0bf4564948eea95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#pragma once

#include <wx/wx.h>
#include <wx/xrc/xmlres.h>
#include <SDL/SDL.h>

class SDLPanel : public wxPanel {
	/*
	 *  This class makes SDL into a wxWidget.
	 */
	DECLARE_CLASS(SDLPanel)
	DECLARE_EVENT_TABLE()
    
	private:
		SDL_Surface *screen;

		void onPaint(wxPaintEvent &event);
		void onEraseBackground(wxEraseEvent &event);
		void onIdle(wxIdleEvent &event);
		void createScreen();

	public:
		SDLPanel(wxWindow *parent);
		SDLPanel();
		~SDLPanel();
};


class SDLPanelXmlHandler : public wxXmlResourceHandler {
	/*
	 *  This class exposes the SDLPanel widget to XRC.
	 */
	DECLARE_DYNAMIC_CLASS(SDLPanelXmlHandler)
	
	public:
		SDLPanelXmlHandler();
		virtual wxObject *DoCreateResource();
		virtual bool CanHandle(wxXmlNode *node);
};