OGRE: GLES2

| OGRE 14.5 Object-Oriented Graphics Rendering Engine

Loading...
Searching...
No Matches
GLES2
RenderSystems

Implementation of GL ES 2.x as a rendering system. More...

## Classes
class | Ogre::GLES2RenderSystem
| Implementation of GL ES 2.x as a rendering system. More...

## Functions
| Ogre::GLES2RenderSystem::GLES2RenderSystem ()
virtual | Ogre::GLES2RenderSystem::~GLES2RenderSystem ()
void | Ogre::GLES2RenderSystem::_bindVao (GLContext *context, uint32 vao) override
| Bind VAO, context should be equal to current context, as VAOs are not shared.
void | Ogre::GLES2RenderSystem::_copyContentsToMemory (Viewport *vp, const Box &src, const PixelBox &dst, RenderWindow::FrameBuffer buffer) override
DepthBuffer * | Ogre::GLES2RenderSystem::_createDepthBufferFor (RenderTarget *renderTarget) override
| Creates a DepthBuffer that can be attached to the specified RenderTarget.
RenderWindow * | Ogre::GLES2RenderSystem::_createRenderWindow (const String &name, unsigned int width, unsigned int height, bool fullScreen, const NameValuePairList *miscParams=0) override
| Creates a new rendering window.
uint32 | Ogre::GLES2RenderSystem::_createVao () override
| Create VAO on current context.
void | Ogre::GLES2RenderSystem::_destroyFbo (GLContext *context, uint32 fbo) override
| Destroy FBO immediately or defer if it was created on other context.
void | Ogre::GLES2RenderSystem::_destroyVao (GLContext *context, uint32 vao) override
| Destroy VAO immediately or defer if it was created on other context.
void | Ogre::GLES2RenderSystem::_endFrame (void) override
GLES2StateCacheManager * | Ogre::GLES2RenderSystem::_getStateCacheManager ()
void | Ogre::GLES2RenderSystem::_initialise () override
void | Ogre::GLES2RenderSystem::_oneTimeContextInitialization () override
void | Ogre::GLES2RenderSystem::_render (const RenderOperation &op) override
void | Ogre::GLES2RenderSystem::_setAlphaRejectSettings (CompareFunction func, unsigned char value, bool alphaToCoverage) override
| Sets the global alpha rejection approach for future renders.
void | Ogre::GLES2RenderSystem::_setCullingMode (CullingMode mode) override
void | Ogre::GLES2RenderSystem::_setDepthBias (float constantBias, float slopeScaleBias) override
void | Ogre::GLES2RenderSystem::_setDepthBufferParams (bool depthTest=true, bool depthWrite=true, CompareFunction depthFunction=CMPF_LESS_EQUAL) override
void | Ogre::GLES2RenderSystem::_setLineWidth (float width) override
void | Ogre::GLES2RenderSystem::_setPolygonMode (PolygonMode level) override
void | Ogre::GLES2RenderSystem::_setRenderTarget (RenderTarget *target) override
| Set current render target to target, enabling its GL context if needed.
void | Ogre::GLES2RenderSystem::_setSampler (size_t unit, Sampler &sampler) override
void | Ogre::GLES2RenderSystem::_setTexture (size_t unit, bool enabled, const TexturePtr &tex) override
void | Ogre::GLES2RenderSystem::_setViewport (Viewport *vp) override
void | Ogre::GLES2RenderSystem::_switchContext (GLContext *context)
| Switch GL context, dealing with involved internal cached states too.
void | Ogre::GLES2RenderSystem::_unregisterContext (GLContext *context) override
| Unregister a render target->context mapping.
void | Ogre::GLES2RenderSystem::beginProfileEvent (const String &eventName) override
| This marks the beginning of an event for GPU profiling.
void | Ogre::GLES2RenderSystem::bindGpuProgram (GpuProgram *prg) override
void | Ogre::GLES2RenderSystem::bindGpuProgramParameters (GpuProgramType gptype, const GpuProgramParametersPtr &params, uint16 mask) override
void | Ogre::GLES2RenderSystem::bindRenderTarget (RenderTarget *target) override
void | Ogre::GLES2RenderSystem::clearFrameBuffer (unsigned int buffers, const ColourValue &colour=ColourValue::Black, float depth=1.0f, unsigned short stencil=0) override
GLint | Ogre::GLES2RenderSystem::convertCompareFunction (CompareFunction func) const
GLint | Ogre::GLES2RenderSystem::convertStencilOp (StencilOperation op, bool invert=false) const
HardwareOcclusionQuery * | Ogre::GLES2RenderSystem::createHardwareOcclusionQuery (void) override
MultiRenderTarget * | Ogre::GLES2RenderSystem::createMultiRenderTarget (const String &name) override
| Create a MultiRenderTarget, which is a render target that renders to multiple RenderTextures at once.
RenderSystemCapabilities * | Ogre::GLES2RenderSystem::createRenderSystemCapabilities () const override
void | Ogre::GLES2RenderSystem::endProfileEvent (void) override
| Ends the currently active GPU profiling event.
const String & | Ogre::GLES2RenderSystem::getName (void) const override
void | Ogre::GLES2RenderSystem::initialiseContext (RenderWindow *primary)
void | Ogre::GLES2RenderSystem::initialiseFromRenderSystemCapabilities (RenderSystemCapabilities *caps, RenderTarget *=NULL) override
void | Ogre::GLES2RenderSystem::markProfileEvent (const String &eventName) override
| Marks an instantaneous event for graphics profilers.
void | Ogre::GLES2RenderSystem::setColourBlendState (const ColourBlendState &state) override
void | Ogre::GLES2RenderSystem::setScissorTest (bool enabled, const Rect &rect=Rect()) override
void | Ogre::GLES2RenderSystem::setStencilState (const StencilState &state) override
void | Ogre::GLES2RenderSystem::shutdown (void) override
void | Ogre::GLES2RenderSystem::unbindGpuProgram (GpuProgramType gptype) override

## Detailed Description

Implementation of GL ES 2.x as a rendering system.

## Function Documentation

## ◆ GLES2RenderSystem()

Ogre::GLES2RenderSystem::GLES2RenderSystem | ( |  | ) |

## ◆ ~GLES2RenderSystem()

virtual Ogre::GLES2RenderSystem::~GLES2RenderSystem | ( |  | ) |
| virtual

## ◆ getName()

const String & Ogre::GLES2RenderSystem::getName | ( | void |  | ) | const
| override

## ◆ _initialise()

void Ogre::GLES2RenderSystem::_initialise | ( |  | ) |
| override

## ◆ createRenderSystemCapabilities()

RenderSystemCapabilities * Ogre::GLES2RenderSystem::createRenderSystemCapabilities | ( |  | ) | const
| override

## ◆ initialiseFromRenderSystemCapabilities()

void Ogre::GLES2RenderSystem::initialiseFromRenderSystemCapabilities | ( | RenderSystemCapabilities * | caps,
|  | RenderTarget * | = NULL )
| override

## ◆ shutdown()

void Ogre::GLES2RenderSystem::shutdown | ( | void |  | ) |
| override

## ◆ _createRenderWindow()

RenderWindow * Ogre::GLES2RenderSystem::_createRenderWindow | ( | const String & | name,
|  | unsigned int | width,
|  | unsigned int | height,
|  | bool | fullScreen,
|  | const NameValuePairList * | miscParams = 0 )
| override

Creates a new rendering window.

This method creates a new rendering window as specified by the paramteters. The rendering system could be responible for only a single window (e.g. in the case of a game), or could be in charge of multiple ones (in the case of a level editor). The option to create the window as a child of another is therefore given. This method will create an appropriate subclass of RenderWindow depending on the API and platform implementation.

  After creation, this window can be retrieved using getRenderTarget().

Parameters

  name | The name of the window. Used in other methods later like setRenderTarget and getRenderTarget.
  width | The width of the new window.
  height | The height of the new window.
  fullScreen | Specify true to make the window full screen without borders, title bar or menu bar.
  miscParams | A NameValuePairList describing the other parameters for the new rendering window. Options are case sensitive. Unrecognised parameters will be ignored silently. These values might be platform dependent, but these are present for all platforms unless indicated otherwise:

Key | Type / Values | Default | Description | Platform
--- | --- | --- | --- | ---
title | String | RenderTarget name | The title of the window that will appear in the title bar |
left | Positive integers | Centred | Screen x coordinate from left |
top | Positive integers | Centred | Screen y coordinate from left |
hidden | true, false | false | hide the created window |
FSAA | Positive integer (usually 0, 2, 4, 8, 16) | 0 | Full screen antialiasing factor |
gamma | true, false | false | Enable hardware conversion from linear colour space to gamma colour space on rendering to the window. |
vsync | true, false | false | Synchronize buffer swaps to monitor vsync, eliminating tearing at the expense of a fixed frame rate |
vsyncInterval | 1, 2, 3, 4 | 1 | If vsync is enabled, the minimum number of vertical blanks that should occur between renders. For example if vsync is enabled, the refresh rate is 60 and this is set to 2, then the frame rate will be locked at 30. |
Full Screen | true, false | false | Specify whether to create the window in full screen mode |
border | none, fixed, resize | resize | The type of window border (in windowed mode) | Windows, OSX
displayFrequency | Refresh rate in Hertz (e.g. 60, 75, 100) | Desktop vsync rate | Display frequency rate, for fullscreen mode |
externalWindowHandle | Win32: HWND as int Linux: X11 Window as ulong OSX: OgreGLView address as an integer. You can pass NSView or NSWindow too, but should perform OgreGLView callbacks into the Ogre manually iOS: UIWindow address as an integer Emscripten: canvas selector String ("#canvas") | 0 (none) | External window handle, for embedding the OGRE render in an existing window |
externalGLControl | true, false | false | Let the external window control OpenGL i.e. don't select a pixel format for the window, do not change v-sync and do not swap buffer. When set to true, the calling application is responsible of OpenGL initialization and buffer swapping. It should also create an OpenGL context for its own rendering, Ogre will create one for its use. Then the calling application must also enable Ogre OpenGL context before calling any Ogre function and restore its OpenGL context after these calls. | OpenGL
externalWlDisplay | wl_display address as an integer | 0 (none) | Wayland display connection | Linux
externalWlSurface | wl_surface address as an integer | 0 (none) | Wayland onscreen surface | Linux
currentGLContext | true, false | false | Use an externally created GL context. (Must be current) | OpenGL
currentEGLSurface | true, false | false | Use an externally created EGL surface. | Android
minColourBufferSize | Positive integer (usually 16, 32) | 16 | Min total colour buffer size. See EGL_BUFFER_SIZE | OpenGL
windowProc | WNDPROC | DefWindowProc | function that processes window messages | Win 32
colourDepth | 16, 32 | Desktop depth | Colour depth of the resulting rendering window; only applies if fullScreen | Win32
FSAAHint | RenderSystem specific. Currently enables EQAA/ CSAA mode on D3D: if you want 4f8x (8x CSAA), set FSAA=4 and this to "f8" | Blank | FSAA mode hint | D3D
outerDimensions | true, false | false | Whether the width/height is expressed as the size of the outer window, rather than the content area | Win32
monitorIndex |  | -1 |  | Win 32
monitorHandle |  | 0 (none) |  | Win 32 (OpenGL)
enableDoubleClick | true, false | false | Enable the window to keep track and transmit double click messages. | Win32
useNVPerfHUD | true, false | false | Enable the use of nVidia NVPerfHUD | D3D
depthBuffer | true, false | true | Use depth buffer | D3D
NSOpenGLCPSurfaceOrder | -1 or 1 | 1 | NSOpenGLCPSurfaceOrder | OSX
contentScalingFactor | Positive Float | The default content scaling factor of the screen | On IOS specifies the CAEAGLLayer content scaling factor. This can be useful to limit the resolution of the OpenGL ES backing store. For example, the iPhone 4's native resolution is 960 x 640. Windows are always 320 x 480, if you would like to limit the display to 720 x 480, specify 1.5 as the scaling factor. | OSX, iOS, Android
externalViewHandle | UIView pointer as an integer | 0 | External view handle, for rendering OGRE render in an existing view | iOS
externalViewControllerHandle | UIViewController pointer as an integer | 0 | External view controller handle, for embedding OGRE in an existing view controller | iOS
externalSharegroup | EAGLSharegroup pointer as an integer | 0 | External sharegroup, used to shared GL resources between contexts | iOS
CSAA | Positive integer (usually 0, 2, 4, 8, 16) | 0 | Coverage sampling factor | Android
maxColourBufferSize | Positive integer (usually 16, 32) | 32 | Max EGL_BUFFER_SIZE | Android
maxStencilBufferSize | Positive integer (usually 0, 8) | 0 | EGL_STENCIL_SIZE | Android
maxDepthBufferSize | Positive integer (usually 0, 16, 24) | 16 | EGL_DEPTH_SIZE | Android

## ◆ _createDepthBufferFor()

DepthBuffer * Ogre::GLES2RenderSystem::_createDepthBufferFor | ( | RenderTarget * | renderTarget | ) |
| override

Creates a DepthBuffer that can be attached to the specified RenderTarget.

It doesn't attach anything, it just returns a pointer to a new DepthBuffer Caller is responsible for putting this buffer into the right pool, for attaching, and deleting it. Here's where API-specific magic happens. Don't call this directly unless you know what you're doing.

## ◆ createMultiRenderTarget()

MultiRenderTarget * Ogre::GLES2RenderSystem::createMultiRenderTarget | ( | const String & | name | ) |
| override

Create a MultiRenderTarget, which is a render target that renders to multiple RenderTextures at once.

Surfaces can be bound and unbound at will. This fails if mCapabilities->getNumMultiRenderTargets() is smaller than 2.

## ◆ _setTexture()

void Ogre::GLES2RenderSystem::_setTexture | ( | size_t | unit,
|  | bool | enabled,
|  | const TexturePtr & | tex )
| override

## ◆ _setSampler()

void Ogre::GLES2RenderSystem::_setSampler | ( | size_t | unit,
|  | Sampler & | sampler )
| override

## ◆ _setLineWidth()

void Ogre::GLES2RenderSystem::_setLineWidth | ( | float | width | ) |
| override

## ◆ _setViewport()

void Ogre::GLES2RenderSystem::_setViewport | ( | Viewport * | vp | ) |
| override

## ◆ _endFrame()

void Ogre::GLES2RenderSystem::_endFrame | ( | void |  | ) |
| override

## ◆ _setCullingMode()

void Ogre::GLES2RenderSystem::_setCullingMode | ( | CullingMode | mode | ) |
| override

## ◆ _setDepthBufferParams()

void Ogre::GLES2RenderSystem::_setDepthBufferParams | ( | bool | depthTest = true,
|  | bool | depthWrite = true,
|  | CompareFunction | depthFunction = CMPF_LESS_EQUAL )
| override

References Ogre::CMPF_LESS_EQUAL.

## ◆ _setDepthBias()

void Ogre::GLES2RenderSystem::_setDepthBias | ( | float | constantBias,
|  | float | slopeScaleBias )
| override

## ◆ setColourBlendState()

void Ogre::GLES2RenderSystem::setColourBlendState | ( | const ColourBlendState & | state | ) |
| override

## ◆ _setPolygonMode()

void Ogre::GLES2RenderSystem::_setPolygonMode | ( | PolygonMode | level | ) |
| override

## ◆ setStencilState()

void Ogre::GLES2RenderSystem::setStencilState | ( | const StencilState & | state | ) |
| override

## ◆ _render()

void Ogre::GLES2RenderSystem::_render | ( | const RenderOperation & | op | ) |
| override

## ◆ setScissorTest()

void Ogre::GLES2RenderSystem::setScissorTest | ( | bool | enabled,
|  | const Rect & | rect = Rect() )
| override

## ◆ clearFrameBuffer()

void Ogre::GLES2RenderSystem::clearFrameBuffer | ( | unsigned int | buffers,
|  | const ColourValue & | colour = ColourValue::Black,
|  | float | depth = 1.0f,
|  | unsigned short | stencil = 0 )
| override

References Ogre::ColourValue::Black.

## ◆ createHardwareOcclusionQuery()

HardwareOcclusionQuery * Ogre::GLES2RenderSystem::createHardwareOcclusionQuery | ( | void |  | ) |
| override

## ◆ _getStateCacheManager()

GLES2StateCacheManager * Ogre::GLES2RenderSystem::_getStateCacheManager | ( |  | ) |
| inline

## ◆ _createVao()

uint32 Ogre::GLES2RenderSystem::_createVao | ( |  | ) |
| override

Create VAO on current context.

## ◆ _bindVao()

void Ogre::GLES2RenderSystem::_bindVao | ( | GLContext * | context,
|  | uint32 | vao )
| override

Bind VAO, context should be equal to current context, as VAOs are not shared.

## ◆ _destroyVao()

void Ogre::GLES2RenderSystem::_destroyVao | ( | GLContext * | context,
|  | uint32 | vao )
| override

Destroy VAO immediately or defer if it was created on other context.

## ◆ _destroyFbo()

void Ogre::GLES2RenderSystem::_destroyFbo | ( | GLContext * | context,
|  | uint32 | fbo )
| override

Destroy FBO immediately or defer if it was created on other context.

## ◆ _unregisterContext()

void Ogre::GLES2RenderSystem::_unregisterContext | ( | GLContext * | context | ) |
| override

Unregister a render target->context mapping.

If the context of target is the current context, change the context to the main context so it can be destroyed safely.

Note
  This is automatically called by the destructor of GLContext.

## ◆ _switchContext()

void Ogre::GLES2RenderSystem::_switchContext | ( | GLContext * | context | ) |

Switch GL context, dealing with involved internal cached states too.

## ◆ _oneTimeContextInitialization()

void Ogre::GLES2RenderSystem::_oneTimeContextInitialization | ( |  | ) |
| override

## ◆ initialiseContext()

void Ogre::GLES2RenderSystem::initialiseContext | ( | RenderWindow * | primary | ) |

## ◆ _setRenderTarget()

void Ogre::GLES2RenderSystem::_setRenderTarget | ( | RenderTarget * | target | ) |
| override

Set current render target to target, enabling its GL context if needed.

## ◆ bindRenderTarget()

void Ogre::GLES2RenderSystem::bindRenderTarget | ( | RenderTarget * | target | ) |
| override

## ◆ convertCompareFunction()

GLint Ogre::GLES2RenderSystem::convertCompareFunction | ( | CompareFunction | func | ) | const

## ◆ convertStencilOp()

GLint Ogre::GLES2RenderSystem::convertStencilOp | ( | StencilOperation | op,
|  | bool | invert = false ) const

## ◆ bindGpuProgram()

void Ogre::GLES2RenderSystem::bindGpuProgram | ( | GpuProgram * | prg | ) |
| override

## ◆ unbindGpuProgram()

void Ogre::GLES2RenderSystem::unbindGpuProgram | ( | GpuProgramType | gptype | ) |
| override

## ◆ bindGpuProgramParameters()

void Ogre::GLES2RenderSystem::bindGpuProgramParameters | ( | GpuProgramType | gptype,
|  | const GpuProgramParametersPtr & | params,
|  | uint16 | mask )
| override

## ◆ _setAlphaRejectSettings()

void Ogre::GLES2RenderSystem::_setAlphaRejectSettings | ( | CompareFunction | func,
|  | unsigned char | value,
|  | bool | alphaToCoverage )
| override

Sets the global alpha rejection approach for future renders.

By default images are rendered regardless of texture alpha. This method lets you change that.

Parameters

  func | The comparison function which must pass for a pixel to be written.
  value | The value to compare each pixels alpha value to (0-255)
  alphaToCoverage | Whether to enable alpha to coverage, if supported

## ◆ beginProfileEvent()

void Ogre::GLES2RenderSystem::beginProfileEvent | ( | const String & | eventName | ) |
| override

This marks the beginning of an event for GPU profiling.

## ◆ endProfileEvent()

void Ogre::GLES2RenderSystem::endProfileEvent | ( | void |  | ) |
| override

Ends the currently active GPU profiling event.

## ◆ markProfileEvent()

void Ogre::GLES2RenderSystem::markProfileEvent | ( | const String & | eventName | ) |
| override

Marks an instantaneous event for graphics profilers.

This is equivalent to calling

See also
  beginProfileEvent and
  endProfileEvent back to back.

## ◆ _copyContentsToMemory()

void Ogre::GLES2RenderSystem::_copyContentsToMemory | ( | Viewport * | vp,
|  | const Box & | src,
|  | const PixelBox & | dst,
|  | RenderWindow::FrameBuffer | buffer )
| override