#ifndef _SDLFRAME_H_
#define _SDLFRAME_H_

class MonitorFrame;
class SDLPanel;

class SDLFrame : public wxMDIChildFrame
{
public:
	SDLFrame(wxMDIParentFrame* parent,
		MonitorFrame *myFrame,
		wxWindowID id = wxID_ANY,
		const wxString& title = wxT("Monitor #1"),
		const wxPoint& pos = wxDefaultPosition,
		const wxSize& size = wxDefaultSize,
		long style = wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE
	);

    ~SDLFrame();

public:
	MonitorFrame *myFrame;

    SDLPanel *m_panel;
	SDL_Surface *m_surface;

	SDL_Surface *m_bufferSurface;
	SDL_Surface *m_blitSurface;
	
	unsigned int *m_buffer;
	int m_width;
	int m_height;

public:
	void Init(int width, int height);
	void Update(void *buffer);
	void Free();
	int GetWidth();
	int GetHeight();
	SDL_Surface* GetSurface();
	void Lock();
	void Unlock();

private:
	void OnIdle(wxIdleEvent& event);
	void OnSize(wxSizeEvent& event);
	void OnClose(wxCloseEvent& WXUNUSED(event));

	DECLARE_EVENT_TABLE()
};

#endif

