28 #ifndef __GLRenderSystem_H__
29 #define __GLRenderSystem_H__
81 void initConfigOptions(
void);
82 void initInputDevices(
void);
83 void processInputDevices(
void);
85 void setGLLight(
size_t index,
Light* lt);
86 void makeGLMatrix(GLfloat gl_matrix[16],
const Matrix4& m);
108 GLfloat _getCurrentAnisotropy(
size_t unit);
114 void setGLLightPositionDirection(
Light* lt, GLenum lightindex);
117 GLfloat mAutoTextureMatrix[16];
128 GLuint getCombinedMinMipFilter(
void)
const;
160 void setClipPlanesImpl(
const PlaneList& clipPlanes);
162 const size_t vertexStart,
175 const String& getName(
void)
const;
183 void setConfigOption(
const String &name,
const String &value);
187 String validateConfigOptions(
void);
191 RenderWindow* _initialise(
bool autoCreateWindow,
const String& windowTitle =
"OGRE Render Window");
203 void reinitialise(
void);
212 void setAmbientLight(
float r,
float g,
float b);
220 void setLightingEnabled(
bool enabled);
223 RenderWindow* _createRenderWindow(
const String &name,
unsigned int width,
unsigned int height,
234 void _getDepthStencilFormatFor( GLenum internalColourFormat, GLenum *depthFormat,
235 GLenum *stencilFormat );
247 String getErrorDescription(
long errorNumber)
const;
256 void setNormaliseNormals(
bool normalise);
264 void _useLights(
const LightList& lights,
unsigned short limit);
272 void _setWorldMatrix(
const Matrix4 &m);
276 void _setViewMatrix(
const Matrix4 &m);
280 void _setProjectionMatrix(
const Matrix4 &m);
291 void _setPointParameters(
Real size,
bool attenuationEnabled,
296 void _setPointSpritesEnabled(
bool enabled);
300 void _setTexture(
size_t unit,
bool enabled,
const TexturePtr &tex);
304 void _setTextureCoordSet(
size_t stage,
size_t index);
321 void _setTextureBorderColour(
size_t stage,
const ColourValue& colour);
325 void _setTextureMipmapBias(
size_t unit,
float bias);
329 void _setTextureMatrix(
size_t stage,
const Matrix4& xform);
349 void _setAlphaRejectSettings(
CompareFunction func,
unsigned char value,
bool alphaToCoverage);
357 void _beginFrame(
void);
361 void _endFrame(
void);
373 void _setDepthBufferCheckEnabled(
bool enabled =
true);
377 void _setDepthBufferWriteEnabled(
bool enabled =
true);
385 void _setDepthBias(
float constantBias,
float slopeScaleBias);
389 void _setColourBufferWriteEnabled(
bool red,
bool green,
bool blue,
bool alpha);
397 void _convertProjectionMatrix(
const Matrix4& matrix,
398 Matrix4& dest,
bool forGpuProgram =
false);
402 void _makeProjectionMatrix(
const Radian& fovy,
Real aspect,
Real nearPlane,
Real farPlane,
403 Matrix4& dest,
bool forGpuProgram =
false);
408 Real nearPlane,
Real farPlane,
Matrix4& dest,
bool forGpuProgram =
false);
413 Matrix4& dest,
bool forGpuProgram =
false);
417 void _applyObliqueDepthProjection(
Matrix4& matrix,
const Plane& plane,
426 void enableClipPlane (
ushort index,
bool enable);
434 void setStencilCheckEnabled(
bool enabled);
443 bool twoSidedOperation =
false);
451 void _setTextureUnitCompareFunction(
size_t unit,
CompareFunction function);
455 void _setTextureUnitCompareEnabled(
size_t unit,
bool compare);
459 void _setTextureLayerAnisotropy(
size_t unit,
unsigned int maxAnisotropy);
489 void bindGpuProgramPassIterationParameters(
GpuProgramType gptype);
493 void setScissorTest(
bool enabled,
size_t left = 0,
size_t top = 0,
size_t right = 800,
size_t bottom = 600) ;
494 void clearFrameBuffer(
unsigned int buffers,
496 Real depth = 1.0f,
unsigned short stencil = 0);
498 Real getHorizontalTexelOffset(
void);
499 Real getVerticalTexelOffset(
void);
500 Real getMinimumDepthInputValue(
void);
501 Real getMaximumDepthInputValue(
void);
503 void registerThread();
504 void unregisterThread();
505 void preExtraThreadsStarted();
506 void postExtraThreadsStarted();
515 void _oneTimeContextInitialization();
530 void _unregisterContext(
GLContext *context);
535 unsigned int getDisplayMonitorCount()
const;
541 virtual void beginProfileEvent(
const String &eventName );
544 virtual void endProfileEvent(
void );
547 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.
virtual bool hasAnisotropicMipMapFilter() const
Determines if the system has anisotropic mip map filter support.
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.
TexCoordCalcMethod
Enum describing the ways to generate texture coordinates.
Factory class for GLSL programs.
Shared pointer implementation used to share vertex buffers.
Generalised low-level GL program, can be applied to multiple types (eg ARB and NV) ...
vector< GLuint >::type mRenderInstanceAttribsBound
GLSL::GLSLProgramFactory * mGLSLProgramFactory
SceneBlendFactor
Blending factors for manually blending objects with the scene.
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.
VertexElementType
Vertex element type, used to identify the base types of the vertex contents.
GLStateCacheManager * mStateCacheManager
An abstraction of a viewport, i.e.
uint32 mStencilWriteMask
Store last stencil mask state.
'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
GLContext * _getMainContext()
Returns the main context.
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.
StencilOperation
Enum describing the various actions which can be taken on the 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.
GLSupport * getGLSupportRef()
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.
An in memory cache of the OpenGL state.