OpenGL render context. It's using WGL or GLX to create a context for Windows or Linux. More...
#include <spOpenGLRenderContext.hpp>
Public Member Functions | |
OpenGLRenderContext () | |
~OpenGLRenderContext () | |
bool | openGraphicsScreen (void *ParentWindow, const dim::size2di &Resolution, const io::stringc &Title, s32 ColorDepth, bool isFullscreen, const SDeviceFlags &Flags) |
void | closeGraphicsScreen () |
Closes the graphics screen and releases all hardware specific resources. | |
void | flipBuffers () |
bool | activate () |
Activates the render context by making it to the current. | |
bool | deactivate () |
Deactivates the render context. | |
SharedRenderContext * | createSharedContext () |
void | setFullscreen (bool Enable) |
Enables or disables fullscreen mode. | |
void | setResolution (const dim::size2di &Resolution) |
void | setVsync (bool Enable) |
Enables or disabels vertical synchronisation. | |
Friends | |
class | OpenGLSharedRenderContext |
OpenGL render context. It's using WGL or GLX to create a context for Windows or Linux.
sp::video::OpenGLRenderContext::OpenGLRenderContext | ( | ) |
sp::video::OpenGLRenderContext::~OpenGLRenderContext | ( | ) |
bool sp::video::OpenGLRenderContext::activate | ( | ) | [virtual] |
Activates the render context by making it to the current.
Reimplemented from sp::video::DesktopRenderContext.
void sp::video::OpenGLRenderContext::closeGraphicsScreen | ( | ) | [virtual] |
Closes the graphics screen and releases all hardware specific resources.
Reimplemented from sp::video::DesktopRenderContext.
SharedRenderContext* sp::video::OpenGLRenderContext::createSharedContext | ( | ) | [virtual] |
Creates a shared render context. Use shared render contexts when creating renderer resources in multi-threading. e.g. when you want to load textures on the fly in another thread.
Window,: | Specifies a pointer to the window (e.g. HWND for Windows) from which the device-context is to be used. By default 0 which means that no separate window is used. |
Reimplemented from sp::video::RenderContext.
bool sp::video::OpenGLRenderContext::deactivate | ( | ) | [virtual] |
Deactivates the render context.
Reimplemented from sp::video::DesktopRenderContext.
void sp::video::OpenGLRenderContext::flipBuffers | ( | ) | [virtual] |
Flips the buffers to see the final image onto the monitor. If vsync (vertical synchronisation) is enabled the program waits at this point until the graphics card releases the synchronisation.
Reimplemented from sp::video::DesktopRenderContext.
bool sp::video::OpenGLRenderContext::openGraphicsScreen | ( | void * | ParentWindow, | |
const dim::size2di & | Resolution, | |||
const io::stringc & | Title, | |||
s32 | ColorDepth, | |||
bool | isFullscreen, | |||
const SDeviceFlags & | Flags | |||
) | [virtual] |
Opens the graphics screen. This function will be called automatically once when the graphics device will be created.
[in] | ParentWindow | Pointer to the window object. For MS/Windows this must be a pointer to a HWND instance or null if no parent window is to be used. |
[in] | Resolution | Specifies the screen resolution for this context. |
[in] | Title | Specifies the window title. |
[in] | ColorDepth | Specifies the color bit depth. Valid values are 16, 24 and 32. |
[in] | isFullscreen | Specifies whether fullscreen is to be enabled or disabled. |
[in] | Flags | Specifies the device flags. This contains information about anti-aliasing and some other options. |
Reimplemented from sp::video::DesktopRenderContext.
void sp::video::OpenGLRenderContext::setFullscreen | ( | bool | Enable | ) | [virtual] |
Enables or disables fullscreen mode.
Reimplemented from sp::video::RenderContext.
void sp::video::OpenGLRenderContext::setResolution | ( | const dim::size2di & | Resolution | ) | [virtual] |
Changes the screen resolution. This requires for some render sytems to re-create all graphics resources such as textures, mesh buffers, shaders etc.
Reimplemented from sp::video::RenderContext.
void sp::video::OpenGLRenderContext::setVsync | ( | bool | isVsync | ) | [virtual] |
Enables or disabels vertical synchronisation.
Reimplemented from sp::video::RenderContext.
friend class OpenGLSharedRenderContext [friend] |
Reimplemented from sp::video::DesktopRenderContext.