29 #ifndef __GLES2RenderSystem_H__
30 #define __GLES2RenderSystem_H__
41 class GLES2RTTManager;
42 class GLES2GpuProgramManager;
43 class GLSLESProgramFactory;
44 #if !OGRE_NO_GLES2_CG_SUPPORT
45 class GLSLESCgProgramFactory;
47 class GLSLESGpuProgram;
48 class HardwareBufferManager;
85 GLfloat mAutoTextureMatrix[16];
99 #if !OGRE_NO_GLES2_CG_SUPPORT
133 GLint getCombinedMinMipFilter(
void)
const;
141 bool activateGLTextureUnit(
size_t unit);
148 friend class ShaderGeneratorTechniqueResolverListener;
156 const String& getName(
void)
const;
164 void setConfigOption(
const String &name,
const String &value);
168 String validateConfigOptions(
void);
172 RenderWindow* _initialise(
bool autoCreateWindow,
const String& windowTitle =
"OGRE Render NativeWindowType");
184 void reinitialise(
void);
203 RenderWindow* _createRenderWindow(
const String &name,
unsigned int width,
unsigned int height,
210 void _getDepthStencilFormatFor( GLenum internalColourFormat, GLenum *depthFormat,
211 GLenum *stencilFormat );
223 String getErrorDescription(
long errorNumber)
const;
247 void _setWorldMatrix(
const Matrix4 &m);
251 void _setViewMatrix(
const Matrix4 &m);
255 void _setProjectionMatrix(
const Matrix4 &m);
275 void _setTexture(
size_t unit,
bool enabled,
const TexturePtr &tex);
279 void _setTextureCoordSet(
size_t stage,
size_t index);
284 const Frustum* frustum = 0) { };
312 void _beginFrame(
void);
316 void _endFrame(
void);
328 void _setDepthBufferCheckEnabled(
bool enabled =
true);
332 void _setDepthBufferWriteEnabled(
bool enabled =
true);
340 void _setDepthBias(
float constantBias,
float slopeScaleBias);
344 void _setColourBufferWriteEnabled(
bool red,
bool green,
bool blue,
bool alpha);
352 void _convertProjectionMatrix(
const Matrix4& matrix,
353 Matrix4& dest,
bool forGpuProgram =
false);
357 void _makeProjectionMatrix(
const Radian& fovy,
Real aspect,
Real nearPlane,
Real farPlane,
358 Matrix4& dest,
bool forGpuProgram =
false);
363 Real nearPlane,
Real farPlane,
Matrix4& dest,
bool forGpuProgram =
false);
368 Matrix4& dest,
bool forGpuProgram =
false);
372 void _applyObliqueDepthProjection(
Matrix4& matrix,
const Plane& plane,
381 void enableClipPlane (
ushort index,
bool enable);
389 void setStencilCheckEnabled(
bool enabled);
398 bool twoSidedOperation =
false);
406 void _setTextureLayerAnisotropy(
size_t unit,
unsigned int maxAnisotropy);
422 void setScissorTest(
bool enabled,
size_t left = 0,
size_t top = 0,
size_t right = 800,
size_t bottom = 600);
427 void clearFrameBuffer(
unsigned int buffers,
429 Real depth = 1.0f,
unsigned short stencil = 0);
460 void _oneTimeContextInitialization();
474 void bindGpuProgramPassIterationParameters(
GpuProgramType gptype);
481 void _setAlphaRejectSettings(
CompareFunction func,
unsigned char value,
bool alphaToCoverage );
483 unsigned int getDisplayMonitorCount()
const;
486 GLfloat _getCurrentAnisotropy(
size_t unit);
493 void _bindGLBuffer(GLenum target, GLuint buffer);
494 void _deleteGLBuffer(GLenum target, GLuint buffer);
497 virtual void beginProfileEvent(
const String &eventName );
500 virtual void endProfileEvent(
void );
503 virtual void markProfileEvent(
const String &eventName );
Manages the target rendering window.
A 'canvas' which can receive the results of a rendering operation.
Class encapsulating a standard 4x4 homogeneous matrix.
GLenum mPolygonMode
OpenGL ES doesn't support setting the PolygonMode like desktop GL So we will cache the value and set ...
void _setTextureBorderColour(size_t stage, const ColourValue &colour)
See RenderSystem.
float Real
Software floating point type.
void setNormaliseNormals(bool normalise)
See RenderSystem.
Singleton wrapper for hardware buffer manager.
vector< GLuint >::type mRenderAttribsBound
GLES2GpuProgram * mCurrentFragmentProgram
Records the state of all the vertex buffer bindings required to provide a vertex declaration with the...
map< String, String >::type NameValuePairList
Name / value parameter pair (first = name, second = value)
Defines a plane in 3D space.
Generalised low-level GL program, can be applied to multiple types (eg ARB and NV) ...
Leave the stencil buffer unchanged.
void setVertexBufferBinding(VertexBufferBinding *binding)
See RenderSystem.
bool mUseAutoTextureMatrix
BindBufferMap mActiveBufferMap
Class representing colour.
GpuProgramType
Enumerates the types of programs which can run on the GPU.
GLSLESProgramFactory * mGLSLESProgramFactory
GLES2Support * mGLSupport
GL support class, used for creating windows etc.
A frustum represents a pyramid, capped at the near and far end which is used to represent either a vi...
unsigned short mFixedFunctionTextureUnits
Number of fixed-function texture units.
bool mDepthWrite
Store last depth write state.
Defines a program which runs on the GPU such as a vertex or fragment program.
TexCoordCalcMethod
Enum describing the ways to generate texture coordinates.
void _setTextureBlendMode(size_t stage, const LayerBlendModeEx &bm)
See RenderSystem.
void _setPointParameters(Real size, bool attenuationEnabled, Real constant, Real linear, Real quadratic, Real minSize, Real maxSize)
See RenderSystem.
SceneBlendFactor
Blending factors for manually blending objects with the scene.
CullingMode
Hardware culling modes based on vertex winding.
This class represents a render target that renders to multiple RenderTextures at once.
This is a abstract class that that provides the interface for the query class for hardware occlusion...
unsigned int getDiscardBuffers(void)
Class that encapsulates an GL context.
Implementation of GL ES 2.x as a rendering system.
GLES2Context * mCurrentContext
vector< Plane >::type PlaneList
HashMap< GLenum, GLuint > BindBufferMap
#define OGRE_MAX_TEXTURE_LAYERS
Define max number of texture layers allowed per pass on any card.
GLSLESCgProgramFactory * mGLSLESCgProgramFactory
An abstract class that contains a depth/stencil buffer.
GLES2RTTManager * mRTTManager
Manager object for creating render textures.
HardwareBufferManager * mHardwareBufferManager
Factory class for GLSL ES programs.
Real getMinimumDepthInputValue(void)
Gets the minimum (closest) depth value to be used when rendering using identity transforms.
bool areFixedFunctionLightsInViewSpace() const
See RenderSystem.
GLES2Support * getGLES2Support()
GLES2GpuProgramManager * mGpuProgramManager
ShadeOptions
Light shading modes.
GLenum mActiveTextureUnit
These variables are used for caching RenderSystem state.
Real getHorizontalTexelOffset(void)
Returns the horizontal texel offset value required for mapping texel origins to pixel origins in this...
GLES2Context * _getMainContext()
Returns the main context.
Texture addressing mode for each texture coordinate.
map< String, ConfigOption >::type ConfigOptionMap
TextureAddressingMode
Texture addressing modes - default is TAM_WRAP.
void postExtraThreadsStarted()
Real getVerticalTexelOffset(void)
Returns the vertical texel offset value required for mapping texel origins to pixel origins in this r...
uint32 mStencilMask
Store last stencil mask state.
GLES2Context * mMainContext
Specialisation of SharedPtr to allow SharedPtr to be assigned to TexturePtr.
GLES2GpuProgram * mCurrentVertexProgram
VertexElementType
Vertex element type, used to identify the base types of the vertex contents.
void _useLights(const LightList &lights, unsigned short limit)
See RenderSystem.
void registerThread()
Register the an additional thread which may make calls to rendersystem-related objects.
void _setPointSpritesEnabled(bool enabled)
See RenderSystem.
bool mGLInitialised
Check if the GL system has already been initialised.
void _setTextureMatrix(size_t stage, const Matrix4 &xform)
See RenderSystem.
GLenum _getPolygonMode(void)
void setLightingEnabled(bool enabled)
See RenderSystem.
Matrix4 mViewMatrix
View matrix to set world against.
An abstraction of a viewport, i.e.
'New' rendering operation using vertex buffers.
This class declares the format of a set of vertex inputs, which can be issued to the rendering API th...
void _setTextureMipmapBias(size_t unit, float bias)
See RenderSystem.
void preExtraThreadsStarted()
Tell the rendersystem to perform any prep tasks it needs to directly before other threads which might...
void _setTextureCoordCalculation(size_t stage, TexCoordCalcMethod m, const Frustum *frustum=0)
See RenderSystem.
Wrapper class which indicates a given angle value is in Radians.
void setVertexDeclaration(VertexDeclaration *decl)
See RenderSystem.
PolygonMode
The polygon mode to use when rasterising.
void setClipPlanesImpl(const Ogre::PlaneList &planeList)
Internal method used to set the underlying clip planes when needed.
static const ColourValue Black
SceneBlendOperation
Blending operations controls how objects are blended into the scene.
unsigned int mDiscardBuffers
Mask of buffers who contents can be discarded if GL_EXT_discard_framebuffer is supported.
singleton class for storing the capabilities of the graphics card.
void unregisterThread()
Unregister an additional thread which may make calls to rendersystem-related objects.
void _setSurfaceParams(const ColourValue &ambient, const ColourValue &diffuse, const ColourValue &specular, const ColourValue &emissive, Real shininess, TrackVertexColourType tracking)
See RenderSystem.
StencilOperation
Enum describing the various actions which can be taken onthe stencil buffer.
FilterOptions
Filtering options for textures / mipmaps.
void setShadingType(ShadeOptions so)
See RenderSystem.
FilterOptions mMinFilter
Last min & mip filtering options, so we can combine them.
Defines the functionality of a 3D API.
CompareFunction
Comparison functions used for the depth/stencil buffer operations and others.
Factory class for GLSL ES programs.
int TrackVertexColourType
An enumeration describing which material properties should track the vertex colours.
void _setDiscardBuffers(unsigned int flags)
Class which manages blending of both colour and alpha components.
Real getMaximumDepthInputValue(void)
Gets the maximum (farthest) depth value to be used when rendering using identity transforms.
void setAmbientLight(float r, float g, float b)
See RenderSystem.
Manager/factory for RenderTextures.