28 #ifndef __GLRenderSystem_H__
29 #define __GLRenderSystem_H__
41 class GLSLProgramFactory;
76 void initConfigOptions(
void);
77 void initInputDevices(
void);
78 void processInputDevices(
void);
80 void setGLLight(
size_t index,
Light* lt);
81 void makeGLMatrix(GLfloat gl_matrix[16],
const Matrix4& m);
100 GLfloat _getCurrentAnisotropy(
size_t unit);
106 void setGLLightPositionDirection(
Light* lt, GLenum lightindex);
109 GLfloat mAutoTextureMatrix[16];
120 GLuint getCombinedMinMipFilter(
void)
const;
150 void setClipPlanesImpl(
const PlaneList& clipPlanes);
151 bool activateGLTextureUnit(
size_t unit);
153 const size_t vertexStart,
166 const String& getName(
void)
const;
174 void setConfigOption(
const String &name,
const String &value);
178 String validateConfigOptions(
void);
182 RenderWindow* _initialise(
bool autoCreateWindow,
const String& windowTitle =
"OGRE Render Window");
194 void reinitialise(
void);
203 void setAmbientLight(
float r,
float g,
float b);
211 void setLightingEnabled(
bool enabled);
214 RenderWindow* _createRenderWindow(
const String &name,
unsigned int width,
unsigned int height,
225 void _getDepthStencilFormatFor( GLenum internalColourFormat, GLenum *depthFormat,
226 GLenum *stencilFormat );
238 String getErrorDescription(
long errorNumber)
const;
247 void setNormaliseNormals(
bool normalise);
255 void _useLights(
const LightList& lights,
unsigned short limit);
263 void _setWorldMatrix(
const Matrix4 &m);
267 void _setViewMatrix(
const Matrix4 &m);
271 void _setProjectionMatrix(
const Matrix4 &m);
282 void _setPointParameters(
Real size,
bool attenuationEnabled,
287 void _setPointSpritesEnabled(
bool enabled);
291 void _setTexture(
size_t unit,
bool enabled,
const TexturePtr &tex);
295 void _setTextureCoordSet(
size_t stage,
size_t index);
312 void _setTextureBorderColour(
size_t stage,
const ColourValue& colour);
316 void _setTextureMipmapBias(
size_t unit,
float bias);
320 void _setTextureMatrix(
size_t stage,
const Matrix4& xform);
340 void _setAlphaRejectSettings(
CompareFunction func,
unsigned char value,
bool alphaToCoverage);
348 void _beginFrame(
void);
352 void _endFrame(
void);
364 void _setDepthBufferCheckEnabled(
bool enabled =
true);
368 void _setDepthBufferWriteEnabled(
bool enabled =
true);
376 void _setDepthBias(
float constantBias,
float slopeScaleBias);
380 void _setColourBufferWriteEnabled(
bool red,
bool green,
bool blue,
bool alpha);
388 void _convertProjectionMatrix(
const Matrix4& matrix,
389 Matrix4& dest,
bool forGpuProgram =
false);
393 void _makeProjectionMatrix(
const Radian& fovy,
Real aspect,
Real nearPlane,
Real farPlane,
394 Matrix4& dest,
bool forGpuProgram =
false);
399 Real nearPlane,
Real farPlane,
Matrix4& dest,
bool forGpuProgram =
false);
404 Matrix4& dest,
bool forGpuProgram =
false);
408 void _applyObliqueDepthProjection(
Matrix4& matrix,
const Plane& plane,
417 void enableClipPlane (
ushort index,
bool enable);
425 void setStencilCheckEnabled(
bool enabled);
434 bool twoSidedOperation =
false);
442 void _setTextureLayerAnisotropy(
size_t unit,
unsigned int maxAnisotropy);
472 void bindGpuProgramPassIterationParameters(
GpuProgramType gptype);
476 void setScissorTest(
bool enabled,
size_t left = 0,
size_t top = 0,
size_t right = 800,
size_t bottom = 600) ;
477 void clearFrameBuffer(
unsigned int buffers,
479 Real depth = 1.0f,
unsigned short stencil = 0);
481 Real getHorizontalTexelOffset(
void);
482 Real getVerticalTexelOffset(
void);
483 Real getMinimumDepthInputValue(
void);
484 Real getMaximumDepthInputValue(
void);
486 void registerThread();
487 void unregisterThread();
488 void preExtraThreadsStarted();
489 void postExtraThreadsStarted();
497 void _oneTimeContextInitialization();
512 void _unregisterContext(
GLContext *context);
517 unsigned int getDisplayMonitorCount()
const;
520 virtual void beginProfileEvent(
const String &eventName );
523 virtual void endProfileEvent(
void );
526 virtual void markProfileEvent(
const String &eventName );
Manages the target rendering window.
A 'canvas' which can receive the results of a rendering operation.
#define MAX_LIGHTS
Array of up to 8 lights, indexed as per API Note that a null value indicates a free slot...
Class encapsulating a standard 4x4 homogeneous matrix.
float Real
Software floating point type.
GLGpuProgramManager * mGpuProgramManager
Singleton wrapper for hardware buffer manager.
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.
Leave the stencil buffer unchanged.
Matrix4 mViewMatrix
View matrix to set world against.
Class representing colour.
GpuProgramType
Enumerates the types of programs which can run on the GPU.
A frustum represents a pyramid, capped at the near and far end which is used to represent either a vi...
Defines a program which runs on the GPU such as a vertex or fragment program.
GLSLProgramFactory * mGLSLProgramFactory
TexCoordCalcMethod
Enum describing the ways to generate texture coordinates.
Shared pointer implementation used to share index buffers.
Generalised low-level GL program, can be applied to multiple types (eg ARB and NV) ...
vector< GLuint >::type mRenderInstanceAttribsBound
SceneBlendFactor
Blending factors for manually blending objects with the scene.
uint32 mStencilMask
Store last stencil mask state.
GLGpuProgram * mCurrentFragmentProgram
CullingMode
Hardware culling modes based on vertex winding.
This class represents a render target that renders to multiple RenderTextures at once.
bool mUseAutoTextureMatrix
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...
vector< RenderWindow * >::type RenderWindowList
Render window container.
Representation of a dynamic light source in the scene.
bool areFixedFunctionLightsInViewSpace() const
See RenderSystem.
vector< Plane >::type PlaneList
GLGpuProgram * mCurrentVertexProgram
#define OGRE_MAX_TEXTURE_LAYERS
Define max number of texture layers allowed per pass on any card.
GLGpuProgram * mCurrentGeometryProgram
GLSupport * mGLSupport
GL support class, used for creating windows etc.
An abstract class that contains a depth/stencil buffer.
unsigned short mFixedFunctionTextureUnits
Number of fixed-function texture units.
bool mStopRendering
Rendering loop control.
ShadeOptions
Light shading modes.
GLContextList mBackgroundContextList
List of background thread contexts.
Texture addressing mode for each texture coordinate.
map< String, ConfigOption >::type ConfigOptionMap
TextureAddressingMode
Texture addressing modes - default is TAM_WRAP.
unsigned short mCurrentLights
FilterOptions mMinFilter
Last min & mip filtering options, so we can combine them.
bool mDepthWrite
Store last depth write state.
Specialisation of SharedPtr to allow SharedPtr to be assigned to TexturePtr.
VertexElementType
Vertex element type, used to identify the base types of the vertex contents.
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...
Class that encapsulates an GL context.
Wrapper class which indicates a given angle value is in Radians.
PolygonMode
The polygon mode to use when rasterising.
static const ColourValue Black
vector< GLuint >::type mRenderAttribsBound
SceneBlendOperation
Blending operations controls how objects are blended into the scene.
list< GLContext * >::type GLContextList
HardwareBufferManager * mHardwareBufferManager
singleton class for storing the capabilities of the graphics card.
Manager/factory for RenderTextures.
vector< RenderWindowDescription >::type RenderWindowDescriptionList
Render window creation parameters container.
Factory class for GLSL programs.
StencilOperation
Enum describing the various actions which can be taken onthe stencil buffer.
FilterOptions
Filtering options for textures / mipmaps.
GLRTTManager * mRTTManager
Manager object for creating render textures.
Defines the functionality of a 3D API.
CompareFunction
Comparison functions used for the depth/stencil buffer operations and others.
int TrackVertexColourType
An enumeration describing which material properties should track the vertex colours.
Class which manages blending of both colour and alpha components.
GLContext * mCurrentContext
bool mGLInitialised
Check if the GL system has already been initialised.
ushort mActiveTextureUnit
Implementation of GL as a rendering system.