Window Manager Setup Functions
These functions provide setup features for the framework, either by requesting the most compatible modes or by initalising the system and detecting all the modes availble.
Init
Function Prototypes
- void Init()
Initalises the Window Manager which performs the detection of valid OpenGL contexts and display modes. GLee is also used to initalise the OpenGL extensions.
Return Value
- None
Possible Known Exceptions
- std::logic_error
- std::runtime_error
Other Details / Notes
- If GLee cant initalise the extensions for OpenGL an std::runtime_error is thrown
- Once the Window Manager has been initalised the OpenGL and Display modes can be retrived via their relivent Enum functions.
FindCompatibleOGLMode
Function Prototypes
- bool FindCompatibleOGLMode(int bpp = 24, int alpha = 8, int zbuf = 24, bool doublebuffer = true, int stencil = 0, int fsaalvl = 0, int accum = 0)
Sets the window manager up with an OpenGL context which matches the requested format. - bool FindCompatibleOGLMode(openglcaps &caps)
Sets the window manager up with an OpenGL context which matches the requested format. If a format is found the passed in caps structure is updated to reflect the new format.
Return Value
- True if a format was found and set as current
- False if the requested format cant be found
Possible Known Exceptions
- std::runtime_error
Other Details / Notes
- If GLee fails to initalise the extensions then std::runtime_error is thrown
- The code has to detect if the OpenGL mode requested can be found, this requires a temp window to be created/destroyed. If this fails for any reason then an std::runtime_error is thrown
FindCompatibleDisplayMode
Function Prototypes
- bool FindCompatibleDisplayMode(int width, int height, int bbp = 32, int refreshrate = 60)
Sets the window manager up with the requested format. - bool FindCompatibleDisplayMode(displaycaps &caps)
Sets the window manager up with the requested format. If a format is found the passed in caps structure is updated to reflect the new format.
Return Value
- True if a format was found and set as current
- False if the requested format cant be found
Possible Known Exceptions
- None
Other Details / Notes
- If GLee fails to initalise the extensions then std::runtime_error is thrown
- The code has to detect if the OpenGL mode requested can be found, this requires a temp window to be created/destroyed. If this fails for any reason then an std::runtime_error is thrown