GFXGLDevice Class Reference#include <gfxGLDevice.h>
Inheritance diagram for GFXGLDevice:
[legend]List of all members.
|
Shader functions |
| virtual F32 | getPixelShaderVersion () const |
| virtual void | setPixelShaderVersion (F32 version) |
| virtual void | setShader (GFXShader *shd) |
| virtual void | disableShaders () |
| | Equivalent to setShader(NULL).
|
| virtual GFXFormat | selectSupportedFormat (GFXTextureProfile *profile, const Vector< GFXFormat > &formats, bool texture, bool mustblend) |
| virtual U32 | getNumSamplers () const |
| | Returns the number of texture samplers that can be used in a shader rendering pass.
|
| virtual GFXShader * | createShader (const char *vertFile, const char *pixFile, F32 pixVersion, const Vector< GFXShaderMacro > ¯os) |
| | Creates a shader.
|
| virtual void | clear (U32 flags, ColorI color, F32 z, U32 stencil) |
| virtual bool | beginSceneInternal () |
| virtual void | endSceneInternal () |
| virtual void | drawPrimitive (GFXPrimitiveType primType, U32 vertexStart, U32 primitiveCount) |
| virtual void | drawIndexedPrimitive (GFXPrimitiveType primType, U32 minIndex, U32 numVerts, U32 startIndex, U32 primitiveCount) |
| virtual void | setViewport (const RectI &rect) |
| virtual const RectI & | getViewport () const |
| virtual void | setClipRect (const RectI &rect) |
| virtual const RectI & | getClipRect () const |
| virtual void | preDestroy () |
| | This is called before this, or any other device, is deleted in the global destroy() method.
|
| virtual U32 | getMaxDynamicVerts () |
| virtual U32 | getMaxDynamicIndices () |
| GFXFence * | createFence () |
| | Allocate a fence.
|
| GFXGLStateBlockRef | getCurrentStateBlock () |
| virtual GFXStateBlockRef | createStateBlockInternal (const GFXStateBlockDesc &desc) |
| | Called by GFXDevice to create a device specific stateblock.
|
| virtual void | setStateBlockInternal (GFXStateBlock *block, bool force) |
| | Called by GFXDevice to actually set a stateblock.
|
| virtual void | setShaderConstBufferInternal (GFXShaderConstBuffer *buffer) |
| | Called by base GFXDevice to actually set a const buffer.
|
| virtual void | setTextureInternal (U32 textureUnit, const GFXTextureObject *texture) |
| virtual void | setCubemapInternal (U32 cubemap, const GFXGLCubemap *texture) |
| virtual void | setLightInternal (U32 lightStage, const GFXLightInfo light, bool lightEnable) |
| virtual void | setLightMaterialInternal (const GFXLightMaterial mat) |
| virtual void | setGlobalAmbientInternal (ColorF color) |
State Initalization. |
| virtual void | initStates () |
| | State initalization.
|
| virtual void | setMatrix (GFXMatrixType mtype, const MatrixF &mat) |
| | This function must be implemented differently per API and it should set ONLY the current matrix.
|
| virtual GFXVertexBuffer * | allocVertexBuffer (U32 numVerts, U32 vertFlags, U32 vertSize, GFXBufferType bufferType) |
| | This allocates a vertex buffer and returns a pointer to the allocated buffer.
|
| virtual GFXPrimitiveBuffer * | allocPrimitiveBuffer (U32 numIndices, U32 numPrimitives, GFXBufferType bufferType) |
| | This allocates a primitive buffer and returns a pointer to the allocated buffer.
|
| typedef GFXDevice | Parent |
| GLsizei | primCountToIndexCount (GFXPrimitiveType primType, U32 primitiveCount) |
| void | preDrawPrimitive () |
| void | postDrawPrimitive (U32 primitiveCount) |
| void | blitWindowToRT (GFXGLTextureTarget *targ, RectI src, RectI dst, bool filter) |
| GFXVertexBuffer * | findVolatileVBO (U32 numVerts, U32 vertFlags, U32 vertSize) |
| | Returns an existing volatile VB which has >= numVerts and the same vert flags/size, or creates a new VB if necessary.
|
| GFXPrimitiveBuffer * | findVolatilePBO (U32 numIndices, U32 numPrimitives) |
| | Returns an existing volatile PB which has >= numIndices, or creates a new PB if necessary.
|
| void | initGLState () |
| | Guaranteed to be called after all extensions have been loaded, use to init card profiler, shader version, max samplers, etc.
|
| GFXFence * | _createPlatformSpecificFence () |
| | If our platform (e.g. OS X) supports a fence extenstion (e.g. GL_APPLE_fence) this will create one, otherwise returns NULL.
|
| void | setVB (GFXGLVertexBuffer *vb) |
| | Sets mCurrentVB.
|
| void | setPB (GFXGLPrimitiveBuffer *pb) |
| | Sets mCurrentPB.
|
| U32 | mAdapterIndex |
| StrongRefPtr< GFXGLVertexBuffer > | mCurrentVB |
| StrongRefPtr< GFXGLPrimitiveBuffer > | mCurrentPB |
| MatrixF | m_mCurrentWorld |
| | Since GL does not have separate world and view matrices we need to track them.
|
| MatrixF | m_mCurrentView |
| void * | mContext |
| void * | mPixelFormat |
| F32 | mPixelShaderVersion |
| U32 | mMaxShaderTextures |
| U32 | mMaxFFTextures |
| RectI | mViewport |
| RectI | mClip |
| GFXGLStateBlockRef | mCurrentGLStateBlock |
| GFXGLShaderMgr | mShaderMgr |
| GLenum | mActiveTextureType [TEXTURE_STAGE_COUNT] |
| GFXTexHandle | mBackBufferCopyTexture |
| | When RTBlit is unsupported the entire backbuffer is copied into this for copyBBtoSfxBuff.
|
| GFXTextureTargetRef | mSfxBufferRT |
| | When RTBlit is unsupported this is used to render to backbuffer copy texture into the SfxBuff.
|
| Vector< StrongRefPtr< GFXGLVertexBuffer > > | mVolatileVBs |
| | Pool of existing volatile VBs so we can reuse previously created ones.
|
| Vector< StrongRefPtr< GFXGLPrimitiveBuffer > > | mVolatilePBs |
| | Pool of existing volatile PBs so we can reuse previously created ones.
|
| static GFXAdapter::CreateDeviceInstanceDelegate | mCreateDeviceInstance |
| class | GFXGLTextureObject |
| class | GFXGLCubemap |
| class | GFXGLWindowTarget |
| class | GFXGLPrimitiveBuffer |
| class | GFXGLVertexBuffer |
Public Member Functions |
| void | zombify () |
| void | resurrect () |
| | GFXGLDevice (U32 adapterIndex) |
| virtual | ~GFXGLDevice () |
| virtual void | init (const GFXVideoMode &mode, PlatformWindow *window=NULL) |
| | Initialize this GFXDevice, optionally specifying a platform window to bind to.
|
| virtual void | activate () |
| virtual void | deactivate () |
| virtual GFXAdapterType | getAdapterType () |
| | Returns active graphics adapter type.
|
| virtual void | enterDebugEvent (ColorI color, const char *name) |
| virtual void | leaveDebugEvent () |
| virtual void | setDebugMarker (ColorI color, const char *name) |
| virtual void | enumerateVideoModes () |
| virtual U32 | getTotalVideoMemory () |
| virtual void | copyBBToSfxBuff () |
| virtual GFXCubemap * | createCubemap () |
| virtual F32 | getFillConventionOffset () const |
| | Get the fill convention for this device.
|
|
| virtual GFXTextureTarget * | allocRenderToTextureTarget () |
| | Allocate a target for doing render to texture operations, with no depth/stencil buffer.
|
| virtual GFXWindowTarget * | allocWindowTarget (PlatformWindow *window) |
| | Allocate a target for a given window.
|
| virtual void | setActiveRenderTarget (GFXTarget *target) |
| | Start rendering to to a specified render target.
|
| virtual GFXTarget * | getActiveRenderTarget () |
| | Return a pointer to the current active render target.
|
Static Public Member Functions |
| static void | enumerateAdapters (Vector< GFXAdapter * > &adapterList) |
| static GFXDevice * | createInstance (U32 adapterIndex) |
Member Typedef Documentation
Constructor & Destructor Documentation
| GFXGLDevice::GFXGLDevice |
( |
U32 |
adapterIndex |
) |
|
| virtual GFXGLDevice::~GFXGLDevice |
( |
|
) |
[virtual] |
Member Function Documentation
| void GFXGLDevice::zombify |
( |
|
) |
|
| void GFXGLDevice::resurrect |
( |
|
) |
|
| static GFXDevice* GFXGLDevice::createInstance |
( |
U32 |
adapterIndex |
) |
[static] |
Initialize this GFXDevice, optionally specifying a platform window to bind to.
Implements GFXDevice.
| virtual void GFXGLDevice::activate |
( |
|
) |
[inline, virtual] |
| virtual void GFXGLDevice::deactivate |
( |
|
) |
[inline, virtual] |
| virtual GFXAdapterType GFXGLDevice::getAdapterType |
( |
|
) |
[inline, virtual] |
Returns active graphics adapter type.
Implements GFXDevice.
| virtual void GFXGLDevice::enterDebugEvent |
( |
ColorI |
color, |
|
|
const char * |
name | |
|
) |
| | [inline, virtual] |
| virtual void GFXGLDevice::leaveDebugEvent |
( |
|
) |
[inline, virtual] |
| virtual void GFXGLDevice::setDebugMarker |
( |
ColorI |
color, |
|
|
const char * |
name | |
|
) |
| | [inline, virtual] |
| virtual void GFXGLDevice::enumerateVideoModes |
( |
|
) |
[virtual] |
| virtual U32 GFXGLDevice::getTotalVideoMemory |
( |
|
) |
[virtual] |
| virtual void GFXGLDevice::copyBBToSfxBuff |
( |
|
) |
[virtual] |
| virtual GFXCubemap* GFXGLDevice::createCubemap |
( |
|
) |
[virtual] |
| virtual F32 GFXGLDevice::getFillConventionOffset |
( |
|
) |
const [inline, virtual] |
Get the fill convention for this device.
Implements GFXDevice.
Allocate a target for doing render to texture operations, with no depth/stencil buffer.
Implements GFXDevice.
Allocate a target for a given window.
Implements GFXDevice.
| virtual void GFXGLDevice::setActiveRenderTarget |
( |
GFXTarget * |
target |
) |
[virtual] |
Start rendering to to a specified render target.
Implements GFXDevice.
| virtual GFXTarget* GFXGLDevice::getActiveRenderTarget |
( |
|
) |
[virtual] |
Return a pointer to the current active render target.
Reimplemented from GFXDevice.
| virtual F32 GFXGLDevice::getPixelShaderVersion |
( |
|
) |
const [inline, virtual] |
| virtual void GFXGLDevice::setPixelShaderVersion |
( |
F32 |
version |
) |
[inline, virtual] |
| virtual void GFXGLDevice::setShader |
( |
GFXShader * |
shd |
) |
[virtual] |
| virtual void GFXGLDevice::disableShaders |
( |
|
) |
[virtual] |
Equivalent to setShader(NULL).
Reimplemented from GFXDevice.
- Attention:
- GL cannot check if the given format supports blending!
Implements GFXDevice.
| virtual U32 GFXGLDevice::getNumSamplers |
( |
|
) |
const [virtual] |
Returns the number of texture samplers that can be used in a shader rendering pass.
Implements GFXDevice.
Creates a shader.
- Parameters:
-
| vertFile | Vertex shader filename |
| pixFile | Pixel shader filename |
| pixVersion | Pixel shader version |
| macros | Macros passed to the shader compiler. |
Implements GFXDevice.
| virtual bool GFXGLDevice::beginSceneInternal |
( |
|
) |
[virtual] |
| virtual void GFXGLDevice::endSceneInternal |
( |
|
) |
[virtual] |
| virtual void GFXGLDevice::setViewport |
( |
const RectI & |
rect |
) |
[virtual] |
| virtual const RectI& GFXGLDevice::getViewport |
( |
|
) |
const [virtual] |
| virtual void GFXGLDevice::setClipRect |
( |
const RectI & |
rect |
) |
[virtual] |
| virtual const RectI& GFXGLDevice::getClipRect |
( |
|
) |
const [inline, virtual] |
| virtual void GFXGLDevice::preDestroy |
( |
|
) |
[inline, virtual] |
This is called before this, or any other device, is deleted in the global destroy() method.
It allows the device to clean up anything while everything is still valid.
Reimplemented from GFXDevice.
| virtual U32 GFXGLDevice::getMaxDynamicVerts |
( |
|
) |
[inline, virtual] |
| virtual U32 GFXGLDevice::getMaxDynamicIndices |
( |
|
) |
[inline, virtual] |
| GFXFence* GFXGLDevice::createFence |
( |
|
) |
[virtual] |
Allocate a fence.
The API specific implementation of GFXDevice is responsible to make sure that the proper type is used. GFXGeneralFence should work in all cases.
Implements GFXDevice.
| virtual void GFXGLDevice::setStateBlockInternal |
( |
GFXStateBlock * |
block, |
|
|
bool |
force | |
|
) |
| | [protected, virtual] |
| virtual void GFXGLDevice::setTextureInternal |
( |
U32 |
textureUnit, |
|
|
const GFXTextureObject * |
texture | |
|
) |
| | [protected, virtual] |
| virtual void GFXGLDevice::setCubemapInternal |
( |
U32 |
cubemap, |
|
|
const GFXGLCubemap * |
texture | |
|
) |
| | [protected, virtual] |
| virtual void GFXGLDevice::setLightInternal |
( |
U32 |
lightStage, |
|
|
const GFXLightInfo |
light, |
|
|
bool |
lightEnable | |
|
) |
| | [protected, virtual] |
| virtual void GFXGLDevice::setLightMaterialInternal |
( |
const GFXLightMaterial |
mat |
) |
[protected, virtual] |
| virtual void GFXGLDevice::setGlobalAmbientInternal |
( |
ColorF |
color |
) |
[protected, virtual] |
| virtual void GFXGLDevice::initStates |
( |
|
) |
[inline, protected, virtual] |
State initalization.
This MUST BE CALLED in setVideoMode after the device is created.
Implements GFXDevice.
This function must be implemented differently per API and it should set ONLY the current matrix.
For example, in OpenGL, there should be NO matrix stack activity, all the stack stuff is managed in the GFX layer.
OpenGL does not have separate world and view matrices. It has ModelView which is world * view. You must take this into consideration.
- Parameters:
-
| mtype | Which matrix to set, world/view/projection |
| mat | Matrix to assign |
Implements GFXDevice.
This allocates a vertex buffer and returns a pointer to the allocated buffer.
This function should not be called directly - rather it should be used by the GFXVertexBufferHandle class.
Implements GFXDevice.
This allocates a primitive buffer and returns a pointer to the allocated buffer.
A primitive buffer's type argument refers to the index data - the primitive data will always be preserved from call to call.
- Note:
- All index buffers use 16-bit indices.
Implements GFXDevice.
| void GFXGLDevice::preDrawPrimitive |
( |
|
) |
[private] |
| void GFXGLDevice::postDrawPrimitive |
( |
U32 |
primitiveCount |
) |
[private] |
Returns an existing volatile VB which has >= numVerts and the same vert flags/size, or creates a new VB if necessary.
Returns an existing volatile PB which has >= numIndices, or creates a new PB if necessary.
| void GFXGLDevice::initGLState |
( |
|
) |
[private] |
Guaranteed to be called after all extensions have been loaded, use to init card profiler, shader version, max samplers, etc.
| GFXFence* GFXGLDevice::_createPlatformSpecificFence |
( |
|
) |
[private] |
If our platform (e.g. OS X) supports a fence extenstion (e.g. GL_APPLE_fence) this will create one, otherwise returns NULL.
Friends And Related Function Documentation
Member Data Documentation
Since GL does not have separate world and view matrices we need to track them.
When RTBlit is unsupported the entire backbuffer is copied into this for copyBBtoSfxBuff.
When RTBlit is unsupported this is used to render to backbuffer copy texture into the SfxBuff.
Pool of existing volatile VBs so we can reuse previously created ones.
Pool of existing volatile PBs so we can reuse previously created ones.
|