28 #ifndef __GLRenderSystem_H__
29 #define __GLRenderSystem_H__
73 void initConfigOptions(
void);
74 void initInputDevices(
void);
75 void processInputDevices(
void);
77 void setGLLight(
size_t index,
Light* lt);
78 void makeGLMatrix(GLfloat gl_matrix[16],
const Matrix4& m);
97 GLfloat _getCurrentAnisotropy(
size_t unit);
103 void setGLLightPositionDirection(
Light* lt, GLenum lightindex);
106 GLfloat mAutoTextureMatrix[16];
117 GLuint getCombinedMinMipFilter(
void)
const;
141 void setClipPlanesImpl(
const PlaneList& clipPlanes);
142 bool activateGLTextureUnit(
size_t unit);
154 const String& getName(
void)
const;
162 void setConfigOption(
const String &name,
const String &value);
166 String validateConfigOptions(
void);
170 RenderWindow* _initialise(
bool autoCreateWindow,
const String& windowTitle =
"OGRE Render Window");
182 void reinitialise(
void);
191 void setAmbientLight(
float r,
float g,
float b);
199 void setLightingEnabled(
bool enabled);
202 RenderWindow* _createRenderWindow(
const String &name,
unsigned int width,
unsigned int height,
220 String getErrorDescription(
long errorNumber)
const;
229 void setNormaliseNormals(
bool normalise);
237 void _useLights(
const LightList& lights,
unsigned short limit);
245 void _setWorldMatrix(
const Matrix4 &m);
249 void _setViewMatrix(
const Matrix4 &m);
253 void _setProjectionMatrix(
const Matrix4 &m);
264 void _setPointParameters(
Real size,
bool attenuationEnabled,
269 void _setPointSpritesEnabled(
bool enabled);
273 void _setTexture(
size_t unit,
bool enabled,
const TexturePtr &tex);
277 void _setTextureCoordSet(
size_t stage,
size_t index);
294 void _setTextureBorderColour(
size_t stage,
const ColourValue& colour);
298 void _setTextureMipmapBias(
size_t unit,
float bias);
302 void _setTextureMatrix(
size_t stage,
const Matrix4& xform);
322 void _setAlphaRejectSettings(
CompareFunction func,
unsigned char value,
bool alphaToCoverage);
330 void _beginFrame(
void);
334 void _endFrame(
void);
346 void _setDepthBufferCheckEnabled(
bool enabled =
true);
350 void _setDepthBufferWriteEnabled(
bool enabled =
true);
358 void _setDepthBias(
float constantBias,
float slopeScaleBias);
362 void _setColourBufferWriteEnabled(
bool red,
bool green,
bool blue,
bool alpha);
370 void _convertProjectionMatrix(
const Matrix4& matrix,
371 Matrix4& dest,
bool forGpuProgram =
false);
375 void _makeProjectionMatrix(
const Radian& fovy,
Real aspect,
Real nearPlane,
Real farPlane,
376 Matrix4& dest,
bool forGpuProgram =
false);
381 Real nearPlane,
Real farPlane,
Matrix4& dest,
bool forGpuProgram =
false);
386 Matrix4& dest,
bool forGpuProgram =
false);
390 void _applyObliqueDepthProjection(
Matrix4& matrix,
const Plane& plane,
399 void enableClipPlane (
ushort index,
bool enable);
407 void setStencilCheckEnabled(
bool enabled);
416 bool twoSidedOperation =
false);
424 void _setTextureLayerAnisotropy(
size_t unit,
unsigned int maxAnisotropy);
453 void bindGpuProgramPassIterationParameters(
GpuProgramType gptype);
457 void setScissorTest(
bool enabled,
size_t left = 0,
size_t top = 0,
size_t right = 800,
size_t bottom = 600) ;
458 void clearFrameBuffer(
unsigned int buffers,
460 Real depth = 1.0f,
unsigned short stencil = 0);
462 Real getHorizontalTexelOffset(
void);
463 Real getVerticalTexelOffset(
void);
464 Real getMinimumDepthInputValue(
void);
465 Real getMaximumDepthInputValue(
void);
467 void registerThread();
468 void unregisterThread();
469 void preExtraThreadsStarted();
470 void postExtraThreadsStarted();
478 void _oneTimeContextInitialization();
493 void _unregisterContext(
GLContext *context);
498 unsigned int getDisplayMonitorCount()
const;
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.
Generalised low-level GL program, can be applied to multiple types (eg ARB and NV) ...
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...
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.
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
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.