EGL context base for the OpenGL|ES renderers. More...
#include <spOpenGLESRenderContext.hpp>
Public Member Functions | |
OpenGLESRenderContext (bool isGLES2) | |
~OpenGLESRenderContext () | |
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. | |
void | setWindowTitle (const io::stringc &Title) |
Sets the window title. | |
io::stringc | getWindowTitle () const |
Returns the window title. | |
void | setWindowPosition (const dim::point2di &Position) |
Sets the window position. By default the window is screen centered. | |
dim::point2di | getWindowPosition () const |
Returns the window position. | |
dim::size2di | getWindowSize () const |
Returns the window size. | |
dim::size2di | getWindowBorder () const |
Returns the window border size. | |
bool | isWindowActive () const |
Returns true if the window is the active one. | |
void * | getWindowObject () |
EGL context base for the OpenGL|ES renderers.
sp::video::OpenGLESRenderContext::OpenGLESRenderContext | ( | bool | isGLES2 | ) |
sp::video::OpenGLESRenderContext::~OpenGLESRenderContext | ( | ) |
bool sp::video::OpenGLESRenderContext::activate | ( | ) | [virtual] |
Activates the render context by making it to the current.
Implements sp::video::RenderContext.
void sp::video::OpenGLESRenderContext::closeGraphicsScreen | ( | ) | [virtual] |
Closes the graphics screen and releases all hardware specific resources.
Implements sp::video::RenderContext.
bool sp::video::OpenGLESRenderContext::deactivate | ( | ) | [virtual] |
Deactivates the render context.
Implements sp::video::RenderContext.
void sp::video::OpenGLESRenderContext::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.
Implements sp::video::RenderContext.
dim::size2di sp::video::OpenGLESRenderContext::getWindowBorder | ( | ) | const [virtual] |
Returns the window border size.
Reimplemented from sp::video::RenderContext.
void* sp::video::OpenGLESRenderContext::getWindowObject | ( | ) | [virtual] |
Returns the window object. For MS/Windows it's a HWND* and on GNU/Linux it's a Window*.
#if defined(SP_PLATFORM_WINDOWS) HWND hWnd = *((HWND*)Context->getWindowObject()); #elif defined(SP_PLATFORM_LINUX) Window XWin = *((Window*)Context->getWindowObject()); #endif
Implements sp::video::RenderContext.
dim::point2di sp::video::OpenGLESRenderContext::getWindowPosition | ( | ) | const [virtual] |
Returns the window position.
Reimplemented from sp::video::RenderContext.
dim::size2di sp::video::OpenGLESRenderContext::getWindowSize | ( | ) | const [virtual] |
Returns the window size.
Reimplemented from sp::video::RenderContext.
io::stringc sp::video::OpenGLESRenderContext::getWindowTitle | ( | ) | const [virtual] |
Returns the window title.
Reimplemented from sp::video::RenderContext.
bool sp::video::OpenGLESRenderContext::isWindowActive | ( | ) | const [virtual] |
Returns true if the window is the active one.
Reimplemented from sp::video::RenderContext.
bool sp::video::OpenGLESRenderContext::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. |
Implements sp::video::RenderContext.
void sp::video::OpenGLESRenderContext::setWindowPosition | ( | const dim::point2di & | Position | ) | [virtual] |
Sets the window position. By default the window is screen centered.
Reimplemented from sp::video::RenderContext.
void sp::video::OpenGLESRenderContext::setWindowTitle | ( | const io::stringc & | Title | ) | [virtual] |
Sets the window title.
Reimplemented from sp::video::RenderContext.