#include <Window.h>
Inherits InputContext.
Inheritance diagram for Window:


Public Member Functions | |
| Window () | |
| Standard constructor. | |
| virtual | ~Window () |
| Standard destructor. | |
| virtual void | switchFullscreen () |
| Switches to full screen mode (not implemented yet). | |
| virtual int | swapBuffers () |
| Causes the Grafikal buffer to swap. | |
| virtual int | makeCurrent () |
| Connects device context and render context. | |
| virtual int | killWindow () |
| Closes the window. | |
| virtual HWND | createWindow (std::string name, int p_height, int p_width, int depth, bool p_fullscreen) |
| Creates a new window and returns the handle to it. | |
| virtual int | clearCurrent () |
| Disconnects device context and render context. | |
| int | checkMessages () |
| Checks for new window messages. | |
| virtual int | BuildFont () |
| Builds the fonts for text ouput. | |
Static Public Member Functions | |
| static LRESULT CALLBACK | WndProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) |
| Callback function that handles the windows messages. | |
Public Attributes | |
| int | width |
| Holds the width of the window. | |
| int | height |
| Holds the height of the window. | |
| Vector3i | mousePos |
| Used for storing the current mouse pointer position in window coordinates. | |
| std::map< int, std::string > | scancodes |
| Map for storing the mapping of thee scancodes. | |
Static Public Attributes | |
| static std::map< HWND, Window * > | openWindows |
| Holds all windows that has been created. | |
Protected Attributes | |
| HGLRC | hRC |
| Permanent Rendering Context. | |
| HDC | hDC |
| Private GDI Device Context. | |
| HWND | hWnd |
| Holds Our Window Handle. | |
| HINSTANCE | hInstance |
| Holds The Instance Of The Application. | |
| bool | fullscreen |
| Flag that states if fullscreen is switched on or not. | |
Definition at line 35 of file Window.h.
| Window::Window | ( | ) |
Standard constructor.
The Map for the scancodes is initialized here.
Definition at line 27 of file Window.cpp.
References scancodes.
| Window::~Window | ( | ) | [virtual] |
| void Window::switchFullscreen | ( | ) | [virtual] |
| int Window::swapBuffers | ( | ) | [virtual] |
Causes the Grafikal buffer to swap.
Definition at line 275 of file Window.cpp.
References hDC.
Referenced by Level::run(), and Menu::writeText().
| int Window::makeCurrent | ( | ) | [virtual] |
Connects device context and render context.
Definition at line 262 of file Window.cpp.
Referenced by GLInterface::initGL().
| int Window::killWindow | ( | ) | [virtual] |
Closes the window.
Definition at line 221 of file Window.cpp.
References fullscreen, hDC, hRC, hWnd, and openWindows.
Referenced by createWindow().
| HWND Window::createWindow | ( | std::string | name, | |
| int | p_height, | |||
| int | p_width, | |||
| int | depth, | |||
| bool | p_fullscreen | |||
| ) | [virtual] |
Creates a new window and returns the handle to it.
| name | Name to be displayed for the window. | |
| p_height | Height for the window. | |
| p_width | Width for the window. | |
| depth | Color depth of the window. | |
| p_fullscreen | Flag for full screen mode. |
Definition at line 78 of file Window.cpp.
References fullscreen, hDC, height, hInstance, hRC, hWnd, killWindow(), openWindows, and width.
Referenced by WinMain().
Here is the call graph for this function:

| int Window::clearCurrent | ( | ) | [virtual] |
Disconnects device context and render context.
Definition at line 65 of file Window.cpp.
Referenced by Menu::getSelectedItem(), and Menu::getString().
| int Window::checkMessages | ( | ) |
Checks for new window messages.
Definition at line 47 of file Window.cpp.
Referenced by Level::checkInput(), Menu::getSelectedItem(), and Menu::getString().
| int Window::BuildFont | ( | ) | [virtual] |
Builds the fonts for text ouput.
Definition at line 290 of file Window.cpp.
References hDC.
Referenced by GLInterface::initGL().
| LRESULT CALLBACK Window::WndProc | ( | HWND | hWnd, | |
| UINT | uMsg, | |||
| WPARAM | wParam, | |||
| LPARAM | lParam | |||
| ) | [static] |
Callback function that handles the windows messages.
| hWnd | This is the unique handle of the window. | |
| uMsg | This is the message your window has received. | |
| wParam | Each message sent to your window can have a number of extra values. | |
| lParam | Each message sent to your window can have a number of extra values. |
Definition at line 321 of file Window.cpp.
References openWindows, and InputContext::pushMessage().
Here is the call graph for this function:

std::map< HWND, Window * > Window::openWindows [static] |
Holds all windows that has been created.
Definition at line 119 of file Window.h.
Referenced by createWindow(), killWindow(), and WndProc().
| int Window::width |
Holds the width of the window.
Definition at line 124 of file Window.h.
Referenced by createWindow(), Level::initViewCamera(), Level::pick(), FunctionHandler::scroll(), Level::setViewportCamera(), Level::setViewportInterface(), and Menu::writeText().
| int Window::height |
Holds the height of the window.
Definition at line 129 of file Window.h.
Referenced by createWindow(), Level::initViewCamera(), FunctionHandler::scroll(), Level::setViewportCamera(), and Menu::writeText().
Used for storing the current mouse pointer position in window coordinates.
Definition at line 134 of file Window.h.
Referenced by FunctionHandler::grabScreen(), Level::pick(), and FunctionHandler::scroll().
| std::map<int, std::string> Window::scancodes |
HGLRC Window::hRC [protected] |
Permanent Rendering Context.
Definition at line 146 of file Window.h.
Referenced by createWindow(), killWindow(), and makeCurrent().
HDC Window::hDC [protected] |
Private GDI Device Context.
Definition at line 151 of file Window.h.
Referenced by BuildFont(), createWindow(), killWindow(), makeCurrent(), and swapBuffers().
HWND Window::hWnd [protected] |
Holds Our Window Handle.
Definition at line 156 of file Window.h.
Referenced by createWindow(), and killWindow().
HINSTANCE Window::hInstance [protected] |
Holds The Instance Of The Application.
Definition at line 161 of file Window.h.
Referenced by createWindow().
bool Window::fullscreen [protected] |
Flag that states if fullscreen is switched on or not.
Definition at line 166 of file Window.h.
Referenced by createWindow(), and killWindow().
1.5.2