# HG changeset patch # User dewyatt # Date 1276327183 14400 # Node ID 0e18c79c4111a8f5c54ef6f49fad66972e992c1b # Parent 92b32826da1267b3144813c1392beaa1c8543a1a Renamed Window::Update to Window::Handle_Events. Removed Window::Clear. Added Window::Show_Cursor/Hide_Cursor. Added On_Resized event. diff -r 92b32826da12 -r 0e18c79c4111 EXCLUDE/GLTSF/include/Window.hpp --- 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; diff -r 92b32826da12 -r 0e18c79c4111 EXCLUDE/GLTSF/include/Window_Listener.hpp --- 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 diff -r 92b32826da12 -r 0e18c79c4111 EXCLUDE/GLTSF/src/Window.cpp --- 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); +}