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
vector< Plane >::type PlaneList
A 'canvas' which can receive the results of a rendering operation.
FilterOptions mMinFilter
Last min & mip filtering options, so we can combine them.
GLES2GpuProgram * mCurrentVertexProgram
virtual bool hasAnisotropicMipMapFilter() const
See RenderSystem.
Real getVerticalTexelOffset(void)
Returns the vertical texel offset value required for mapping texel origins to pixel origins in this r...
bool mGLInitialised
Check if the GL system has already been initialised.
Class that encapsulates an GL context.
void _setTextureBorderColour(size_t stage, const ColourValue &colour)
See RenderSystem.
Texture addressing mode for each texture coordinate.
list< GLES2Context * >::type GLES2ContextList
GLSLESCgProgramFactory * mGLSLESCgProgramFactory
VertexElementType
Vertex element type, used to identify the base types of the vertex contents.
Leave the stencil buffer unchanged.
Implementation of GL ES 2.x as a rendering system.
Real getMinimumDepthInputValue(void)
Gets the minimum (closest) depth value to be used when rendering using identity transforms.
bool areFixedFunctionLightsInViewSpace() const
See RenderSystem.
Class representing colour.
float Real
Software floating point type.
static AndroidResourceManager * mResourceManager
static const ColourValue Black
GLES2RTTManager * mRTTManager
Manager object for creating render textures.
void _setTextureMatrix(size_t stage, const Matrix4 &xform)
See RenderSystem.
Singleton wrapper for hardware buffer manager.
void _setSurfaceParams(const ColourValue &ambient, const ColourValue &diffuse, const ColourValue &specular, const ColourValue &emissive, Real shininess, TrackVertexColourType tracking)
See RenderSystem.
GLES2ContextList mBackgroundContextList
List of background thread contexts.
An abstraction of a viewport, i.e.
void setNormaliseNormals(bool normalise)
See RenderSystem.
Defines a plane in 3D space.
void _setTextureBlendMode(size_t stage, const LayerBlendModeEx &bm)
See RenderSystem.
GLES2Context * _getMainContext()
Returns the main context.
GLES2Support * getGLSupportRef()
void setLightingEnabled(bool enabled)
See RenderSystem.
Class encapsulating a standard 4x4 homogeneous matrix.
An in memory cache of the OpenGL ES state.
GLSLESProgramFactory * mGLSLESProgramFactory
Factory class for GLSL ES programs.
This class declares the format of a set of vertex inputs, which can be issued to the rendering API th...
Shared pointer implementation used to share vertex buffers.
#define OGRE_MAX_TEXTURE_LAYERS
Define max number of texture layers allowed per pass on any card.
CullingMode
Hardware culling modes based on vertex winding.
GLES2StateCacheManager * mStateCacheManager
State cache manager which responsible to reduce redundant state changes.
int TrackVertexColourType
An enumeration describing which material properties should track the vertex colours.
Class which manages blending of both colour and alpha components.
Defines the functionality of a 3D API.
TextureAddressingMode
Texture addressing modes - default is TAM_WRAP.
map< String, ConfigOption >::type ConfigOptionMap
map< String, String >::type NameValuePairList
Name / value parameter pair (first = name, second = value)
CompareFunction
Comparison functions used for the depth/stencil buffer operations and others.
vector< GLuint >::type mRenderInstanceAttribsBound
vector< GLuint >::type mRenderAttribsBound
unsigned short mFixedFunctionTextureUnits
Number of fixed-function texture units.
TexCoordCalcMethod
Enum describing the ways to generate texture coordinates.
GLES2Support * getGLES2Support()
GLES2GpuProgramManager * mGpuProgramManager
An abstract class that contains a depth/stencil buffer.
GpuProgramType
Enumerates the types of programs which can run on the GPU.
Manager/factory for RenderTextures.
singleton class for storing the capabilities of the graphics card.
Real getHorizontalTexelOffset(void)
Returns the horizontal texel offset value required for mapping texel origins to pixel origins in this...
void setClipPlanesImpl(const Ogre::PlaneList &planeList)
Internal method used to set the underlying clip planes when needed.
GLES2Context * mCurrentContext
Records the state of all the vertex buffer bindings required to provide a vertex declaration with the...
This class declares the usage of a single vertex buffer as a component of a complete VertexDeclaratio...
void setShadingType(ShadeOptions so)
See RenderSystem.
Real getMaximumDepthInputValue(void)
Gets the maximum (farthest) depth value to be used when rendering using identity transforms.
Defines a program which runs on the GPU such as a vertex or fragment program.
SceneBlendFactor
Blending factors for manually blending objects with the scene.
FilterOptions
Filtering options for textures / mipmaps.
void _useLights(const LightList &lights, unsigned short limit)
See RenderSystem.
void _setTextureCoordCalculation(size_t stage, TexCoordCalcMethod m, const Frustum *frustum=0)
See RenderSystem.
Manages the target rendering window.
This is a abstract class that that provides the interface for the query class for hardware occlusion...
Matrix4 mViewMatrix
View matrix to set world against.
bool mUseAutoTextureMatrix
void _setPointParameters(Real size, bool attenuationEnabled, Real constant, Real linear, Real quadratic, Real minSize, Real maxSize)
See RenderSystem.
void _setPointSpritesEnabled(bool enabled)
See RenderSystem.
GLES2Support * mGLSupport
GL support class, used for creating windows etc.
StencilOperation
Enum describing the various actions which can be taken on the stencil buffer.
Factory class for GLSL ES programs.
'New' rendering operation using vertex buffers.
void setAmbientLight(float r, float g, float b)
See RenderSystem.
ShadeOptions
Light shading modes.
PolygonMode
The polygon mode to use when rasterising.
void setVertexBufferBinding(VertexBufferBinding *binding)
See RenderSystem.
SceneBlendOperation
Blending operations controls how objects are blended into the scene.
void _setTextureMipmapBias(size_t unit, float bias)
See RenderSystem.
HardwareBufferManager * mHardwareBufferManager
GLES2GpuProgram * mCurrentFragmentProgram
A frustum represents a pyramid, capped at the near and far end which is used to represent either a vi...
This class represents a render target that renders to multiple RenderTextures at once.
GLES2Context * mMainContext
Wrapper class which indicates a given angle value is in Radians.
Generalised low-level GL program, can be applied to multiple types (eg ARB and NV) ...