OpenGLESContext
Description
- Derived from
-
GLContext abstract
Full source code is included in the Tinman 3D SDK download. |
An implementation of the IGraphicsContext interface that uses an OpenGLES 3.0 context (or newer).
You can use the OpenGLESContextFactory object to configure and create an instance of this class. Also you can use the constructor to wrap an existing GLES object.
By default, OpenGLES interprets sequences of pixel/texel rows as bottom-to-top, while ITexture2D (and thus IGraphicsContext) specifies top-to-bottom. Textures and 3D models are authored against the latter. To avoid the necessity to modify texture data and/or 3D model data (texture coordinates), the following GLSL statement must be added after outputting gl_Position
:
gl_Position.y *= 1.0;
Alternatively, call GLES.ClipControlEXT with GLES.UPPER_LEFT_EXT in GLEffect.RenderStateSet.
The returned INativeHandles can be interpreted as follows:
-
OpenGLESContext:
Same as returned by RenderContext object given at construction. -
IIndexBuffer (created by IGraphicsContext.BufferFactory):
The OpenGL name of the index buffer object. -
IVertexBuffer (created by IGraphicsContext.BufferFactory):
The OpenGL name of the vertex buffer object. -
ITexture2D (created by IGraphicsContext.TextureFactory:
The OpenGL name of the texture object. -
ITextureCube (created by IGraphicsContext.CreateTextureCube):
The OpenGL name of the texture object. -
IRenderTarget (created by IGraphicsContext.CreateRenderTarget or IGraphicsContext.CreateSwapChain):
The OpenGL name of the framebuffer object.
The IGraphicsContext.ClearRenderTarget method modifies the following state:
The IGraphicsContext.ReadPixels method modifies the following state:
-
GLES.PixelStorei :
GL_PACK_*
The IGraphicsContext.SetClip method modifies the following state:
The IGraphicsContext.SetGeometryBuffer method modifies the following state:
The IGraphicsContext.SetRenderTarget method modifies the following state:
The IGraphicsContext.SetViewport method modifies the following state:
The following binding targets are modified by the classes of this graphics context implementation and will be cleared to zero after use:
Public / Constructors
OpenGLESContext
Creates a new instance of OpenGLESContext.
- RenderException
-
If a graphics subsystem error has occurred.