Window Creation & Destruction Functions
These functions request that the window manager either creates a window, returning a handle to it or destorys a named window or the current active window.
CreateWin
Function Prototypes
- winHnd CreateWin(int display, std::string const &title, winprop initwindow = winprops::initogl)
Creates a window on a specified display, with a specified title and allows the end user to select if OpenGL is initalised on the window at creation time - winHnd CreateWin(int display = 0, winprop initwindow = winprops::initogl)
Creates a window either on the specified display or the default one and allows the end user to select if OpenGL is initalised on the window at creation time . If no parameters are provided then this is the default window creation method. - winHnd CreateWin(std::string const &title, winprop initwindow = winprops::initogl)
Creates a window on the default display with a specified title and allows the end user to select if OpenGL is intialised on the window at creation time - winHnd CreateWin(winprop initwindow)
Creates a window on the default display with the default title but allowing the end user to select if OpenGL is initalised on the window at creation time.
Return Value
- A handle to the window created. In a single window system this can be safely ignored as the WindowManager tracks the current currently active window
Possible Known Exceptions
- std::logic_error
- std::runtime_error
Other Details / Notes
- If OpenGL initalisation isnt selected at window creation time then the end user is responcible for ensuring the context is initalised before attempting to draw anything via OpenGL
- If the window can not be created for some reason then an std::runtime_error is thrown
- If OpenGL intalisation is requested on window creation and this fails for any reason then std::runtime_error is thrown
- If the end user attempts to create two windows on the same display in fullscreen mode then an std::logic_error is thrown
- Apon a successfull creation of the new window is considered the 'current' window by the window manager
- Apon a successfull creation of the new window, if OpenGL initalisation is requested then that window will hold the current context for all OpenGL operations
DestroyWin
Function Prototypes
- void DestroyWin(winHnd window)
Destroys a window, either matching the handle given. If the window to be destroyed is the current then no window is left current in the window manager. - void DestroyWin()
Destroys the window which is current for the window manager.
Return Value
- None
Possible Known Exceptions
- None
Other Details / Notes