29 #ifndef __GLES2RenderSystem_H__
30 #define __GLES2RenderSystem_H__
41 class GLES2RTTManager;
42 class GLES2GpuProgramManager;
43 class GLSLESProgramFactory;
44 class GLES2StateCacheManager;
45 #if !OGRE_NO_GLES2_CG_SUPPORT
46 class GLSLESCgProgramFactory;
48 class GLSLESGpuProgram;
49 class HardwareBufferManager;
50 #if OGRE_PLATFORM == OGRE_PLATFORM_ANDROID
51 class AndroidResourceManager;
78 GLfloat mAutoTextureMatrix[16];
100 #if !OGRE_NO_GLES2_CG_SUPPORT
120 GLint getCombinedMinMipFilter(
void)
const;
128 const size_t vertexStart,
143 friend class ShaderGeneratorTechniqueResolverListener;
151 const String& getName(
void)
const;
159 void setConfigOption(
const String &name,
const String &value);
163 String validateConfigOptions(
void);
167 RenderWindow* _initialise(
bool autoCreateWindow,
const String& windowTitle =
"OGRE Render NativeWindowType");
179 void reinitialise(
void);
198 RenderWindow* _createRenderWindow(
const String &name,
unsigned int width,
unsigned int height,
205 void _getDepthStencilFormatFor( GLenum internalColourFormat, GLenum *depthFormat,
206 GLenum *stencilFormat );
218 String getErrorDescription(
long errorNumber)
const;
242 void _setWorldMatrix(
const Matrix4 &m);
246 void _setViewMatrix(
const Matrix4 &m);
250 void _setProjectionMatrix(
const Matrix4 &m);
270 void _setTexture(
size_t unit,
bool enabled,
const TexturePtr &tex);
274 void _setTextureCoordSet(
size_t stage,
size_t index);
279 const Frustum* frustum = 0) { };
307 void _beginFrame(
void);
311 void _endFrame(
void);
323 void _setDepthBufferCheckEnabled(
bool enabled =
true);
327 void _setDepthBufferWriteEnabled(
bool enabled =
true);
335 void _setDepthBias(
float constantBias,
float slopeScaleBias);
339 void _setColourBufferWriteEnabled(
bool red,
bool green,
bool blue,
bool alpha);
347 void _convertProjectionMatrix(
const Matrix4& matrix,
348 Matrix4& dest,
bool forGpuProgram =
false);
352 void _makeProjectionMatrix(
const Radian& fovy,
Real aspect,
Real nearPlane,
Real farPlane,
353 Matrix4& dest,
bool forGpuProgram =
false);
358 Real nearPlane,
Real farPlane,
Matrix4& dest,
bool forGpuProgram =
false);
363 Matrix4& dest,
bool forGpuProgram =
false);
367 void _applyObliqueDepthProjection(
Matrix4& matrix,
const Plane& plane,
376 void enableClipPlane (
ushort index,
bool enable);
384 void setStencilCheckEnabled(
bool enabled);
393 bool twoSidedOperation =
false);
397 void _setTextureUnitCompareFunction(
size_t unit,
CompareFunction function);
401 void _setTextureUnitCompareEnabled(
size_t unit,
bool compare);
405 virtual void _setTextureUnitFiltering(
size_t unit,
FilterOptions minFilter,
414 void _setTextureLayerAnisotropy(
size_t unit,
unsigned int maxAnisotropy);
438 void setScissorTest(
bool enabled,
size_t left = 0,
size_t top = 0,
size_t right = 800,
size_t bottom = 600);
440 void clearFrameBuffer(
unsigned int buffers,
442 Real depth = 1.0f,
unsigned short stencil = 0);
449 void registerThread();
450 void unregisterThread();
451 void preExtraThreadsStarted();
452 void postExtraThreadsStarted();
475 void _oneTimeContextInitialization();
489 void bindGpuProgramPassIterationParameters(
GpuProgramType gptype);
496 void _setAlphaRejectSettings(
CompareFunction func,
unsigned char value,
bool alphaToCoverage );
498 unsigned int getDisplayMonitorCount()
const;
501 GLfloat _getCurrentAnisotropy(
size_t unit);
506 unsigned int getDiscardBuffers(
void);
511 virtual void beginProfileEvent(
const String &eventName );
514 virtual void endProfileEvent(
void );
517 virtual void markProfileEvent(
const String &eventName );
519 #if OGRE_PLATFORM == OGRE_PLATFORM_ANDROID
Manages the target rendering window.
A 'canvas' which can receive the results of a rendering operation.
Class encapsulating a standard 4x4 homogeneous matrix.
void _setTextureBorderColour(size_t stage, const ColourValue &colour)
See RenderSystem.
float Real
Software floating point type.
void setNormaliseNormals(bool normalise)
See RenderSystem.
vector< GLuint >::type mRenderInstanceAttribsBound
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
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.
Defines a program which runs on the GPU such as a vertex or fragment program.
TexCoordCalcMethod
Enum describing the ways to generate texture coordinates.
Shared pointer implementation used to share vertex buffers.
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.
GLES2Support * getGLSupportRef()
An in memory cache of the OpenGL ES state.
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...
This class declares the usage of a single vertex buffer as a component of a complete VertexDeclaratio...
Class that encapsulates an GL context.
Implementation of GL ES 2.x as a rendering system.
GLES2Context * mCurrentContext
vector< Plane >::type PlaneList
#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.
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.
Real getVerticalTexelOffset(void)
Returns the vertical texel offset value required for mapping texel origins to pixel origins in this r...
GLES2Context * mMainContext
GLES2GpuProgram * mCurrentVertexProgram
list< GLES2Context * >::type GLES2ContextList
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 _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.
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.
GLES2ContextList mBackgroundContextList
List of background thread contexts.
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.
virtual bool hasAnisotropicMipMapFilter() const
See RenderSystem.
GLES2StateCacheManager * mStateCacheManager
State cache manager which responsible to reduce redundant state changes.
void _setTextureCoordCalculation(size_t stage, TexCoordCalcMethod m, const Frustum *frustum=0)
See RenderSystem.
Wrapper class which indicates a given angle value is in Radians.
static AndroidResourceManager * mResourceManager
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.
singleton class for storing the capabilities of the graphics card.
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 on the 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.
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.