GFXDevice Class Reference#include <gfxDevice.h>
Inheritance diagram for GFXDevice:
[legend]List of all members.
Detailed Description
GFXDevice is the TSE graphics interface layer.
This allows the TSE to do many things, such as use multiple render devices for multi-head systems, and allow a game to render in DirectX 9, OpenGL or any other API which has a GFX implementation seamlessly. There are many concepts in GFX device which may not be familiar to you, especially if you have not used DirectX.
Buffers There are three types of buffers in GFX: vertex, index and primitive. Please note that index buffers are not accessable outside the GFX layer, they are wrapped by primitive buffers. Primitive buffers will be explained in detail later. Buffers are allocated and deallocated using their associated allocXBuffer and freeXBuffer methods on the device. When a buffer is allocated you pass in a pointer to, depending on the buffer, a vertex type pointer or a U16 pointer. During allocation, this pointer is set to the address of where you should copy in the information for this buffer. You must the tell the GFXDevice that the information is in, and it should prepare the buffer for use by calling the prepare method on it. Dynamic vertex buffer example: GFXVertexP *verts;
GFXVertexBufferHandle vb = GFX->allocVertexBuffer( 3, &verts, true );
verts[0].point = Point3F( 200.f, 200.f, 0.f );
verts[1].point = Point3F( 200.f, 400.f, 0.f );
verts[2].point = Point3F( 400.f, 200.f, 0.f );
GFX->prepare( vb );
GFX->setVertexBuffer( vb );
GFX->drawPrimitive( GFXTriangleStrip, 0, 1 );
To use a static vertex buffer, it is very similar, this is an example using a static primitive buffer:
This takes place inside a constructor for a class which has a member variable called mPB which is the primitive buffer for the class instance. U16 *idx;
GFXPrimitiveInfo *primitiveInfo;
mPB = GFX->allocPrimitiveBuffer( 4, &idx, 1, &primitiveInfo );
idx[0] = 0;
idx[1] = 1;
idx[2] = 2;
idx[3] = 0;
primitiveInfo->indexStart = 0;
primitiveInfo->minVertex = 0;
primitiveInfo->maxVertex = 3;
primitiveInfo->primitiveCount = 3;
primitiveInfo->type = GFXLineStrip;
The following code takes place in the destructor for the same class
GFX->freePrimitiveBuffer( mPB );
This last bit takes place in the rendering function for the class
GFX->setPrimitiveBuffer( mPB );
GFX->drawPrimitive( 0 );
If you need any more examples on how to use these buffers please see the rest of the engine.
Primitive Buffers
Primitive buffers wrap and extend the concept of index buffers. The purpose of a primitive buffer is to let objects store all information they have to render their primitives in a central place. Say that a shape is made up of triangle strips and triangle fans, it would still have only one primitive buffer which contained primitive information for each strip and fan. It could then draw itself with one call.
TO BE FINISHED LATER
|
Matrix interface |
enum | GenericShaderType {
GSColor = 0,
GSTexture,
GSModColorTexture,
GSAddColorTexture,
GS_COUNT
} |
void | setWorldMatrix (const MatrixF &newWorld) |
| Sets the top of the world matrix stack.
|
const MatrixF & | getWorldMatrix () const |
| Gets the matrix on the top of the world matrix stack.
|
void | pushWorldMatrix () |
| Pushes the world matrix stack and copies the current top matrix to the new top of the stack.
|
void | popWorldMatrix () |
| Pops the world matrix stack.
|
void | setProjectionMatrix (const MatrixF &newProj) |
| Sets the projection matrix.
|
const MatrixF & | getProjectionMatrix () const |
| Gets the projection matrix.
|
void | setViewMatrix (const MatrixF &newView) |
| Sets the view matrix.
|
const MatrixF & | getViewMatrix () const |
| Gets the view matrix.
|
void | multWorld (const MatrixF &mat) |
| Multiplies the matrix at the top of the world matrix stack by a matrix and replaces the top of the matrix stack with the result.
|
void | setTextureMatrix (const U32 stage, const MatrixF &texMat) |
| Set texture matrix for a sampler.
|
virtual void | setViewport (const RectI &rect)=0 |
virtual const RectI & | getViewport () const =0 |
virtual void | setClipRect (const RectI &rect)=0 |
virtual const RectI & | getClipRect () const =0 |
virtual void | setFrustum (F32 left, F32 right, F32 bottom, F32 top, F32 nearPlane, F32 farPlane, bool bRotate=true) |
void | getFrustum (F32 *left, F32 *right, F32 *bottom, F32 *top, F32 *nearPlane, F32 *farPlane, bool *isOrtho) |
virtual void | setFrustum (F32 FOV, F32 aspectRatio, F32 nearPlane, F32 farPlane) |
void | setOrtho (F32 left, F32 right, F32 bottom, F32 top, F32 nearPlane, F32 farPlane, bool doRotate=false) |
| This will construct and apply an orthographic projection matrix with the provided parameters.
|
F32 | projectRadius (F32 dist, F32 radius) |
F32 | worldToScreenScale () |
virtual void | setupGenericShaders (GenericShaderType type=GSColor) |
| This is a helper function to set a default shader for rendering GUI elements on systems which do not support fixed-function operations as well as for things which need just generic position/texture/color shaders.
|
virtual F32 | getFillConventionOffset () const =0 |
| Get the fill convention for this device.
|
virtual U32 | getMaxDynamicVerts ()=0 |
virtual U32 | getMaxDynamicIndices ()=0 |
virtual void | doParanoidStateCheck () |
GFXDrawUtil * | getDrawUtil () |
| Get access to this device's drawing utility class.
|
void | clearSamplerOverrides () |
void | setSamplerMipLODBiasOverride (S32 stage, bool on, F32 bias=0.0f) |
void | setSamplerAddressModeOverride (S32 stage, bool on, GFXTextureAddressMode mode=GFXAddressClamp) |
void | getSamplerAddressModeOverride (S32 stage, bool &on, GFXTextureAddressMode &mode) |
void | getSamplerMipLODBiasOverride (S32 stage, bool &on, F32 &bias) |
void | dumpStates (const char *fileName) const |
| This is a method designed for debugging.
|
GFXDrawUtil * | mDrawer |
Resource debug methods |
virtual void | listResources (bool unflaggedOnly) |
| Lists how many of each GFX resource (e.g.
|
virtual void | flagCurrentResources () |
| Flags all resources GFX is currently aware of.
|
virtual void | clearResourceFlags () |
| Clears the flag on all resources GFX is currently aware of.
|
virtual void | describeResources (const char *resName, const char *file, bool unflaggedOnly) |
| Dumps a description of the specified resource types to the console.
|
GFXDeviceStatistics * | getDeviceStatistics () |
| Returns the current GFXDeviceStatistics, stats are cleared every beginScene call.
|
virtual void | fillResourceVectors (const char *resNames, bool unflaggedOnly, Vector< GFXResource * > &textureObjects, Vector< GFXResource * > &textureTargets, Vector< GFXResource * > &windowTargets, Vector< GFXResource * > &vertexBuffers, Vector< GFXResource * > &primitiveBuffers, Vector< GFXResource * > &fences, Vector< GFXResource * > &cubemaps, Vector< GFXResource * > &shaders, Vector< GFXResource * > &stateblocks) |
| This is a helper method for describeResourcesToFile.
|
GFXDeviceStatistics | mDeviceStatistics |
Texture functions |
virtual GFXCubemap * | createCubemap ()=0 |
GFXTextureManager * | getTextureManager () |
GFXTextureManager * | mTextureManager |
State tracking variables |
typedef Map< U32, GFXStateBlockRef > | StateBlockMap |
enum | TexDirtyType {
GFXTDT_Normal,
GFXTDT_Cube
} |
bool | mStateDirty |
| Set if ANY state is dirty, including matrices or primitive buffers.
|
GFXTexHandle | mCurrentTexture [TEXTURE_STAGE_COUNT] |
GFXTexHandle | mNewTexture [TEXTURE_STAGE_COUNT] |
GFXCubemapHandle | mCurrentCubemap [TEXTURE_STAGE_COUNT] |
GFXCubemapHandle | mNewCubemap [TEXTURE_STAGE_COUNT] |
TexDirtyType | mTexType [TEXTURE_STAGE_COUNT] |
bool | mTextureDirty [TEXTURE_STAGE_COUNT] |
bool | mTexturesDirty |
StateBlockMap | mCurrentStateBlocks |
bool | mStateBlockDirty |
GFXStateBlockRef | mCurrentStateBlock |
GFXStateBlockRef | mNewStateBlock |
GFXShaderConstBufferRef | mCurrentShaderConstBuffer |
bool | mSamplerAddressModeOverride [TEXTURE_STAGE_COUNT] |
GFXTextureAddressMode | mSamplerAddressModeOverrides [TEXTURE_STAGE_COUNT] |
bool | mSamplerMipLODBiasOverride [TEXTURE_STAGE_COUNT] |
F32 | mSamplerMipLODBiasOverrides [TEXTURE_STAGE_COUNT] |
Buffer Allocation |
These methods are implemented per-device and are called by the GFX layer when a user calls an alloc
- Note:
- Primitive Buffers are NOT implemented per device, they wrap index buffers
|
virtual GFXVertexBuffer * | allocVertexBuffer (U32 numVerts, U32 vertFlags, U32 vertSize, GFXBufferType bufferType)=0 |
| This allocates a vertex buffer and returns a pointer to the allocated buffer.
|
virtual GFXPrimitiveBuffer * | allocPrimitiveBuffer (U32 numIndices, U32 numPrimitives, GFXBufferType bufferType)=0 |
| This allocates a primitive buffer and returns a pointer to the allocated buffer.
|
StrongRefPtr< GFXVertexBuffer > | mCurrentVertexBuffer |
bool | mVertexBufferDirty |
StrongRefPtr< GFXPrimitiveBuffer > | mCurrentPrimitiveBuffer |
bool | mPrimitiveBufferDirty |
Public Types |
typedef Signal< bool(GFXDeviceEventType)> | DeviceEventSignal |
| deCreate |
| The device has been created, but not initialized.
|
| deInit |
| The device has been initialized.
|
| deDestroy |
| The device is about to be destroyed.
|
| GSColor = 0 |
| GSTexture |
| GSModColorTexture |
| GSAddColorTexture |
| GS_COUNT |
enum | GFXDeviceEventType {
deCreate,
deInit,
deDestroy
} |
Public Member Functions |
| GFXDevice () |
virtual | ~GFXDevice () |
virtual void | init (const GFXVideoMode &mode, PlatformWindow *window=NULL)=0 |
| Initialize this GFXDevice, optionally specifying a platform window to bind to.
|
bool | canCurrentlyRender () |
void | setAllowRender (bool render) |
bool | allowRender () |
GFXCardProfiler * | getCardProfiler () const |
const U32 | getDeviceIndex () const |
virtual GFXAdapterType | getAdapterType ()=0 |
| Returns active graphics adapter type.
|
virtual const GFXAdapter & | getAdapter () |
| Returns the Adapter that was used to create this device.
|
const Swizzle< U8, 4 > * | getDeviceSwizzle32 () const |
| Swizzle to convert 32bpp bitmaps from RGBA to the native device format.
|
const Swizzle< U8, 3 > * | getDeviceSwizzle24 () const |
| Swizzle to convert 24bpp bitmaps from RGB to the native device format.
|
virtual GFXFence * | createFence ()=0 |
| Allocate a fence.
|
|
virtual void | enterDebugEvent (ColorI color, const char *name)=0 |
virtual void | leaveDebugEvent ()=0 |
virtual void | setDebugMarker (ColorI color, const char *name)=0 |
|
Enumerates the supported video modes of the device
|
virtual void | enumerateVideoModes ()=0 |
const Vector< GFXVideoMode
> *const | getVideoModeList () const |
| Well, this function gets the video mode list!
|
F32 | formatByteSize (GFXFormat format) |
virtual GFXFormat | selectSupportedFormat (GFXTextureProfile *profile, const Vector< GFXFormat > &formats, bool texture, bool mustblend)=0 |
|
virtual GFXTexHandle & | getSfxBackBuffer () |
virtual void | copyBBToSfxBuff ()=0 |
|
virtual GFXTextureTarget * | allocRenderToTextureTarget ()=0 |
| Allocate a target for doing render to texture operations, with no depth/stencil buffer.
|
virtual GFXWindowTarget * | allocWindowTarget (PlatformWindow *window)=0 |
| Allocate a target for a given window.
|
virtual void | pushActiveRenderTarget () |
| Save current render target states - note this works with MRT's.
|
virtual void | popActiveRenderTarget () |
| Restore all render targets - supports MRT's.
|
virtual void | setActiveRenderTarget (GFXTarget *target)=0 |
| Start rendering to to a specified render target.
|
virtual GFXTarget * | getActiveRenderTarget () |
| Return a pointer to the current active render target.
|
|
virtual F32 | getPixelShaderVersion () const =0 |
virtual void | setPixelShaderVersion (F32 version)=0 |
virtual U32 | getNumSamplers () const =0 |
| Returns the number of texture samplers that can be used in a shader rendering pass.
|
virtual void | setShader (GFXShader *shader) |
virtual void | disableShaders () |
void | setShaderConstBuffer (GFXShaderConstBuffer *buffer) |
| Set the buffer! (Actual set happens on the next draw call, just like textures, state blocks, etc).
|
virtual GFXShader * | createShader (const char *vertFile, const char *pixFile, F32 pixVersion, const Vector< GFXShaderMacro > ¯os=Vector< GFXShaderMacro >())=0 |
| Creates a shader.
|
virtual void | destroyShader (GFXShader *shader) |
| Destroys shader.
|
|
virtual void | clear (U32 flags, ColorI color, F32 z, U32 stencil)=0 |
virtual bool | beginScene () |
virtual void | endScene () |
virtual GFXTexHandle & | getFrontBuffer () |
void | setPrimitiveBuffer (GFXPrimitiveBuffer *buffer) |
void | setVertexBuffer (GFXVertexBuffer *buffer) |
virtual void | drawPrimitive (GFXPrimitiveType primType, U32 vertexStart, U32 primitiveCount)=0 |
virtual void | drawIndexedPrimitive (GFXPrimitiveType primType, U32 minIndex, U32 numVerts, U32 startIndex, U32 primitiveCount)=0 |
void | drawPrimitive (U32 primitiveIndex) |
void | drawPrimitives () |
void | drawPrimitiveBuffer (GFXPrimitiveBuffer *buffer) |
|
NONE of these should be overridden by API implementations because of the state caching stuff.
|
void | setLight (U32 stage, GFXLightInfo *light) |
void | setLightMaterial (GFXLightMaterial mat) |
void | setGlobalAmbientColor (ColorF color) |
|
NONE of these should be overridden by API implementations because of the state caching stuff.
|
void | setTexture (U32 stage, GFXTextureObject *texture) |
void | setCubeTexture (U32 stage, GFXCubemap *cubemap) |
GFXTextureObject * | getCurrentTexture (U32 stage) |
|
Creates a state block object based on the desc passed in. This object represents an immutable state.
|
virtual GFXStateBlockRef | createStateBlock (const GFXStateBlockDesc &desc) |
virtual void | setStateBlock (GFXStateBlock *block) |
| Sets the current stateblock (actually activated in updateStates).
|
|
void | updateStates (bool forceSetAll=false) |
| Sets the dirty Render/Texture/Sampler states from the caching system.
|
Static Public Member Functions |
static DeviceEventSignal & | getDeviceEventSignal () |
static GFXDevice * | get () |
static void | initConsole () |
static bool | destroy () |
static const Vector< GFXDevice * > * | getDeviceVector () |
static void | setActiveDevice (U32 deviceIndex) |
static bool | devicePresent () |
Protected Member Functions |
virtual void | preDestroy () |
| This is called before this, or any other device, is deleted in the global destroy() method.
|
virtual void | setAdapter (const GFXAdapter &adapter) |
| Set the adapter that this device is using. For use by GFXInit::createDevice only.
|
virtual void | deviceInited () |
| Notify GFXDevice that we are initialized.
|
virtual void | setShaderConstBufferInternal (GFXShaderConstBuffer *buffer)=0 |
| Called by base GFXDevice to actually set a const buffer.
|
virtual void | setTextureInternal (U32 textureUnit, const GFXTextureObject *texture)=0 |
virtual void | setLightInternal (U32 lightStage, const GFXLightInfo light, bool lightEnable)=0 |
virtual void | setGlobalAmbientInternal (ColorF color)=0 |
virtual void | setLightMaterialInternal (const GFXLightMaterial mat)=0 |
virtual bool | beginSceneInternal ()=0 |
virtual void | endSceneInternal ()=0 |
virtual void | setMatrix (GFXMatrixType mtype, const MatrixF &mat)=0 |
| This function must be implemented differently per API and it should set ONLY the current matrix.
|
virtual void | _updateRenderTargets () |
|
virtual GFXStateBlockRef | createStateBlockInternal (const GFXStateBlockDesc &desc)=0 |
| Called by GFXDevice to create a device specific stateblock.
|
virtual void | setStateBlockInternal (GFXStateBlock *block, bool force)=0 |
| Called by GFXDevice to actually set a stateblock.
|
|
virtual void | initStates ()=0 |
| State initialization.
|
Protected Attributes |
Vector< GFXVideoMode > | mVideoModes |
| List of valid video modes for this device.
|
GFXCardProfiler * | mCardProfiler |
| The CardProfiler for this device.
|
GFXResource * | mResourceListHead |
| Head of the resource list.
|
bool | mCanCurrentlyRender |
| Set once the device is active.
|
bool | mAllowRender |
| Set if we're in a mode where we want rendering to occur.
|
bool | mInitialized |
| This will allow querying to see if a device is initialized and ready to have operations performed on it.
|
Swizzle< U8, 4 > * | mDeviceSwizzle32 |
Swizzle< U8, 3 > * | mDeviceSwizzle24 |
GFXTexHandle | mSfxBackBuffer |
bool | mUseSfxBackBuffer |
GFXTexHandle | mFrontBuffer [2] |
U32 | mCurrentFrontBufferIdx |
Vector< GFXTargetRef > | mRTStack |
GFXTargetRef | mCurrentRT |
|
GFXLightInfo | mCurrentLight [LIGHT_STAGE_COUNT] |
bool | mCurrentLightEnable [LIGHT_STAGE_COUNT] |
bool | mLightDirty [LIGHT_STAGE_COUNT] |
bool | mLightsDirty |
ColorF | mGlobalAmbientColor |
bool | mGlobalAmbientColorDirty |
|
GFXLightMaterial | mCurrentLightMaterial |
bool | mLightMaterialDirty |
|
MatrixF | mWorldMatrix [WORLD_STACK_MAX] |
bool | mWorldMatrixDirty |
S32 | mWorldStackSize |
MatrixF | mProjectionMatrix |
bool | mProjectionMatrixDirty |
MatrixF | mViewMatrix |
bool | mViewMatrixDirty |
MatrixF | mTextureMatrix [TEXTURE_STAGE_COUNT] |
bool | mTextureMatrixDirty [TEXTURE_STAGE_COUNT] |
bool | mTextureMatrixCheckDirty |
|
F32 | mFrustLeft |
F32 | mFrustRight |
F32 | mFrustBottom |
F32 | mFrustTop |
F32 | mFrustNear |
F32 | mFrustFar |
bool | mFrustOrtho |
Static Protected Attributes |
static S32 | smSfxBackBufferSize |
Private Attributes |
U32 | mDeviceIndex |
| Device ID for this device.
|
GFXAdapter | mAdapter |
| Adapter for this device.
|
Static Private Attributes |
|
static Vector< GFXDevice * > | smGFXDevice |
| Global GFXDevice vector.
|
static S32 | smActiveDeviceIndex |
| Active GFX Device index, signed so -1 can be uninitialized.
|
static DeviceEventSignal * | smSignalGFXDeviceEvent |
Friends |
class | GFXInit |
class | GFXPrimitiveBufferHandle |
class | GFXVertexBufferHandleBase |
class | GFXTextureObject |
class | GFXTexHandle |
class | GFXTestFullscreenToggle |
class | TestGFXTextureCube |
class | TestGFXRenderTargetCube |
class | TestGFXRenderTargetStack |
class | GFXResource |
Member Typedef Documentation
Member Enumeration Documentation
- Enumerator:
-
deCreate |
The device has been created, but not initialized. |
deInit |
The device has been initialized. |
deDestroy |
The device is about to be destroyed. |
- Enumerator:
-
GFXTDT_Normal |
|
GFXTDT_Cube |
|
- Enumerator:
-
GSColor |
|
GSTexture |
|
GSModColorTexture |
|
GSAddColorTexture |
|
GS_COUNT |
|
Constructor & Destructor Documentation
virtual GFXDevice::~GFXDevice |
( |
|
) |
[virtual] |
Member Function Documentation
static GFXDevice* GFXDevice::get |
( |
|
) |
[static] |
static void GFXDevice::initConsole |
( |
|
) |
[static] |
static bool GFXDevice::destroy |
( |
|
) |
[static] |
static const Vector<GFXDevice *>* GFXDevice::getDeviceVector |
( |
|
) |
[inline, static] |
static void GFXDevice::setActiveDevice |
( |
U32 |
deviceIndex |
) |
[static] |
static bool GFXDevice::devicePresent |
( |
|
) |
[inline, static] |
virtual void GFXDevice::preDestroy |
( |
|
) |
[protected, virtual] |
virtual void GFXDevice::setAdapter |
( |
const GFXAdapter & |
adapter |
) |
[inline, protected, virtual] |
virtual void GFXDevice::deviceInited |
( |
|
) |
[protected, virtual] |
bool GFXDevice::canCurrentlyRender |
( |
|
) |
[inline] |
void GFXDevice::setAllowRender |
( |
bool |
render |
) |
[inline] |
bool GFXDevice::allowRender |
( |
|
) |
[inline] |
const U32 GFXDevice::getDeviceIndex |
( |
|
) |
const [inline] |
virtual const GFXAdapter& GFXDevice::getAdapter |
( |
|
) |
[inline, virtual] |
Returns the Adapter that was used to create this device.
virtual void GFXDevice::enterDebugEvent |
( |
ColorI |
color, |
|
|
const char * |
name | |
|
) |
| | [pure virtual] |
virtual void GFXDevice::leaveDebugEvent |
( |
|
) |
[pure virtual] |
virtual void GFXDevice::setDebugMarker |
( |
ColorI |
color, |
|
|
const char * |
name | |
|
) |
| | [pure virtual] |
virtual void GFXDevice::listResources |
( |
bool |
unflaggedOnly |
) |
[virtual] |
Lists how many of each GFX resource (e.g.
textures, texture targets, shaders, etc.) GFX is aware of - Parameters:
-
| unflaggedOnly | If true, this method only counts unflagged resources |
virtual void GFXDevice::flagCurrentResources |
( |
|
) |
[virtual] |
Flags all resources GFX is currently aware of.
virtual void GFXDevice::clearResourceFlags |
( |
|
) |
[virtual] |
Clears the flag on all resources GFX is currently aware of.
virtual void GFXDevice::describeResources |
( |
const char * |
resName, |
|
|
const char * |
file, |
|
|
bool |
unflaggedOnly | |
|
) |
| | [virtual] |
Dumps a description of the specified resource types to the console.
- Parameters:
-
| resNames | A string of space separated class names (e.g. "GFXTextureObject GFXTextureTarget GFXShader") to describe to the console |
| file | A path to the file to write the descriptions to. If it is NULL or "", descriptions are written to the console. |
| unflaggedOnly | If true, this method only counts unflagged resources |
- Note:
- resNames is case sensitive because there is no dStristr function.
virtual void GFXDevice::fillResourceVectors |
( |
const char * |
resNames, |
|
|
bool |
unflaggedOnly, |
|
|
Vector< GFXResource * > & |
textureObjects, |
|
|
Vector< GFXResource * > & |
textureTargets, |
|
|
Vector< GFXResource * > & |
windowTargets, |
|
|
Vector< GFXResource * > & |
vertexBuffers, |
|
|
Vector< GFXResource * > & |
primitiveBuffers, |
|
|
Vector< GFXResource * > & |
fences, |
|
|
Vector< GFXResource * > & |
cubemaps, |
|
|
Vector< GFXResource * > & |
shaders, |
|
|
Vector< GFXResource * > & |
stateblocks | |
|
) |
| | [protected, virtual] |
This is a helper method for describeResourcesToFile.
It walks through the GFXResource list and sorts it by item type, putting the resources into the proper vector. - See also:
- describeResources
virtual void GFXDevice::enumerateVideoModes |
( |
|
) |
[pure virtual] |
Well, this function gets the video mode list!
virtual void GFXDevice::setStateBlockInternal |
( |
GFXStateBlock * |
block, |
|
|
bool |
force | |
|
) |
| | [protected, pure virtual] |
virtual void GFXDevice::setTextureInternal |
( |
U32 |
textureUnit, |
|
|
const GFXTextureObject * |
texture | |
|
) |
| | [protected, pure virtual] |
virtual void GFXDevice::setLightInternal |
( |
U32 |
lightStage, |
|
|
const GFXLightInfo |
light, |
|
|
bool |
lightEnable | |
|
) |
| | [protected, pure virtual] |
virtual void GFXDevice::setGlobalAmbientInternal |
( |
ColorF |
color |
) |
[protected, pure virtual] |
virtual void GFXDevice::setLightMaterialInternal |
( |
const GFXLightMaterial |
mat |
) |
[protected, pure virtual] |
virtual bool GFXDevice::beginSceneInternal |
( |
|
) |
[protected, pure virtual] |
virtual void GFXDevice::endSceneInternal |
( |
|
) |
[protected, pure virtual] |
virtual void GFXDevice::initStates |
( |
|
) |
[protected, pure virtual] |
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 |
Implemented in GFXD3D8Device, GFX360Device, GFXPCD3D9Device, GFXGLDevice, and GFXNullDevice.
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.
Implemented in GFXD3D8Device, GFXD3D9Device, GFXGLDevice, and GFXNullDevice.
virtual void GFXDevice::_updateRenderTargets |
( |
|
) |
[protected, virtual] |
virtual GFXTexHandle& GFXDevice::getSfxBackBuffer |
( |
|
) |
[inline, virtual] |
virtual void GFXDevice::copyBBToSfxBuff |
( |
|
) |
[pure virtual] |
virtual GFXCubemap* GFXDevice::createCubemap |
( |
|
) |
[pure virtual] |
const Swizzle<U8, 4>* GFXDevice::getDeviceSwizzle32 |
( |
|
) |
const [inline] |
Swizzle to convert 32bpp bitmaps from RGBA to the native device format.
const Swizzle<U8, 3>* GFXDevice::getDeviceSwizzle24 |
( |
|
) |
const [inline] |
Swizzle to convert 24bpp bitmaps from RGB to the native device format.
virtual GFXTextureTarget* GFXDevice::allocRenderToTextureTarget |
( |
|
) |
[pure virtual] |
virtual void GFXDevice::pushActiveRenderTarget |
( |
|
) |
[virtual] |
virtual void GFXDevice::popActiveRenderTarget |
( |
|
) |
[virtual] |
virtual void GFXDevice::setActiveRenderTarget |
( |
GFXTarget * |
target |
) |
[pure virtual] |
virtual GFXTarget* GFXDevice::getActiveRenderTarget |
( |
|
) |
[virtual] |
virtual F32 GFXDevice::getPixelShaderVersion |
( |
|
) |
const [pure virtual] |
virtual void GFXDevice::setPixelShaderVersion |
( |
F32 |
version |
) |
[pure virtual] |
virtual U32 GFXDevice::getNumSamplers |
( |
|
) |
const [pure virtual] |
virtual void GFXDevice::setShader |
( |
GFXShader * |
shader |
) |
[inline, virtual] |
virtual void GFXDevice::disableShaders |
( |
|
) |
[inline, virtual] |
Set the buffer! (Actual set happens on the next draw call, just like textures, state blocks, etc).
virtual void GFXDevice::destroyShader |
( |
GFXShader * |
shader |
) |
[inline, virtual] |
virtual bool GFXDevice::beginScene |
( |
|
) |
[virtual] |
virtual void GFXDevice::endScene |
( |
|
) |
[virtual] |
virtual GFXTexHandle& GFXDevice::getFrontBuffer |
( |
|
) |
[inline, virtual] |
void GFXDevice::drawPrimitive |
( |
U32 |
primitiveIndex |
) |
|
void GFXDevice::drawPrimitives |
( |
|
) |
|
virtual GFXFence* GFXDevice::createFence |
( |
|
) |
[pure virtual] |
void GFXDevice::setGlobalAmbientColor |
( |
ColorF |
color |
) |
|
Sets the current stateblock (actually activated in updateStates).
void GFXDevice::updateStates |
( |
bool |
forceSetAll = false |
) |
|
Sets the dirty Render/Texture/Sampler states from the caching system.
void GFXDevice::setWorldMatrix |
( |
const MatrixF & |
newWorld |
) |
[inline] |
Sets the top of the world matrix stack.
- Parameters:
-
| newWorld | New world matrix to set |
const MatrixF & GFXDevice::getWorldMatrix |
( |
|
) |
const [inline] |
Gets the matrix on the top of the world matrix stack.
void GFXDevice::pushWorldMatrix |
( |
|
) |
[inline] |
Pushes the world matrix stack and copies the current top matrix to the new top of the stack.
void GFXDevice::popWorldMatrix |
( |
|
) |
[inline] |
Pops the world matrix stack.
void GFXDevice::setProjectionMatrix |
( |
const MatrixF & |
newProj |
) |
[inline] |
Sets the projection matrix.
- Parameters:
-
| newProj | New projection matrix to set |
const MatrixF & GFXDevice::getProjectionMatrix |
( |
|
) |
const [inline] |
Gets the projection matrix.
void GFXDevice::setViewMatrix |
( |
const MatrixF & |
newView |
) |
[inline] |
Sets the view matrix.
- Parameters:
-
| newView | New view matrix to set |
const MatrixF & GFXDevice::getViewMatrix |
( |
|
) |
const [inline] |
void GFXDevice::multWorld |
( |
const MatrixF & |
mat |
) |
[inline] |
Multiplies the matrix at the top of the world matrix stack by a matrix and replaces the top of the matrix stack with the result.
- Parameters:
-
void GFXDevice::setTextureMatrix |
( |
const U32 |
stage, |
|
|
const MatrixF & |
texMat | |
|
) |
| | [inline] |
Set texture matrix for a sampler.
virtual void GFXDevice::setViewport |
( |
const RectI & |
rect |
) |
[pure virtual] |
virtual const RectI& GFXDevice::getViewport |
( |
|
) |
const [pure virtual] |
virtual void GFXDevice::setClipRect |
( |
const RectI & |
rect |
) |
[pure virtual] |
virtual const RectI& GFXDevice::getClipRect |
( |
|
) |
const [pure virtual] |
virtual void GFXDevice::setFrustum |
( |
F32 |
left, |
|
|
F32 |
right, |
|
|
F32 |
bottom, |
|
|
F32 |
top, |
|
|
F32 |
nearPlane, |
|
|
F32 |
farPlane, |
|
|
bool |
bRotate = true | |
|
) |
| | [virtual] |
virtual void GFXDevice::setFrustum |
( |
F32 |
FOV, |
|
|
F32 |
aspectRatio, |
|
|
F32 |
nearPlane, |
|
|
F32 |
farPlane | |
|
) |
| | [virtual] |
This will construct and apply an orthographic projection matrix with the provided parameters.
- Parameters:
-
| doRotate | If set to true, the resulting matrix will be rotated PI/2 around the X axis |
F32 GFXDevice::projectRadius |
( |
F32 |
dist, |
|
|
F32 |
radius | |
|
) |
| | |
F32 GFXDevice::worldToScreenScale |
( |
|
) |
|
This is a helper function to set a default shader for rendering GUI elements on systems which do not support fixed-function operations as well as for things which need just generic position/texture/color shaders.
- Parameters:
-
| type | Type of generic shader, add your own if you need |
virtual F32 GFXDevice::getFillConventionOffset |
( |
|
) |
const [pure virtual] |
virtual U32 GFXDevice::getMaxDynamicVerts |
( |
|
) |
[pure virtual] |
virtual U32 GFXDevice::getMaxDynamicIndices |
( |
|
) |
[pure virtual] |
virtual void GFXDevice::doParanoidStateCheck |
( |
|
) |
[inline, virtual] |
Get access to this device's drawing utility class.
void GFXDevice::clearSamplerOverrides |
( |
|
) |
|
void GFXDevice::setSamplerMipLODBiasOverride |
( |
S32 |
stage, |
|
|
bool |
on, |
|
|
F32 |
bias = 0.0f | |
|
) |
| | |
void GFXDevice::getSamplerMipLODBiasOverride |
( |
S32 |
stage, |
|
|
bool & |
on, |
|
|
F32 & |
bias | |
|
) |
| | |
void GFXDevice::dumpStates |
( |
const char * |
fileName |
) |
const |
This is a method designed for debugging.
It will allow you to dump the states in the render manager out to a file so that it can be diffed and examined.
Friends And Related Function Documentation
friend class GFXTestFullscreenToggle [friend] |
friend class TestGFXTextureCube [friend] |
friend class TestGFXRenderTargetCube [friend] |
friend class TestGFXRenderTargetStack [friend] |
Member Data Documentation
Active GFX Device index, signed so -1 can be uninitialized.
Device ID for this device.
List of valid video modes for this device.
The CardProfiler for this device.
Set once the device is active.
Set if we're in a mode where we want rendering to occur.
This will allow querying to see if a device is initialized and ready to have operations performed on it.
Set if ANY state is dirty, including matrices or primitive buffers.
|