Mercurial > sdl-ios-xcode
changeset 4737:0e18c79c4111
Renamed Window::Update to Window::Handle_Events.
Removed Window::Clear.
Added Window::Show_Cursor/Hide_Cursor.
Added On_Resized event.
author | dewyatt |
---|---|
date | Sat, 12 Jun 2010 03:19:43 -0400 |
parents | 92b32826da12 |
children | 381d402a5e90 |
files | EXCLUDE/GLTSF/include/Window.hpp EXCLUDE/GLTSF/include/Window_Listener.hpp EXCLUDE/GLTSF/src/Window.cpp |
diffstat | 3 files changed, 16 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- 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); +}