Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Renamed Window::Update to Window::Handle_Events.

Removed Window::Clear.
Added Window::Show_Cursor/Hide_Cursor.
Added On_Resized event.
  • Loading branch information
dewyatt committed Jun 12, 2010
1 parent b5e4ed3 commit 381873fa15875d4c0168264296da2cf026391a2f
Showing with 16 additions and 6 deletions.
  1. +3 −2 EXCLUDE/GLTSF/include/Window.hpp
  2. +1 −1 EXCLUDE/GLTSF/include/Window_Listener.hpp
  3. +12 −3 EXCLUDE/GLTSF/src/Window.cpp
@@ -24,10 +24,11 @@ class Window
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;
@@ -5,10 +5,10 @@ class Window_Listener
{
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
@@ -17,6 +17,7 @@ Window::Window() : my_Handle(0),
Window::~Window()
{
Finalize();
Show_Cursor();
}

void Window::Initialize(const std::wstring &Title, const Video_Mode &Mode, bool Fullscreen)
@@ -219,6 +220,9 @@ LRESULT Window::Handle_Message(HWND Handle, UINT Message, WPARAM wParam, LPARAM
{
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 @@ void Window::Hide()
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 @@ void Window::Display()
SwapBuffers(my_Device_Context);
}

void Window::Clear()
void Window::Show_Cursor()
{
ShowCursor(TRUE);
}

void Window::Hide_Cursor()
{
glClear(GL_COLOR_BUFFER_BIT);
ShowCursor(FALSE);
}

0 comments on commit 381873f

Please sign in to comment.