Renamed Window::Update to Window::Handle_Events.
authordewyatt
Sat, 12 Jun 2010 03:19:43 -0400
changeset 4737 0e18c79c4111
parent 4736 92b32826da12
child 4738 381d402a5e90
Renamed Window::Update to Window::Handle_Events. Removed Window::Clear. Added Window::Show_Cursor/Hide_Cursor. Added On_Resized event.
EXCLUDE/GLTSF/include/Window.hpp
EXCLUDE/GLTSF/include/Window_Listener.hpp
EXCLUDE/GLTSF/src/Window.cpp
--- a/EXCLUDE/GLTSF/include/Window.hpp	Fri Jun 11 18:32:18 2010 -0400
+++ b/EXCLUDE/GLTSF/include/Window.hpp	Sat Jun 12 03:19:43 2010 -0400
@@ -24,10 +24,11 @@
 	void Show();
 	void Hide();
 
-	void Update();
+	void Handle_Events();
 	void Display();
 
-	void Clear();
+	void Show_Cursor();
+	void Hide_Cursor();
 
 private:
 	static const wchar_t *Window_Class_Name;
--- a/EXCLUDE/GLTSF/include/Window_Listener.hpp	Fri Jun 11 18:32:18 2010 -0400
+++ b/EXCLUDE/GLTSF/include/Window_Listener.hpp	Sat Jun 12 03:19:43 2010 -0400
@@ -5,10 +5,10 @@
 {
 public:
 	virtual void On_Close(){}
-
 	virtual void On_Key_Down(int Key){}
 	virtual void On_Key_Up(int Key){}
 	virtual void On_Char(unsigned int Char){}
+	virtual void On_Resized(unsigned int Width, unsigned int Height){}
 };
 
 #endif
--- a/EXCLUDE/GLTSF/src/Window.cpp	Fri Jun 11 18:32:18 2010 -0400
+++ b/EXCLUDE/GLTSF/src/Window.cpp	Sat Jun 12 03:19:43 2010 -0400
@@ -17,6 +17,7 @@
 Window::~Window()
 {
 	Finalize();
+	Show_Cursor();
 }
 
 void Window::Initialize(const std::wstring &Title, const Video_Mode &Mode, bool Fullscreen)
@@ -219,6 +220,9 @@
 {
 	switch (Message)
 	{
+	case WM_SIZE:
+		Call_Listener(On_Resized(LOWORD(lParam), HIWORD(lParam)));
+		break;
 	case WM_CLOSE:
 		Call_Listener(On_Close());
 		break;
@@ -250,7 +254,7 @@
 		ShowWindow(my_Handle, SW_HIDE);
 }
 
-void Window::Update()
+void Window::Handle_Events()
 {
 	MSG Message = {0};
 	while (PeekMessageW(&Message, NULL, 0, 0, PM_REMOVE))
@@ -266,7 +270,12 @@
 		SwapBuffers(my_Device_Context);
 }
 
-void Window::Clear()
+void Window::Show_Cursor()
 {
-	glClear(GL_COLOR_BUFFER_BIT);
+	ShowCursor(TRUE);
 }
+
+void Window::Hide_Cursor()
+{
+	ShowCursor(FALSE);
+}