NL3D::IDriver Class Reference

#include <driver.h>

Inheritance diagram for NL3D::IDriver:

NLMISC::CRefCount NL3D::CDriverGL

Vertex program interface

enum  TMatrix { ModelView = 0, Projection, ModelViewProjection, NumMatrix }
enum  TTransform {
  Identity = 0, Inverse, Transpose, InverseTranspose,
  NumTransform
}
virtual bool activeVertexProgram (CVertexProgram *program)=0
virtual void enableVertexProgramDoubleSidedColor (bool doubleSided)=0
virtual bool isVertexProgramEmulated () const=0
virtual bool isVertexProgramSupported () const=0
virtual void setConstant (uint index, uint num, const double *src)=0
 setup several 4 double csts taken from the given tab

virtual void setConstant (uint index, uint num, const float *src)=0
 setup several 4 float csts taken from the given tab

virtual void setConstant (uint index, const NLMISC::CVectorD &value)=0
virtual void setConstant (uint index, const NLMISC::CVector &value)=0
virtual void setConstant (uint index, double, double, double, double)=0
virtual void setConstant (uint index, float, float, float, float)=0
virtual void setConstantMatrix (uint index, TMatrix matrix, TTransform transform)=0
virtual bool supportCloudRenderSinglePass () const=0
virtual bool supportVertexProgramDoubleSidedColor () const=0
 Check if the driver support double sided colors vertex programs.


Public Types

enum  TMatrixCount { MaxModelMatrix = 16 }
enum  TMessageBoxIcon {
  noIcon = 0, handIcon, questionIcon, exclamationIcon,
  asteriskIcon, warningIcon, errorIcon, informationIcon,
  stopIcon, iconCount
}
enum  TMessageBoxId {
  okId = 0, yesId, noId, abortId,
  retryId, cancelId, ignoreId, idCount
}
enum  TMessageBoxType {
  okType = 0, okCancelType, yesNoType, abortRetryIgnoreType,
  yesNoCancelType, retryCancelType, typeCount
}
enum  TPolygonMode { Filled = 0, Line, Point }
enum  TVBHardType { VBHardAGP = 0, VBHardVRAM, CountVBHard }

Public Member Functions

virtual bool activate (void)=0
 Before rendering via a driver in a thread, must activate() (per thread).

virtual bool activeVertexBuffer (CVertexBuffer &VB, uint first, uint end)=0
virtual bool activeVertexBuffer (CVertexBuffer &VB)=0
virtual void activeVertexBufferHard (IVertexBufferHard *VB)=0
virtual bool clear2D (CRGBA rgba)=0
virtual bool clearZBuffer (float zval=1)=0
virtual void copyFrameBufferToTexture (ITexture *tex, uint32 level, uint32 offsetx, uint32 offsety, uint32 x, uint32 y, uint32 width, uint32 height)=0
virtual IVertexBufferHardcreateVertexBufferHard (uint16 vertexFormat, const uint8 *typeArray, uint32 numVertices, TVBHardType vbType, const uint8 *uvRouting)=0
virtual void deleteVertexBufferHard (IVertexBufferHard *VB)=0
virtual void enableLight (uint8 num, bool enable=true)=0
virtual void endSpecularBatch ()=0
virtual ModeList enumModes ()=0
virtual bool fillBuffer (CBitmap &bitmap)=0
virtual void forceDXTCCompression (bool dxtcComp)=0
virtual void forceNormalize (bool normalize)=0
virtual void forceTextureResize (uint divisor)=0
virtual uint32 getAvailableVertexAGPMemory ()=0
virtual uint32 getAvailableVertexVRAMMemory ()=0
virtual uint8 getBitPerPixel ()=0
 Return the depth of the driver after init().

virtual void getBuffer (CBitmap &bitmap)=0
virtual void getBufferPart (CBitmap &bitmap, NLMISC::CRect &rect)=0
virtual void * getDisplay ()=0
virtual const char * getDriverInformation ()=0
virtual NLMISC::IEventEmittergetEventEmitter (void)=0
virtual uint32 getImplementationVersion () const=0
virtual uint getMaxLight () const=0
virtual uint getMaxVerticesByVertexBufferHard () const=0
virtual bool getModes (std::vector< GfxMode > &modes)=0
virtual sint getNbTextureStages () const=0
 Get the number of texture stage avaliable, for multitexturing (Normal material shaders). Valid only after setDisplay().

TPolygonMode getPolygonMode ()
const sintgetRefCount () const
virtual uint getSwapVBLInterval ()=0
 get the number of VBL wait when a swapBuffers() is issued. 0 means no synchronisation to the VBL

virtual uint getTextureHandle (const ITexture &tex)=0
virtual const char * getVideocardInformation ()=0
virtual CMatrix getViewMatrix (void) const=0
virtual void getViewport (CViewport &viewport)=0
virtual void getWindowPos (uint32 &x, uint32 &y)=0
 Get the position of the window always (0,0) in fullscreen.

virtual emptyProc getWindowProc ()=0
virtual void getWindowSize (uint32 &width, uint32 &height)=0
 Get the width and the height of the window.

virtual void getZBuffer (std::vector< float > &zbuffer)=0
virtual void getZBufferPart (std::vector< float > &zbuffer, NLMISC::CRect &rect)=0
 IDriver (void)
virtual bool init (uint windowIcon=0)=0
virtual bool initVertexArrayRange (uint agpMem, uint vramMem=0)=0
bool invalidateShareTexture (ITexture &)
virtual bool isActive ()=0
 Return true if driver is still active. Return false else. If he user close the window, must return false.

virtual bool isForceNormalize () const=0
virtual bool isTextureExist (const ITexture &tex)=0
virtual void mapTextureStageToUV (uint stage, uint uv)=0
virtual void multiplyModelMatrix (const CMatrix &mtx)=0
virtual bool release (void)
 Deriver should calls IDriver::release() first, to destroy all driver components (textures, shaders, VBuffers).

virtual bool render (CPrimitiveBlock &PB, CMaterial &Mat)=0
virtual void renderOrientedQuads (CMaterial &Mat, uint32 startIndex, uint32 numQuads)=0
virtual void renderPoints (CMaterial &Mat, uint32 numPoints)=0
virtual void renderQuads (CMaterial &Mat, uint32 startIndex, uint32 numQuads)=0
virtual void renderSimpleTriangles (uint32 *tri, uint32 ntris)=0
virtual void renderTriangles (CMaterial &Mat, uint32 *tri, uint32 ntris)=0
virtual void setAmbientColor (CRGBA color)=0
virtual void setColorMask (bool bRed, bool bGreen, bool bBlue, bool bAlpha)=0
 Set the color mask filter through where the operation done will pass.

virtual bool setDisplay (void *wnd, const GfxMode &mode, bool show=true)=0 throw (EBadDisplay)
virtual void setFrustum (float left, float right, float bottom, float top, float znear, float zfar, bool perspective=true)=0
virtual void setLight (uint8 num, const CLight &light)=0
virtual bool setMode (const GfxMode &mode)=0
virtual bool setMonitorColorProperties (const CMonitorColorProperties &properties)=0
virtual void setPerPixelLightingLight (CRGBA diffuse, CRGBA specular, float shininess)=0
virtual void setPolygonMode (TPolygonMode mode)
virtual void setSwapVBLInterval (uint interval)=0
virtual bool setupMaterial (CMaterial &mat)=0
virtual void setupModelMatrix (const CMatrix &mtx)=0
virtual void setupScissor (const class CScissor &scissor)=0
virtual bool setupTexture (ITexture &tex)=0
virtual bool setupTextureEx (ITexture &tex, bool bUpload, bool &bAllUploaded, bool bMustRecreateSharedTexture=false)=0
virtual void setupViewMatrix (const CMatrix &mtx)=0
virtual void setupViewMatrixEx (const CMatrix &mtx, const CVector &cameraPos)=0
virtual void setupViewport (const class CViewport &viewport)=0
virtual bool slowUnlockVertexBufferHard () const=0
virtual void startSpecularBatch ()=0
virtual bool supportPerPixelLighting (bool specular) const=0
virtual bool supportVertexBufferHard () const=0
virtual bool swapBuffers (void)=0
 Swap the back and front buffers.

virtual void swapTextureHandle (ITexture &tex0, ITexture &tex1)=0
virtual TMessageBoxId systemMessageBox (const char *message, const char *title, TMessageBoxType type=okType, TMessageBoxIcon icon=noIcon)
virtual bool uploadTexture (ITexture &tex, NLMISC::CRect &rect, uint8 nNumMipMap)=0
virtual bool uploadTextureCube (ITexture &tex, NLMISC::CRect &rect, uint8 nNumMipMap, uint8 nNumFace)=0
virtual ~IDriver (void)
Material multipass.
virtual sint beginMaterialMultiPass ()=0
 init multipass for _CurrentMaterial. return number of pass required to render this material.

virtual void endMaterialMultiPass ()=0
 end multipass for this material.

virtual void setupMaterialPass (uint pass)=0
 active the ith pass of this material.

Disable Hardware Feature
virtual void disableHardwareTextureShader ()=0
virtual void disableHardwareVertexArrayAGP ()=0
virtual void disableHardwareVertexProgram ()=0
Fog support.
virtual void enableFog (bool enable)=0
virtual bool fogEnabled ()=0
virtual CRGBA getFogColor () const=0
virtual float getFogEnd () const=0
virtual float getFogStart () const=0
 Get.

virtual void setupFog (float start, float end, CRGBA color)=0
 setup fog parameters. fog must enabled to see result. start and end are in [0,1] range.

Mouse / Keyboard / Game devices
virtual NLMISC::IKeyboardDeviceenableLowLevelKeyboard (bool enable)=0
virtual NLMISC::IMouseDeviceenableLowLevelMouse (bool enable, bool exclusive)=0
virtual uint getDoubleClickDelay (bool hardwareMouse)=0
virtual NLMISC::IInputDeviceManagergetLowLevelInputDeviceManager ()=0
virtual void setCapture (bool b)=0
virtual void setMousePos (float x, float y)=0
 x and y must be between 0.0 and 1.0

virtual void showCursor (bool b)=0
 show cursor if b is true, or hide it if b is false

Misc
virtual void enablePolygonSmoothing (bool smooth)=0
virtual void finish ()=0
virtual NLMISC::CRGBA getBlendConstantColor () const=0
virtual bool isPolygonSmoothingEnabled () const=0
 see enablePolygonSmoothing()

virtual void setBlendConstantColor (NLMISC::CRGBA col)=0
virtual bool supportBlendConstantColor () const=0
Profiling.
virtual void enableUsedTextureMemorySum (bool enable=true)=0
virtual void endProfileVBHardLock (std::vector< std::string > &result)=0
virtual uint32 getUsedTextureMemory () const=0
virtual uint32 profileAllocatedTextureMemory ()=0
virtual void profileRenderedPrimitives (CPrimitiveProfile &pIn, CPrimitiveProfile &pOut)=0
virtual uint32 profileSetupedMaterials () const=0
virtual uint32 profileSetupedModelMatrix () const=0
virtual void profileVBHardAllocation (std::vector< std::string > &result)=0
virtual void startProfileVBHardLock ()=0
EMBM support. If texture shaders are present, this is not available, must use them instead.
EMBM is a color op of CMaterial. NB : EMBM is the equivalent of the CMaterial::OffsetTexture addressing mode. However, it is both a texture adressing mode and a color op. NB : EMBM may not be supported by all stages.

virtual bool isEMBMSupportedAtStage (uint stage) const=0
virtual void setEMBMMatrix (const uint stage, const float mat[4])=0
virtual bool supportEMBM () const=0
Texture addressing modes aka textures/pixels shaders
virtual bool isTextureAddrModeSupported (CMaterial::TTexAddressingMode mode) const=0
 test wether a texture addressing mode is supported

virtual bool isWaterShaderSupported () const=0
 test wether a texture addressing mode is supported

virtual void setMatrix2DForTextureOffsetAddrMode (const uint stage, const float mat[4])=0
virtual bool supportTextureShaders () const=0
 test wether the device supports some form of texture shader. (could be limited to DX6 EMBM for example)


Static Public Member Functions

void getTextureShareName (const ITexture &tex, std::string &output)

Data Fields

sint crefs
CPtrInfo * pinfo

Static Public Attributes

const uint32 InterfaceVersion = 0x4e
 Version of the driver interface. To increment when the interface change.

CPtrInfo NullPtrInfo

Protected Member Functions

void removeShaderPtr (ItShaderPtrList shaderIt)
void removeTextureDrvInfoPtr (ItTexDrvInfoPtrMap texDrvInfoIt)
void removeTextureDrvSharePtr (ItTexDrvSharePtrList texDrvShareIt)
void removeVBDrvInfoPtr (ItVBDrvInfoPtrList vbDrvInfoIt)
 remove ptr from the lists in the driver.

void removeVtxPrgDrvInfoPtr (ItVtxPrgDrvInfoPtrList vtxPrgDrvInfoIt)

Protected Attributes

TPolygonMode _PolygonMode
TShaderPtrList _Shaders
CSynchronized< TTexDrvInfoPtrMap_SyncTexDrvInfos
TTexDrvSharePtrList _TexDrvShares
TVBDrvInfoPtrList _VBDrvInfos
TVtxPrgDrvInfoPtrList _VtxPrgDrvInfos

Friends

struct CPtrInfo
class CTextureDrvShare
class IShader
class ITextureDrvInfos
class IVBDrvInfos
class IVertexProgramDrvInfos

Member Enumeration Documentation

enum NL3D::IDriver::TMatrix
 

Enumeration values:
ModelView 
Projection 
ModelViewProjection 
NumMatrix 

Definition at line 825 of file driver.h.

00826         {
00827                 ModelView= 0,
00828                 Projection,
00829                 ModelViewProjection,
00830                 NumMatrix
00831         };

enum NL3D::IDriver::TMatrixCount
 

Driver Max matrix count. Kept for backward compatibility. Suppose any Hardware VertexProgram can handle only 16 matrix

Enumeration values:
MaxModelMatrix 

Definition at line 148 of file driver.h.

00148 { MaxModelMatrix= 16 };

enum NL3D::IDriver::TMessageBoxIcon
 

Enumeration values:
noIcon 
handIcon 
questionIcon 
exclamationIcon 
asteriskIcon 
warningIcon 
errorIcon 
informationIcon 
stopIcon 
iconCount 

Definition at line 133 of file driver.h.

enum NL3D::IDriver::TMessageBoxId
 

Enumeration values:
okId 
yesId 
noId 
abortId 
retryId 
cancelId 
ignoreId 
idCount 

Definition at line 131 of file driver.h.

enum NL3D::IDriver::TMessageBoxType
 

Enumeration values:
okType 
okCancelType 
yesNoType 
abortRetryIgnoreType 
yesNoCancelType 
retryCancelType 
typeCount 

Definition at line 132 of file driver.h.

enum NL3D::IDriver::TPolygonMode
 

Driver's polygon modes.

See also:
setPolygonMode, getPolygonMode
Enumeration values:
Filled 
Line 
Point 

Definition at line 140 of file driver.h.

Referenced by getPolygonMode().

00140 { Filled=0, Line, Point };

enum NL3D::IDriver::TTransform
 

Enumeration values:
Identity 
Inverse 
Transpose 
InverseTranspose 
NumTransform 

Definition at line 833 of file driver.h.

00834         {
00835                 Identity=0,
00836                 Inverse,
00837                 Transpose,
00838                 InverseTranspose,
00839                 NumTransform
00840         };

enum NL3D::IDriver::TVBHardType
 

Driver VertexBufferHard type.

See also:
createVertexBufferHard()
Enumeration values:
VBHardAGP 
VBHardVRAM 
CountVBHard 

Definition at line 155 of file driver.h.


Constructor & Destructor Documentation

NL3D::IDriver::IDriver void   ) 
 

Definition at line 49 of file driver.cpp.

References _PolygonMode, and Filled.

00049                  : _SyncTexDrvInfos( "IDriver::_SyncTexDrvInfos" )
00050 {
00051         _PolygonMode= Filled;
00052 }

NL3D::IDriver::~IDriver void   )  [virtual]
 

Definition at line 55 of file driver.cpp.

References _Shaders, _SyncTexDrvInfos, _TexDrvShares, _VBDrvInfos, _VtxPrgDrvInfos, and nlassert.

00056 {
00057         // Must clean up everything before closing driver.
00058         // Must doing this in release(), so assert here if not done...
00059         {               
00060                 CSynchronized<TTexDrvInfoPtrMap>::CAccessor access(&_SyncTexDrvInfos);
00061                 TTexDrvInfoPtrMap &rTexDrvInfos = access.value();
00062                 nlassert( rTexDrvInfos.size() == 0 );
00063         }
00064 
00065         nlassert(_TexDrvShares.size()==0);
00066         nlassert(_Shaders.size()==0);
00067         nlassert(_VBDrvInfos.size()==0);
00068         nlassert(_VtxPrgDrvInfos.size()==0);
00069 }


Member Function Documentation

virtual bool NL3D::IDriver::activate void   )  [pure virtual]
 

Before rendering via a driver in a thread, must activate() (per thread).

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::activate().

virtual bool NL3D::IDriver::activeVertexBuffer CVertexBuffer VB,
uint  first,
uint  end
[pure virtual]
 

active a current VB, for future render(). This method suppose that only vertices in given range will be used in future render(). This could be usefull for DX or OpenGL driver. Undefined results if primitives in render() use vertices not in this range.

NB: please make sure you have setuped / unsetuped the current vertex program BEFORE activate the vertex buffer.

Parameters:
VB the vertexBuffer to activate.
first the first vertex important for render (begin to 0). nlassert(first<=end);
end the last vertex important for render, +1. count==end-first. nlassert(end<=VB.getNumVertices);
See also:
activeVertexProgram

Implemented in NL3D::CDriverGL.

virtual bool NL3D::IDriver::activeVertexBuffer CVertexBuffer VB  )  [pure virtual]
 

active a current VB, for future render(). This method suppose that all vertices in the VB will be used.

NB: please make sure you have setuped / unsetuped the current vertex program BEFORE activate the vertex buffer.

See also:
activeVertexProgram

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CShadowMapManager::applyFakeGaussianBlur(), NL3D::CMeshMRMGeom::beginMesh(), NL3D::CMeshGeom::beginMesh(), NL3D::CCloud::disp(), NL3D::CCloud::dispBill(), NL3D::CPSUtil::displayArrow(), NL3D::CPSUtil::displayBBox(), NL3D::CInstanceGroup::displayDebugClusters(), NL3D::CPSTailDot::displayRibbons(), NL3D::CPSRibbonLookAt::displayRibbons(), NL3D::CPSRibbon::displayRibbons(), NL3D::CCloud::dispXYZ(), NL3D::CDeform2d::doDeform(), NL3D::CWaterModel::doSimpleRender(), NL3D::CPSDot::draw(), NL3D::CDRU::drawBitmap(), NL3D::CPSFaceHelper::drawFaces(), NL3D::CPSFanLightHelper::drawFanLight(), NL3D::CDRU::drawLine(), NL3D::CDriverUser::drawLine(), NL3D::CDRU::drawLinesUnlit(), NL3D::CPSFaceLookAtHelper::drawLookAt(), NL3D::CPSFaceLookAtHelper::drawLookAtAlignOnMotion(), NL3D::CPSConstraintMeshHelper::drawMeshs(), NL3D::CPSConstraintMeshHelper::drawPrerotatedMeshs(), NL3D::CDRU::drawQuad(), NL3D::CDriverUser::drawQuad(), NL3D::CDriverUser::drawQuads(), NL3D::CPSShockWaveHelper::drawShockWave(), NL3D::CDRU::drawTriangle(), NL3D::CDriverUser::drawTriangle(), NL3D::CDRU::drawTrianglesUnlit(), NL3D::CShadowMapManager::fillBlackBorder(), NL3D::CNoise3d::flush(), NL3D::CRenderStringBuffer::flush(), NL3D::CNoise3d::flush2passes(), NL3D::CCoarseMeshManager::flushRender(), NL3D::CRenderStringBuffer::flushUnProjected(), NL3D::CCloud::genBill(), NL3D::CCloud::generate(), NL3D::CMeshInstance::generateShadowMap(), NL3D::CCloud::light(), NL3D::CMotionBlur::performMotionBlur(), NL3D::CShadowPolyReceiver::render(), NL3D::CSegRemanence::render(), NL3D::CMeshMRMSkinnedGeom::render(), NL3D::CMeshMRMGeom::render(), NL3D::CMeshGeom::render(), NL3D::CComputedString::render2D(), NL3D::CComputedString::render3D(), NL3D::CMeshInstance::renderIntoSkeletonShadowMap(), NL3D::CMeshGeom::renderSimpleWithMaterial(), NL3D::CMeshMRMGeom::renderSkin(), NL3D::CMeshGeom::renderSkin(), NL3D::CCloud::reset(), NL3D::CMeshVPPerPixelLight::setupForMaterial(), NL3D::CPSGravity::show(), NL3D::CWaterModel::traverseRender(), and NL3D::CFlareModel::traverseRender().

virtual void NL3D::IDriver::activeVertexBufferHard IVertexBufferHard VB  )  [pure virtual]
 

active a current VB Hard, for future render().

NB: please make sure you have setuped / unsetuped the current vertex program BEFORE activate the vertex buffer.

See also:
activeVertexProgram

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CMeshMRMGeom::beginMesh(), NL3D::CMeshGeom::beginMesh(), NL3D::CMeshMRMGeom::render(), NL3D::CMeshGeom::render(), NL3D::CMeshGeom::renderSkin(), and NL3D::CMeshVPPerPixelLight::setupForMaterial().

virtual bool NL3D::IDriver::activeVertexProgram CVertexProgram program  )  [pure virtual]
 

Activate / disactivate a vertex program

Parameters:
program is a pointer on a vertex program. Can be NULL to disable the current vertex program.
Returns:
true if setup/unsetup successed, false else.

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CMeshVPWindTree::begin(), NL3D::CMeshVPWindTree::beginMBRInstance(), NL3D::CMeshVPWindTree::beginMBRMesh(), NL3D::CWaterModel::doSimpleRender(), NL3D::CMeshVPPerPixelLight::enable(), NL3D::CMeshVPWindTree::end(), NL3D::CMeshVPWindTree::endMBRMesh(), NL3D::CVegetableManager::exitRenderStateForBlendLayerModel(), NL3D::CVegetableManager::render(), NL3D::CWaterModel::setupMaterialNVertexShader(), NL3D::CVegetableManager::setupRenderStateForBlendLayerModel(), NL3D::CWaterModel::traverseRender(), and NL3D::CFlareModel::traverseRender().

virtual sint NL3D::IDriver::beginMaterialMultiPass  )  [pure virtual]
 

init multipass for _CurrentMaterial. return number of pass required to render this material.

NB: setupMaterial() must be called before thoses methods. NB: This is intended to be use with the rendering of simple primitives. NB: Other render calls performs the needed setup automatically

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CWaterModel::traverseRender().

virtual bool NL3D::IDriver::clear2D CRGBA  rgba  )  [pure virtual]
 

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::clearBuffers(), NL3D::CDriverUser::clearRGBABuffer(), and NL3D::CShadowMapManager::renderGenerate().

virtual bool NL3D::IDriver::clearZBuffer float  zval = 1  )  [pure virtual]
 

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::clearBuffers(), and NL3D::CDriverUser::clearZBuffer().

virtual void NL3D::IDriver::copyFrameBufferToTexture ITexture tex,
uint32  level,
uint32  offsetx,
uint32  offsety,
uint32  x,
uint32  y,
uint32  width,
uint32  height
[pure virtual]
 

Copy a portion of the FrameBuffer into a texture. The texture must have been right sized before the call. This mark the texture as valid, but doesn't copy data to system memory. This also mean that regenerating texture datas will erase what has been copied before in the device memory. This doesn't work with compressed textures. Ideally, the FrameBuffer should have the same format than the texture.

Parameters:
tex the texture to copy to.
level the mipmap to copy texture to.
xoffset x position within the destination texture
yoffset y position within the destination texture
x x position widthin the framebuffer
y y position widthin the framebuffer
width width of the area to be copied.
height height of the area to be copied.

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CShadowMapManager::copyScreenToBlurTexture(), NL3D::CDeform2d::doDeform(), NL3D::CCloud::genBill(), NL3D::CCloud::generate(), NL3D::CCloud::light(), NL3D::CMotionBlur::performMotionBlur(), NL3D::CShadowMapManager::renderGenerate(), and NL3D::CCloud::reset().

virtual IVertexBufferHard* NL3D::IDriver::createVertexBufferHard uint16  vertexFormat,
const uint8 typeArray,
uint32  numVertices,
TVBHardType  vbType,
const uint8 uvRouting
[pure virtual]
 

create a IVertexBufferHard. delete it with deleteVertexBufferHard. NB: user should (must) keep a CRefPtr<> on this ptr, because if driver is deleted (for any reason) the pointer will be no longer valid.

NB: return NULL if driver do not support the requested VertexBufferHard.Reason for failures are:

  • Driver do not support VertexBufferHard at all. ie supportVertexBufferHard() return false.
  • Driver do not support the vbType wanted or the vertexFormat for vertexBufferHard
  • Driver do not support the numVertices wanted.
  • Driver can't allocate any more ressource.

Parameters:
vertexFormat see CVertexBuffer::setVertexFormat().
numVertices the number of vertices to be created.
vbType kind of RAM shere the VB will be allocated.
uvRouting is the uv routing table. If NULL, set the default routing table.
Returns:
a vertexBufferHard interface.

virtual void NL3D::IDriver::deleteVertexBufferHard IVertexBufferHard VB  )  [pure virtual]
 

delete a IVertexBufferHard. NB: VertexBufferHard are automatically deleted at IDriver::release();

Implemented in NL3D::CDriverGL.

virtual void NL3D::IDriver::disableHardwareTextureShader  )  [pure virtual]
 

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::disableHardwareTextureShader().

virtual void NL3D::IDriver::disableHardwareVertexArrayAGP  )  [pure virtual]
 

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::disableHardwareVertexArrayAGP().

virtual void NL3D::IDriver::disableHardwareVertexProgram  )  [pure virtual]
 

Disable some Feature that may be supported by the Hardware Call before setDisplay() to work properly

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::disableHardwareVertexProgram().

virtual void NL3D::IDriver::enableFog bool  enable  )  [pure virtual]
 

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::enableFog(), NL3D::CVegetableManager::exitRenderStateForBlendLayerModel(), NL3D::CVegetableManager::render(), NL3D::CShadowMapManager::renderGenerate(), and NL3D::CVegetableManager::setupRenderStateForBlendLayerModel().

virtual void NL3D::IDriver::enableLight uint8  num,
bool  enable = true
[pure virtual]
 

Enable / disable light.

You must call setLight() if you active the ligth.

Parameters:
num is the number of the light to enable / disable.
enable is true to enable the light, false to disable it.
See also:
setLight()

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CRenderTrav::changeLightSetup(), NL3D::CDriverUser::enableLight(), and NL3D::CRenderTrav::resetLightSetup().

virtual NLMISC::IKeyboardDevice* NL3D::IDriver::enableLowLevelKeyboard bool  enable  )  [pure virtual]
 

Enable / disable a low level keyboard. Such a keyboard can only send KeyDown and KeyUp event. It just consider the keyboard as a gamepad with lots of buttons... This returns a interface to some parameters when it is supported, or NULL otherwise. The interface pointer is valid as long as the low level keyboard is enabled. A call to disable the keyboard returns NULL, and restore the default keyboard behaviour

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::enableLowLevelKeyboard().

virtual NLMISC::IMouseDevice* NL3D::IDriver::enableLowLevelMouse bool  enable,
bool  exclusive
[pure virtual]
 

Enable / disable low level mouse. This allow to take advantage of some options (speed of the mouse, automatic wrapping) It returns a interface to these parameters when it is supported, or NULL otherwise The interface pointer is valid as long as the low level mouse is enabled. A call to disable the mouse returns NULL, and restore the default mouse behaviour NB : - In this mode the mouse cursor isn't drawn.

  • Calls to showCursor have no effects
    • Calls to setCapture have no effects

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::enableLowLevelMouse().

virtual void NL3D::IDriver::enablePolygonSmoothing bool  smooth  )  [pure virtual]
 

Use AntiAliasing For polygons (GL_POLYGON_SMOOTH like, not the FSAA). See GL_POLYGON_SMOOTH help, and GL_SRC_ALPHA_SATURATE OpenGL doc (not yet implemented now since used only for alpha part in ShadowMap gen)

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CShadowMapManager::renderGenerate().

virtual void NL3D::IDriver::enableUsedTextureMemorySum bool  enable = true  )  [pure virtual]
 

Enable the sum of texture memory used since last swapBuffers() call. To retrieve the memory used call getUsedTextureMemory().

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::enableUsedTextureMemorySum().

virtual void NL3D::IDriver::enableVertexProgramDoubleSidedColor bool  doubleSided  )  [pure virtual]
 

Activate VertexProgram 2Sided Color mode. In 2Sided mode, the BackFace (if material 2Sided enabled) read the result from o[BFC0], and not o[COL0]. default is false. you should reset to false after use. NB: no-op if not supporte by driver

Implemented in NL3D::CDriverGL.

virtual void NL3D::IDriver::endMaterialMultiPass  )  [pure virtual]
 

end multipass for this material.

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CWaterModel::traverseRender().

virtual void NL3D::IDriver::endProfileVBHardLock std::vector< std::string > &  result  )  [pure virtual]
 

If the driver support it, stop profile VBHard locks, and "print" result No-Op if already profiling NB: The results are the Locks in Chronogical time (since last swapBuffers). Since multiple frame are summed, an "*" is marked againts the VBHard name to show if it was not always this one (ptr test and not name test) in the chronogical order. NB: if the driver does not support VBHard or VBHard profiling (like ATI VBHard), result is empty. NB: ???? string is displayed if the VBHard has no name or if was just deleted.

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::endProfileVBHardLock().

virtual void NL3D::IDriver::endSpecularBatch  )  [pure virtual]
 

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CSkeletonModel::renderSkinList().

virtual ModeList NL3D::IDriver::enumModes  )  [pure virtual]
 

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::enumModes().

virtual bool NL3D::IDriver::fillBuffer CBitmap bitmap  )  [pure virtual]
 

fill the RGBA back buffer

Parameters:
bitmap will be written in the buffer. no-op if bad size.
Returns:
true if success

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::fillBuffer().

virtual void NL3D::IDriver::finish  )  [pure virtual]
 

force the driver to flush all command. glFinish() in opengl. Interesting only for debug and profiling purpose.

Implemented in NL3D::CDriverGL.

virtual bool NL3D::IDriver::fogEnabled  )  [pure virtual]
 

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::fogEnabled(), NL3D::CVegetableManager::render(), NL3D::CShadowMapManager::renderGenerate(), and NL3D::CVegetableManager::setupRenderStateForBlendLayerModel().

virtual void NL3D::IDriver::forceDXTCCompression bool  dxtcComp  )  [pure virtual]
 

if true force all the uncompressed RGBA 32 bits and RGBA 24 bits texture to be DXTC5 compressed. Do this only during upload if ITexture::allowDegradation() is true and if ITexture::UploadFormat is "Automatic" and if bitmap format is RGBA.

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::forceDXTCCompression().

virtual void NL3D::IDriver::forceNormalize bool  normalize  )  [pure virtual]
 

Force input normal to be normalized by the driver. default is false. NB: driver force the normalisation himself if:

  • current Model matrix has a scale.

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CMeshMRMGeom::beginMesh(), NL3D::CMeshMRMGeom::endMesh(), NL3D::CMeshMRMSkinnedGeom::render(), NL3D::CMeshMRMGeom::render(), and NL3D::CSkeletonModel::renderSkins().

virtual void NL3D::IDriver::forceTextureResize uint  divisor  )  [pure virtual]
 

if !=1, force mostly all the textures (but TextureFonts lightmaps, interfaces etc..) to be divided by Divisor (2, 4, 8...) Default is 1. NB: this is done only on TextureFile

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::forceTextureResize().

virtual uint32 NL3D::IDriver::getAvailableVertexAGPMemory  )  [pure virtual]
 

Return the amount of AGP memory allocated by initVertexArrayRange() to store vertices.

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::getAvailableVertexAGPMemory().

virtual uint32 NL3D::IDriver::getAvailableVertexVRAMMemory  )  [pure virtual]
 

Return the amount of video memory allocated by initVertexArrayRange() to store vertices.

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::getAvailableVertexVRAMMemory().

virtual uint8 NL3D::IDriver::getBitPerPixel  )  [pure virtual]
 

Return the depth of the driver after init().

Implemented in NL3D::CDriverGL.

virtual NLMISC::CRGBA NL3D::IDriver::getBlendConstantColor  )  const [pure virtual]
 

see supportBlendConstantColor(). Get the current Blend Constant Color.

Implemented in NL3D::CDriverGL.

virtual void NL3D::IDriver::getBuffer CBitmap bitmap  )  [pure virtual]
 

get the RGBA back buffer

Parameters:
bitmap the buffer will be written in this bitmap

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::getBuffer().

virtual void NL3D::IDriver::getBufferPart CBitmap bitmap,
NLMISC::CRect rect
[pure virtual]
 

get a part of the RGBA back buffer NB: 0,0 is the bottom left corner of the screen.

Parameters:
bitmap the buffer will be written in this bitmap
rect the in/out (wanted/clipped) part of Color buffer to retrieve.

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::getBufferPart().

virtual void* NL3D::IDriver::getDisplay  )  [pure virtual]
 

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::getDisplay().

virtual uint NL3D::IDriver::getDoubleClickDelay bool  hardwareMouse  )  [pure virtual]
 

Get the delay in ms for mouse double clicks.

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::getDoubleClickDelay().

virtual const char* NL3D::IDriver::getDriverInformation  )  [pure virtual]
 

Get driver informations. get the nel name of the driver (ex: "Opengl 1.2 NeL Driver")

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::getDriverInformation().

virtual NLMISC::IEventEmitter* NL3D::IDriver::getEventEmitter void   )  [pure virtual]
 

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::release(), and NL3D::CDriverUser::setDisplay().

virtual CRGBA NL3D::IDriver::getFogColor  )  const [pure virtual]
 

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CShadowMapManager::renderProject().

virtual float NL3D::IDriver::getFogEnd  )  const [pure virtual]
 

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CShadowMapManager::renderProject().

virtual float NL3D::IDriver::getFogStart  )  const [pure virtual]
 

Get.

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CShadowMapManager::renderProject().

virtual uint32 NL3D::IDriver::getImplementationVersion  )  const [pure virtual]
 

Get the driver version. Not the same than interface version. Incremented at each implementation change.

See also:
InterfaceVersion

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::getImplementationVersion().

virtual NLMISC::IInputDeviceManager* NL3D::IDriver::getLowLevelInputDeviceManager  )  [pure virtual]
 

Check wether there is a low level device manager available, and get its interface. Return NULL if not available From this interface you can deal with mouse and keyboard as above, but you can also manage game device (joysticks, joypads ...)

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::getLowLevelInputDeviceManager().

virtual uint NL3D::IDriver::getMaxLight  )  const [pure virtual]
 

return the number of light supported by driver. typically 8.

See also:
enableLight() setLight()

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CRenderTrav::resetLightSetup().

virtual uint NL3D::IDriver::getMaxVerticesByVertexBufferHard  )  const [pure virtual]
 

return How many vertices VertexBufferHard support

Implemented in NL3D::CDriverGL.

virtual bool NL3D::IDriver::getModes std::vector< GfxMode > &  modes  )  [pure virtual]
 

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::getModes().

virtual sint NL3D::IDriver::getNbTextureStages  )  const [pure virtual]
 

Get the number of texture stage avaliable, for multitexturing (Normal material shaders). Valid only after setDisplay().

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::getNbTextureStages().

TPolygonMode NL3D::IDriver::getPolygonMode  )  [inline]
 

Get the global polygon mode.

Parameters:
polygon mode choose in this driver.
See also:
setPolygonMode(), TPolygonMode

Definition at line 817 of file driver.h.

References _PolygonMode, and TPolygonMode.

Referenced by NL3D::CDriverUser::getPolygonMode().

00818         {
00819                 return _PolygonMode;
00820         }

const sint& NLMISC::CRefCount::getRefCount  )  const [inline, inherited]
 

Definition at line 70 of file smart_ptr.h.

References NLMISC::CRefCount::crefs, and sint.

00071         {
00072                 return  crefs;
00073         }

virtual uint NL3D::IDriver::getSwapVBLInterval  )  [pure virtual]
 

get the number of VBL wait when a swapBuffers() is issued. 0 means no synchronisation to the VBL

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::getSwapVBLInterval().

virtual uint NL3D::IDriver::getTextureHandle const ITexture tex  )  [pure virtual]
 

Advanced usage. Get the texture Handle. Usefull for texture sorting for instance NB: if the texture is not setuped in the driver, 0 is returned. NB: if implementation does not support it, 0 may be returned. OpenGL ones return the Texture ID. NB: unlike isTextureExist(), this method is not thread safe.

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CMeshMRMSkinnedGeom::renderSkinGroupPrimitives(), and NL3D::CMeshMRMGeom::renderSkinGroupPrimitives().

void NL3D::IDriver::getTextureShareName const ITexture tex,
std::string &  output
[static]
 

Get the driver share texture name

Definition at line 277 of file driver.cpp.

References NL3D::ITexture::getShareName(), NL3D::ITexture::getUploadFormat(), NL3D::ITexture::mipMapOn(), NLMISC::smprintf(), NLMISC::strlwr(), and uint32.

Referenced by invalidateShareTexture(), NL3D::CDriverGL::isTextureExist(), and NL3D::CDriverGL::setupTextureEx().

00278 {
00279         // Create the shared Name.
00280         output= strlwr(tex.getShareName());
00281 
00282         // append format Id of the texture.
00283         static char     fmt[256];
00284         smprintf(fmt, 256, "@Fmt:%d", (uint32)tex.getUploadFormat());
00285         output+= fmt;
00286 
00287         // append mipmap info
00288         if(tex.mipMapOn())
00289                 output+= "@MMp:On";
00290         else
00291                 output+= "@MMp:Off";
00292 }

virtual uint32 NL3D::IDriver::getUsedTextureMemory  )  const [pure virtual]
 

Return the amount of texture video memory used since last swapBuffers() call. Before use this method, you should enable the sum with enableUsedTextureMemorySum().

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::getUsedTextureMemory().

virtual const char* NL3D::IDriver::getVideocardInformation  )  [pure virtual]
 

Get videocard informations. get the official name of the driver

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::getVideocardInformation().

virtual CMatrix NL3D::IDriver::getViewMatrix void   )  const [pure virtual]
 

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CInstanceGroup::displayDebugClusters(), and NL3D::CPSUtil::print().

virtual void NL3D::IDriver::getViewport CViewport viewport  )  [pure virtual]
 

Get the current viewport

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CShadowMapManager::renderGenerate(), and NL3D::CFlareModel::traverseRender().

virtual void NL3D::IDriver::getWindowPos uint32 x,
uint32 y
[pure virtual]
 

Get the position of the window always (0,0) in fullscreen.

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::getWindowPos().

virtual emptyProc NL3D::IDriver::getWindowProc  )  [pure virtual]
 

Implemented in NL3D::CDriverGL.

virtual void NL3D::IDriver::getWindowSize uint32 width,
uint32 height
[pure virtual]
 

Get the width and the height of the window.

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CFontManager::computeString(), NL3D::CFontManager::computeStringInfo(), NL3D::CRenderStringBuffer::flush(), NL3D::CCloud::genBill(), NL3D::CDriverUser::getWindowHeight(), NL3D::CDriverUser::getWindowSize(), NL3D::CDriverUser::getWindowWidth(), NL3D::CMotionBlur::performMotionBlur(), NL3D::CComputedString::render2D(), NL3D::CComputedString::render2DClip(), NL3D::CComputedString::render2DUnProjected(), NL3D::CComputedString::render3D(), NL3D::CShadowMapManager::renderGenerate(), NL3D::CCloud::setMode2D(), and NL3D::CFlareModel::traverseRender().

virtual void NL3D::IDriver::getZBuffer std::vector< float > &  zbuffer  )  [pure virtual]
 

get the ZBuffer (back buffer).

Parameters:
zbuffer the returned array of Z. size of getWindowSize() .

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::getZBuffer().

virtual void NL3D::IDriver::getZBufferPart std::vector< float > &  zbuffer,
NLMISC::CRect rect
[pure virtual]
 

get a part of the ZBuffer (back buffer). NB: 0,0 is the bottom left corner of the screen.

Parameters:
zbuffer the returned array of Z. size of rec.Width*rec.Height.
rect the in/out (wanted/clipped) part of ZBuffer to retrieve.

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::getZBufferPart(), and NL3D::CFlareModel::traverseRender().

virtual bool NL3D::IDriver::init uint  windowIcon = 0  )  [pure virtual]
 

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::CDriverUser().

virtual bool NL3D::IDriver::initVertexArrayRange uint  agpMem,
uint  vramMem = 0
[pure virtual]
 

Allocate the initial VertexArray Memory. (no-op if !supportVertexBufferHard()). VertexArrayRange is first reseted, so any VBhard created before will be deleted. NB: call it after setDisplay(). But setDisplay() by default call initVertexArrayRange(16Mo, 0); so this is not necessary. NB: If allocation fails, mem/=2, and retry, until mem < 500K.

Parameters:
agpMem ammount of AGP Memory required. if 0, reseted.
vramMem ammount of VRAM Memory required. if 0, reseted.
Returns:
false if one the Buffer has not been allocated (at least at 500K).

Implemented in NL3D::CDriverGL.

bool NL3D::IDriver::invalidateShareTexture ITexture  ) 
 

Invalidate shared texture

Definition at line 243 of file driver.cpp.

References _SyncTexDrvInfos, _TexDrvShares, and getTextureShareName().

00244 {
00245         // Create the shared Name.
00246         std::string     name;
00247         getTextureShareName (texture, name);
00248 
00249         // Look for the driver info for this share name
00250         CSynchronized<TTexDrvInfoPtrMap>::CAccessor access(&_SyncTexDrvInfos);
00251         TTexDrvInfoPtrMap &rTexDrvInfos = access.value();
00252         TTexDrvInfoPtrMap::iterator iteDrvInfo = rTexDrvInfos.find (name);
00253         if (iteDrvInfo != rTexDrvInfos.end())
00254         {
00255                 // Now parse all shared info
00256                 TTexDrvSharePtrList::iterator shareIte = _TexDrvShares.begin ();
00257                 while (shareIte != _TexDrvShares.end ())
00258                 {
00259                         // Good one ?
00260                         if ((*shareIte)->DrvTexture == iteDrvInfo->second)
00261                         {
00262                                 // Remove this one
00263                                 TTexDrvSharePtrList::iterator toRemove = shareIte;
00264                                 shareIte++;
00265                                 delete (*toRemove);
00266                         }
00267                         else 
00268                                 shareIte++;
00269                 }
00270 
00271                 // Ok
00272                 return true;
00273         }
00274         return false;
00275 }

virtual bool NL3D::IDriver::isActive  )  [pure virtual]
 

Return true if driver is still active. Return false else. If he user close the window, must return false.

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::isActive().

virtual bool NL3D::IDriver::isEMBMSupportedAtStage uint  stage  )  const [pure virtual]
 

Implemented in NL3D::CDriverGL.

virtual bool NL3D::IDriver::isForceNormalize  )  const [pure virtual]
 

return the forceNormalize() state.

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CMeshVPWindTree::begin(), NL3D::CMeshVPWindTree::beginMBRInstance(), NL3D::CMeshMRMGeom::beginMesh(), NL3D::CMeshVPPerPixelLight::enable(), NL3D::CMeshMRMSkinnedGeom::render(), NL3D::CMeshMRMGeom::render(), and NL3D::CSkeletonModel::renderSkins().

virtual bool NL3D::IDriver::isPolygonSmoothingEnabled  )  const [pure virtual]
 

see enablePolygonSmoothing()

Implemented in NL3D::CDriverGL.

virtual bool NL3D::IDriver::isTextureAddrModeSupported CMaterial::TTexAddressingMode  mode  )  const [pure virtual]
 

test wether a texture addressing mode is supported

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CPSMultiTexturedParticle::enumTexs(), and NL3D::CPSMultiTexturedParticle::setupMaterial().

virtual bool NL3D::IDriver::isTextureExist const ITexture tex  )  [pure virtual]
 

is the texture is set up in the driver NB: this method is thread safe.

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CShapeBank::processWaitingShapes(), and NL3D::CAsyncFileManager3D::CMeshLoad::run().

virtual bool NL3D::IDriver::isVertexProgramEmulated  )  const [pure virtual]
 

Does the driver supports vertex program, but emulated by CPU ?

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CMeshVPWindTree::begin(), NL3D::CMeshVPPerPixelLight::begin(), and NL3D::CMeshVPWindTree::isMBRVpOk().

virtual bool NL3D::IDriver::isVertexProgramSupported  )  const [pure virtual]
 

Does the driver supports vertex programs ?

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CMeshVPWindTree::begin(), NL3D::CMeshVPPerPixelLight::begin(), and NL3D::CMeshVPWindTree::isMBRVpOk().

virtual bool NL3D::IDriver::isWaterShaderSupported  )  const [pure virtual]
 

test wether a texture addressing mode is supported

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CWaterModel::clip(), and NL3D::CWaterModel::traverseRender().

virtual void NL3D::IDriver::mapTextureStageToUV uint  stage,
uint  uv
[pure virtual]
 

Say what Texture Stage use what UV coord. by default activeVertexBuffer*() methods map all stage i to UV i. You can change this behavior, after calling activeVertexBuffer*(), by using this method.

eg: mapTextureStageToUV(0,2) will force the 0th texture stage to use the 2th UV.

Warning! This DOESN'T work with VertexProgram enabled!! (assert)

Warning!: some CMaterial Shader may change automatically this behavior too when setupMaterial() (and so render*()) is called. But Normal shader doesn't do it.

Implemented in NL3D::CDriverGL.

virtual void NL3D::IDriver::multiplyModelMatrix const CMatrix mtx  )  [pure virtual]
 

multipliy the model matrix. NB: you must use multiplyModelMatrix() AFTER setupModelMatrix() (and so setupViewMatrix()) or an other multiplyModelMatrix(), or else undefined results.

Using of multiplyModelMatrix() instead of just one setupModelMatrix() may be usefull for precision consideration.

Implemented in NL3D::CDriverGL.

virtual uint32 NL3D::IDriver::profileAllocatedTextureMemory  )  [pure virtual]
 

Return the amount of Texture memory requested. taking mipmap, compression, texture format, etc... into account. NB: because of GeForce*, RGB888 is considered to be 32 bits. So it may be false for others cards :).

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::profileAllocatedTextureMemory().

virtual void NL3D::IDriver::profileRenderedPrimitives CPrimitiveProfile pIn,
CPrimitiveProfile pOut
[pure virtual]
 

Get the number of primitives rendered from the last swapBuffers() call.

Parameters:
pIn the number of requested rendered primitive.
pOut the number of effective rendered primitive. pOut==pIn if no multi-pass material is used (Lightmap, Specular ...).

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::profileRenderedPrimitives(), NL3D::CVegetableManager::render(), and NL3D::CVegetableBlendLayerModel::render().

virtual uint32 NL3D::IDriver::profileSetupedMaterials  )  const [pure virtual]
 

Get the number of material setuped from the last swapBuffers() call.

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::profileSetupedMaterials(), and NL3D::CLandscape::render().

virtual uint32 NL3D::IDriver::profileSetupedModelMatrix  )  const [pure virtual]
 

Get the number of matrix setuped from the last swapBuffers() call.

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::profileSetupedModelMatrix().

virtual void NL3D::IDriver::profileVBHardAllocation std::vector< std::string > &  result  )  [pure virtual]
 

display VBhards allocated

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::profileVBHardAllocation().

bool NL3D::IDriver::release void   )  [virtual]
 

Deriver should calls IDriver::release() first, to destroy all driver components (textures, shaders, VBuffers).

Reimplemented in NL3D::CDriverGL.

Definition at line 73 of file driver.cpp.

References _Shaders, _SyncTexDrvInfos, _TexDrvShares, _VBDrvInfos, _VtxPrgDrvInfos, NL3D::ItShaderPtrList, NL3D::ItTexDrvSharePtrList, NL3D::ItVBDrvInfoPtrList, NL3D::ItVtxPrgDrvInfoPtrList, and nlassert.

Referenced by NL3D::CDriverUser::release().

00074 {
00075         // Called by derived classes.
00076 
00077         // DO THIS FIRST => to auto kill real textures (by smartptr).
00078         // First, Because must not kill a pointer owned by a CSmartPtr.
00079         // Release Textures drv.
00080         ItTexDrvSharePtrList            ittex;
00081         while( (ittex = _TexDrvShares.begin()) !=_TexDrvShares.end() )
00082         {
00083                 // NB: at CTextureDrvShare deletion, this->_TexDrvShares is updated (entry deleted);
00084                 delete *ittex;
00085         }
00086 
00087 
00088         // Release refptr of TextureDrvInfos. Should be all null (because of precedent pass).
00089         {
00090                 CSynchronized<TTexDrvInfoPtrMap>::CAccessor access(&_SyncTexDrvInfos);
00091                 TTexDrvInfoPtrMap &rTexDrvInfos = access.value();
00092 
00093                 // must be empty, because precedent pass should have deleted all.
00094                 nlassert(rTexDrvInfos.empty());
00095         }
00096 
00097         // Release Shader drv.
00098         ItShaderPtrList         itshd;
00099         while( (itshd = _Shaders.begin()) != _Shaders.end() )
00100         {
00101                 // NB: at IShader deletion, this->_Shaders is updated (entry deleted);
00102                 delete *itshd;
00103         }
00104 
00105         // Release VBs drv.
00106         ItVBDrvInfoPtrList              itvb;
00107         while( (itvb = _VBDrvInfos.begin()) != _VBDrvInfos.end() )
00108         {
00109                 // NB: at IVBDrvInfo deletion, this->_VBDrvInfos is updated (entry deleted);
00110                 delete *itvb;
00111         }
00112 
00113         // Release VtxPrg drv.
00114         ItVtxPrgDrvInfoPtrList          itVtxPrg;
00115         while( (itVtxPrg = _VtxPrgDrvInfos.begin()) != _VtxPrgDrvInfos.end() )
00116         {
00117                 // NB: at IVertexProgramDrvInfos deletion, this->_VtxPrgDrvInfos is updated (entry deleted);
00118                 delete *itVtxPrg;
00119         }
00120 
00121         return true;
00122 }

void NL3D::IDriver::removeShaderPtr ItShaderPtrList  shaderIt  )  [protected]
 

Definition at line 232 of file driver.cpp.

References _Shaders, and NL3D::ItShaderPtrList.

Referenced by NL3D::IShader::~IShader().

00233 {
00234         _Shaders.erase(shaderIt);
00235 }

void NL3D::IDriver::removeTextureDrvInfoPtr ItTexDrvInfoPtrMap  texDrvInfoIt  )  [protected]
 

Definition at line 219 of file driver.cpp.

References _SyncTexDrvInfos, and NL3D::ItTexDrvInfoPtrMap.

Referenced by NL3D::ITextureDrvInfos::~ITextureDrvInfos().

00220 {
00221         CSynchronized<TTexDrvInfoPtrMap>::CAccessor access(&_SyncTexDrvInfos);
00222         TTexDrvInfoPtrMap &rTexDrvInfos = access.value();
00223 
00224         rTexDrvInfos.erase(texDrvInfoIt);
00225 }

void NL3D::IDriver::removeTextureDrvSharePtr ItTexDrvSharePtrList  texDrvShareIt  )  [protected]
 

Definition at line 227 of file driver.cpp.

References _TexDrvShares, and NL3D::ItTexDrvSharePtrList.

Referenced by NL3D::CTextureDrvShare::~CTextureDrvShare().

00228 {
00229         _TexDrvShares.erase(texDrvShareIt);
00230 }

void NL3D::IDriver::removeVBDrvInfoPtr ItVBDrvInfoPtrList  vbDrvInfoIt  )  [protected]
 

remove ptr from the lists in the driver.

Definition at line 214 of file driver.cpp.

References _VBDrvInfos, and NL3D::ItVBDrvInfoPtrList.

Referenced by NL3D::IVBDrvInfos::~IVBDrvInfos().

00215 {
00216         _VBDrvInfos.erase(vbDrvInfoIt);
00217 }

void NL3D::IDriver::removeVtxPrgDrvInfoPtr ItVtxPrgDrvInfoPtrList  vtxPrgDrvInfoIt  )  [protected]
 

Definition at line 237 of file driver.cpp.

References _VtxPrgDrvInfos, and NL3D::ItVtxPrgDrvInfoPtrList.

Referenced by NL3D::IVertexProgramDrvInfos::~IVertexProgramDrvInfos().

00238 {
00239         _VtxPrgDrvInfos.erase(vtxPrgDrvInfoIt);
00240 }

virtual bool NL3D::IDriver::render CPrimitiveBlock PB,
CMaterial Mat
[pure virtual]
 

render a block of primitive with previously setuped VertexBuffer / Matrixes.

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CPSUtil::displayBBox(), NL3D::CInstanceGroup::displayDebugClusters(), NL3D::CPSTailDot::displayRibbons(), NL3D::CPSRibbonLookAt::displayRibbons(), NL3D::CPSRibbon::displayRibbons(), NL3D::CPSConstraintMesh::doRenderPasses(), NL3D::CDRU::drawBitmap(), NL3D::CDRU::drawLine(), NL3D::CDriverUser::drawLine(), NL3D::CDRU::drawLinesUnlit(), NL3D::CDRU::drawQuad(), NL3D::CDriverUser::drawQuad(), NL3D::CPSShockWaveHelper::drawShockWave(), NL3D::CDRU::drawTriangle(), NL3D::CDriverUser::drawTriangle(), NL3D::CDRU::drawTrianglesUnlit(), NL3D::CSegRemanence::render(), NL3D::CMeshMRMSkinnedGeom::render(), NL3D::CMeshMRMGeom::render(), NL3D::CMeshGeom::render(), NL3D::CMeshInstance::renderIntoSkeletonShadowMap(), NL3D::CMeshMRMGeom::renderPass(), NL3D::CMeshGeom::renderPass(), NL3D::CMeshGeom::renderSimpleWithMaterial(), NL3D::CMeshMRMGeom::renderSkin(), NL3D::CMeshGeom::renderSkin(), and NL3D::CPSGravity::show().

virtual void NL3D::IDriver::renderOrientedQuads CMaterial Mat,
uint32  startIndex,
uint32  numQuads
[pure virtual]
 

Render quads with previously setuped VertexBuffer / Matrixes. There's a garanty for the orientation of its diagonal, which is drawn as follow :

3----2 | / | | / | |/ | 0----1

The rendering may be slower than with 'renderQuads', however This orientation is not garanteed with renderQuads, and depends on the hardware

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CPSFaceLookAtHelper::drawLookAt().

virtual void NL3D::IDriver::renderPoints CMaterial Mat,
uint32  numPoints
[pure virtual]
 

render points with previously setuped VertexBuffer / Matrixes.

Implemented in NL3D::CDriverGL.

Referenced by NL3D::DrawDot().

virtual void NL3D::IDriver::renderQuads CMaterial Mat,
uint32  startIndex,
uint32  numQuads
[pure virtual]
 

render quads with previously setuped VertexBuffer / Matrixes. Quads are stored as a sequence in the vertex buffer.

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CShadowMapManager::applyFakeGaussianBlur(), NL3D::CCloud::disp(), NL3D::CCloud::dispBill(), NL3D::CCloud::dispXYZ(), NL3D::CDeform2d::doDeform(), NL3D::CPSFaceHelper::drawFaces(), NL3D::CPSFaceLookAtHelper::drawLookAt(), NL3D::CPSFaceLookAtHelper::drawLookAtAlignOnMotion(), NL3D::CDriverUser::drawQuads(), NL3D::CShadowMapManager::fillBlackBorder(), NL3D::CNoise3d::flush(), NL3D::CRenderStringBuffer::flush(), NL3D::CNoise3d::flush2passes(), NL3D::CRenderStringBuffer::flushUnProjected(), NL3D::CCloud::genBill(), NL3D::CCloud::generate(), NL3D::CCloud::light(), NL3D::CMotionBlur::performMotionBlur(), NL3D::CComputedString::render2D(), NL3D::CComputedString::render3D(), NL3D::CCloud::reset(), and NL3D::CFlareModel::traverseRender().

virtual void NL3D::IDriver::renderSimpleTriangles uint32 tri,
uint32  ntris
[pure virtual]
 

render a list of triangles with previously setuped VertexBuffer / Matrixes, AND previously setuped MATERIAL!! This use the last material setuped. It should be a "Normal shader" material, because no multi-pass is allowed with this method. Actually, it is like a straight drawTriangles() in OpenGL. NB: nlassert() if ntris is 0!!!! this is unlike other render() call methods. For optimisation concern. NB: this is usefull for landscape....

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CWaterModel::doSimpleRender(), NL3D::DrawPoly2D(), NL3D::CVegetableManager::render(), NL3D::CVegetableBlendLayerModel::render(), and NL3D::CWaterModel::traverseRender().

virtual void NL3D::IDriver::renderTriangles CMaterial Mat,
uint32 tri,
uint32  ntris
[pure virtual]
 

render a list of triangles with previously setuped VertexBuffer / Matrixes. NB: this "was" usefull for landscape....

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CPSUtil::displayArrow(), NL3D::CPSFanLightHelper::drawFanLight(), NL3D::CLodCharacterManager::endRender(), NL3D::CCoarseMeshManager::flushRender(), NL3D::CMeshInstance::generateShadowMap(), NL3D::CShadowPolyReceiver::render(), NL3D::CMeshMRMSkinnedGeom::renderShadowSkinPrimitives(), NL3D::CMeshMRMGeom::renderShadowSkinPrimitives(), NL3D::CMeshMRMSkinnedGeom::renderSkinGroupPrimitives(), NL3D::CMeshMRMGeom::renderSkinGroupPrimitives(), NL3D::CMeshMRMSkinnedGeom::renderSkinGroupSpecularRdrPass(), and NL3D::CMeshMRMGeom::renderSkinGroupSpecularRdrPass().

virtual void NL3D::IDriver::setAmbientColor CRGBA  color  )  [pure virtual]
 

Set ambiant.

Parameters:
color is the new global ambiant color for the scene.
See also:
setLight(), enableLight()

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CRenderTrav::resetLightSetup(), and NL3D::CDriverUser::setAmbientColor().

virtual void NL3D::IDriver::setBlendConstantColor NLMISC::CRGBA  col  )  [pure virtual]
 

see supportBlendConstantColor(). Set the current Blend Constant Color.

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CMeshBlender::prepareRenderForGlobalAlpha(), and NL3D::CMeshBlender::prepareRenderForGlobalAlphaCoarseMesh().

virtual void NL3D::IDriver::setCapture bool  b  )  [pure virtual]
 

If true, capture the mouse to force it to stay under the window. NB : this has no effects if a low level mouse is used

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::setCapture().

virtual void NL3D::IDriver::setColorMask bool  bRed,
bool  bGreen,
bool  bBlue,
bool  bAlpha
[pure virtual]
 

Set the color mask filter through where the operation done will pass.

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CCloud::light(), and NL3D::CShadowMapManager::renderGenerate().

virtual void NL3D::IDriver::setConstant uint  index,
uint  num,
const double *  src
[pure virtual]
 

setup several 4 double csts taken from the given tab

Implemented in NL3D::CDriverGL.

virtual void NL3D::IDriver::setConstant uint  index,
uint  num,
const float *  src
[pure virtual]
 

setup several 4 float csts taken from the given tab

Implemented in NL3D::CDriverGL.

virtual void NL3D::IDriver::setConstant uint  index,
const NLMISC::CVectorD value
[pure virtual]
 

Implemented in NL3D::CDriverGL.

virtual void NL3D::IDriver::setConstant uint  index,
const NLMISC::CVector value
[pure virtual]
 

Implemented in NL3D::CDriverGL.

virtual void NL3D::IDriver::setConstant uint  index,
double  ,
double  ,
double  ,
double 
[pure virtual]
 

Implemented in NL3D::CDriverGL.

virtual void NL3D::IDriver::setConstant uint  index,
float  ,
float  ,
float  ,
float 
[pure virtual]
 

Setup constant values.

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CMeshVPPerPixelLight::begin(), NL3D::CRenderTrav::beginVPLightSetup(), NL3D::CRenderTrav::changeVPLightSetupMaterial(), NL3D::CLandscape::render(), NL3D::CWaterModel::setupMaterialNVertexShader(), NL3D::CMeshVPWindTree::setupPerInstanceConstants(), NL3D::CMeshVPWindTree::setupPerMesh(), and NL3D::CVegetableManager::setupVertexProgramConstants().

virtual void NL3D::IDriver::setConstantMatrix uint  index,
TMatrix  matrix,
TTransform  transform
[pure virtual]
 

Setup constants with a current matrix.

This call must be done after setFrustum(), setupViewMatrix() or setupModelMatrix() to get correct results.

Parameters:
index is the base constant index where to store the matrix. This index must be a multiple of 4.
matrix is the matrix id to store in the constants
transform is the transformation to apply to the matrix before store it in the constants.

Referenced by NL3D::CMeshVPPerPixelLight::begin(), NL3D::CLandscape::render(), NL3D::CWaterModel::setupMaterialNVertexShader(), NL3D::CMeshVPWindTree::setupPerInstanceConstants(), and NL3D::CVegetableManager::setupVertexProgramConstants().

virtual bool NL3D::IDriver::setDisplay void *  wnd,
const GfxMode mode,
bool  show = true
throw (EBadDisplay) [pure virtual]
 

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::setDisplay().

virtual void NL3D::IDriver::setEMBMMatrix const uint  stage,
const float  mat[4]
[pure virtual]
 

Implemented in NL3D::CDriverGL.

virtual void NL3D::IDriver::setFrustum float  left,
float  right,
float  bottom,
float  top,
float  znear,
float  zfar,
bool  perspective = true
[pure virtual]
 

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CCloud::disp(), NL3D::CDeform2d::doDeform(), NL3D::CDRU::drawBitmap(), NL3D::CDRU::drawLine(), NL3D::CDRU::drawQuad(), NL3D::CDRU::drawTriangle(), NL3D::CRenderStringBuffer::flush(), NL3D::CCloud::genBill(), NL3D::CSkeletonModel::generateShadowMap(), NL3D::CMeshInstance::generateShadowMap(), NL3D::CMotionBlur::performMotionBlur(), NL3D::CCloudScape::render(), NL3D::CComputedString::render2D(), NL3D::CShadowMapManager::renderGenerate(), NL3D::CDriverUser::restoreMatrixContextMatrixOnly(), NL3D::CCloud::setMode2D(), NL3D::CRenderTrav::setupDriverCamera(), and NL3D::CDriverUser::setupMatrixContext().

virtual void NL3D::IDriver::setLight uint8  num,
const CLight light
[pure virtual]
 

Setup a light.

You must call enableLight() to active the ligth.

Parameters:
num is the number of the light to set.
light is a light to set in this slot.
See also:
enableLight()

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CRenderTrav::changeLightSetup(), NL3D::CRenderTrav::resetLightSetup(), and NL3D::CDriverUser::setLight().

virtual void NL3D::IDriver::setMatrix2DForTextureOffsetAddrMode const uint  stage,
const float  mat[4]
[pure virtual]
 

setup the 2D matrix for the OffsetTexture, OffsetTextureScale and OffsetTexture addressing mode It should be stored as the following [a0 a1] [a2 a3]

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CPSMultiTexturedParticle::setupMaterial().

virtual bool NL3D::IDriver::setMode const GfxMode mode  )  [pure virtual]
 

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::setMode().

virtual bool NL3D::IDriver::setMonitorColorProperties const CMonitorColorProperties properties  )  [pure virtual]
 

Setup monitor color properties.

Return false if setup failed.

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::setMonitorColorProperties().

virtual void NL3D::IDriver::setMousePos float  x,
float  y
[pure virtual]
 

x and y must be between 0.0 and 1.0

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::setMousePos().

virtual void NL3D::IDriver::setPerPixelLightingLight CRGBA  diffuse,
CRGBA  specular,
float  shininess
[pure virtual]
 

Setup the light used for per pixel lighting. The given values should have been modulated by the material diffuse and specular. This is only useful for material that have their shader set as 'PerPixelLighting'

Parameters:
the light used for per pixel lighting

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CMeshVPPerPixelLight::setupForMaterial().

virtual void NL3D::IDriver::setPolygonMode TPolygonMode  mode  )  [inline, virtual]
 

Set the global polygon mode. Can be filled, line or point. The implementation driver must call IDriver::setPolygonMode and active this mode.

Parameters:
polygon mode choose in this driver.
See also:
getPolygonMode(), TPolygonMode

Reimplemented in NL3D::CDriverGL.

Definition at line 763 of file driver.h.

References _PolygonMode.

Referenced by NL3D::CCloud::dispBill(), and NL3D::CDriverUser::setPolygonMode().

00764         {
00765                 _PolygonMode=mode;
00766         }

virtual void NL3D::IDriver::setSwapVBLInterval uint  interval  )  [pure virtual]
 

set the number of VBL wait when a swapBuffers() is issued. 0 means no synchronisation to the VBL Default depends of the 3D driver setup. Values >1 may be clamped to 1 by the driver.

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::setSwapVBLInterval().

virtual void NL3D::IDriver::setupFog float  start,
float  end,
CRGBA  color
[pure virtual]
 

setup fog parameters. fog must enabled to see result. start and end are in [0,1] range.

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CShadowMapManager::renderProject(), and NL3D::CDriverUser::setupFog().

virtual bool NL3D::IDriver::setupMaterial CMaterial mat  )  [pure virtual]
 

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CWaterModel::doSimpleRender(), NL3D::CVegetableManager::render(), NL3D::CVegetableManager::setupRenderStateForBlendLayerModel(), and NL3D::CWaterModel::traverseRender().

virtual void NL3D::IDriver::setupMaterialPass uint  pass  )  [pure virtual]
 

active the ith pass of this material.

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CWaterModel::traverseRender().

virtual void NL3D::IDriver::setupModelMatrix const CMatrix mtx  )  [pure virtual]
 

setup the model matrix.

NB: you must setupModelMatrix() AFTER setupViewMatrix(), or else undefined results.

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CMeshMRMGeom::activeInstance(), NL3D::CMeshGeom::activeInstance(), NL3D::CLandscapeModel::clipAndRenderLandscape(), NL3D::CCloud::disp(), NL3D::CPSUtil::displayBasis(), NL3D::CInstanceGroup::displayDebugClusters(), NL3D::CDeform2d::doDeform(), NL3D::CWaterModel::doSimpleRender(), NL3D::CDRU::drawBitmap(), NL3D::CDRU::drawLine(), NL3D::CDRU::drawQuad(), NL3D::CDRU::drawTriangle(), NL3D::CLodCharacterManager::endRender(), NL3D::CRenderStringBuffer::flush(), NL3D::CCoarseMeshManager::flushRender(), NL3D::CCloud::genBill(), NL3D::CMeshInstance::generateShadowMap(), NL3D::CMotionBlur::performMotionBlur(), NL3D::CLandscapeModel::receiveShadowMap(), NL3D::CVegetableManager::render(), NL3D::CSegRemanence::render(), NL3D::CMeshMRMSkinnedGeom::render(), NL3D::CMeshMRMGeom::render(), NL3D::CMeshGeom::render(), NL3D::CCloudScape::render(), NL3D::CComputedString::render2D(), NL3D::CComputedString::render3D(), NL3D::CShadowMapManager::renderGenerate(), NL3D::CSkeletonModel::renderIntoSkeletonShadowMap(), NL3D::CMeshInstance::renderIntoSkeletonShadowMap(), NL3D::CMeshGeom::renderSimpleWithMaterial(), NL3D::CSkeletonModel::renderSkins(), NL3D::CDriverUser::restoreMatrixContextMatrixOnly(), NL3D::CCloud::setMode2D(), NL3D::CPSLocated::setupDriverModelMatrix(), NL3D::CDriverUser::setupMatrixContext(), NL3D::CVegetableManager::setupRenderStateForBlendLayerModel(), NL3D::CPSLight::show(), NL3D::CPSGravity::show(), NL3D::CParticleSystem::step(), NL3D::CWaterModel::traverseRender(), and NL3D::CFlareModel::traverseRender().

virtual void NL3D::IDriver::setupScissor const class CScissor scissor  )  [pure virtual]
 

Set the current Scissor.

Parameters:
scissor is a scissor to setup the current Scissor, in Window relative coordinate (0,1).

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CCloud::disp(), NL3D::CCloudScape::render(), NL3D::CShadowMapManager::renderGenerate(), NL3D::CCloud::setMode2D(), and NL3D::CDriverUser::setupMatrixContext().

virtual bool NL3D::IDriver::setupTexture ITexture tex  )  [pure virtual]
 

setup a texture, generate and upload if needed. same as setupTextureEx(tex, true, dummy);

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CParticleSystemShape::flushTextures(), NL3D::CMaterial::flushTextures(), NL3D::CFlareShape::flushTextures(), NL3D::CLandscape::flushTiles(), NL3D::CParticleSystemShape::instanciatePS(), and NL3D::CWaterPoolManager::setBlendFactor().

virtual bool NL3D::IDriver::setupTextureEx ITexture tex,
bool  bUpload,
bool &  bAllUploaded,
bool  bMustRecreateSharedTexture = false
[pure virtual]
 

setup a texture in the driver.

Parameters:
bUpload if true the texture is created and uploaded to VRAM, if false the texture is only created it is useful for the async upload texture to only create the texture and then make invalidate to upload small piece each frame. There is ONE case where bUpload is forced to be true inside the method: if the texture must be converted to RGBA.
See also:
bAllUploaded
Parameters:
bAllUploaded true if any upload arise (texture invalid, must convert texture etc...).
bMustRecreateSharedTexture if true and if the texture supportSharing, then the texture is recreated (and uploaded if bUpload==true) into the shared DrvInfo (if found). Default setup (false) imply that the DrvInfo is only bound to tex (thus creating and uploading nothing) NB: the texture must be at least touch()-ed for the recreate to work.

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CShapeBank::processWSUploadTexture(), and NL3D::CAsyncTextureManager::uploadTexturePart().

virtual void NL3D::IDriver::setupViewMatrix const CMatrix mtx  )  [pure virtual]
 

setup the view matrix (inverse of camera matrix).

NB: you must setupViewMatrix() BEFORE setupModelMatrix(), or else undefined results.

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CCloud::disp(), NL3D::CDeform2d::doDeform(), NL3D::CDRU::drawBitmap(), NL3D::CDRU::drawLine(), NL3D::CDRU::drawQuad(), NL3D::CDRU::drawTriangle(), NL3D::CRenderStringBuffer::flush(), NL3D::CCloud::genBill(), NL3D::CSkeletonModel::generateShadowMap(), NL3D::CMeshInstance::generateShadowMap(), NL3D::CMotionBlur::performMotionBlur(), NL3D::CCloudScape::render(), NL3D::CComputedString::render2D(), NL3D::CShadowMapManager::renderGenerate(), NL3D::CDriverUser::restoreMatrixContextMatrixOnly(), NL3D::CCloud::setMode2D(), and NL3D::CDriverUser::setupMatrixContext().

virtual void NL3D::IDriver::setupViewMatrixEx const CMatrix mtx,
const CVector cameraPos
[pure virtual]
 

setup the view matrix (inverse of camera matrix). Extended: give a cameraPos (mtx.Pos() is not taken into account but for getViewMatrix()), so the driver use it to remove translation from all ModelMatrixes (and lights pos). This approach improves greatly ZBuffer precision.

This is transparent to user, and getViewMatrix() return mtx (as in setupViewMatrix()).

NB: you must setupViewMatrixEx() BEFORE setupModelMatrix(), or else undefined results.

Parameters:
mtx the same view matrix (still with correct "inversed" camera position) as if passed in setupViewMatrix()
cameraPos position of the camera (before inversion, ie mtx.getPos()!=cameraPos ).

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CRenderTrav::setupDriverCamera().

virtual void NL3D::IDriver::setupViewport const class CViewport viewport  )  [pure virtual]
 

Set the current viewport

Parameters:
viewport is a viewport to setup as current viewport.

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CCloud::disp(), NL3D::CDRU::drawBitmap(), NL3D::CDRU::drawLine(), NL3D::CDRU::drawQuad(), NL3D::CDRU::drawTriangle(), NL3D::CCloud::genBill(), NL3D::CCloudScape::render(), NL3D::CShadowMapManager::renderGenerate(), NL3D::CCloud::setMode2D(), NL3D::CDriverUser::setupMatrixContext(), and NL3D::CRenderTrav::traverse().

virtual void NL3D::IDriver::showCursor bool  b  )  [pure virtual]
 

show cursor if b is true, or hide it if b is false

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::showCursor().

virtual bool NL3D::IDriver::slowUnlockVertexBufferHard  )  const [pure virtual]
 

return true if driver support VertexBufferHard, but vbHard->unlock() are slow (ATI-openGL).

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CMeshMRMGeom::updateVertexBufferHard(), and NL3D::CMeshGeom::updateVertexBufferHard().

virtual void NL3D::IDriver::startProfileVBHardLock  )  [pure virtual]
 

If the driver support it, enable profile VBHard locks. No-Op if already profiling

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::startProfileVBHardLock().

virtual void NL3D::IDriver::startSpecularBatch  )  [pure virtual]
 

Special for Faster Specular Setup. Call this between lot of primitives rendered with Specular Materials. Visual Errors may arise if you don't correclty call endSpecularBatch().

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CSkeletonModel::renderSkinList().

virtual bool NL3D::IDriver::supportBlendConstantColor  )  const [pure virtual]
 

Does the driver support Blend Constant Color ??? If yes CMaterial::blendConstant* enum can be used for blend Src ord Dst factor. If no, using these enum will have undefined results.

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CMeshBlender::prepareRenderForGlobalAlpha(), NL3D::CMeshBlender::prepareRenderForGlobalAlphaCoarseMesh(), NL3D::CMeshBlender::restoreRender(), and NL3D::CMeshBlender::restoreRenderCoarseMesh().

virtual bool NL3D::IDriver::supportCloudRenderSinglePass  )  const [pure virtual]
 

Implemented in NL3D::CDriverGL.

virtual bool NL3D::IDriver::supportEMBM  )  const [pure virtual]
 

Implemented in NL3D::CDriverGL.

virtual bool NL3D::IDriver::supportPerPixelLighting bool  specular  )  const [pure virtual]
 

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CMeshVPPerPixelLight::begin().

virtual bool NL3D::IDriver::supportTextureShaders  )  const [pure virtual]
 

test wether the device supports some form of texture shader. (could be limited to DX6 EMBM for example)

Implemented in NL3D::CDriverGL.

virtual bool NL3D::IDriver::supportVertexBufferHard  )  const [pure virtual]
 

return true if driver support VertexBufferHard.

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CMeshMRMGeom::updateVertexBufferHard(), and NL3D::CMeshGeom::updateVertexBufferHard().

virtual bool NL3D::IDriver::supportVertexProgramDoubleSidedColor  )  const [pure virtual]
 

Check if the driver support double sided colors vertex programs.

Implemented in NL3D::CDriverGL.

virtual bool NL3D::IDriver::swapBuffers void   )  [pure virtual]
 

Swap the back and front buffers.

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CDriverUser::swapBuffers().

virtual void NL3D::IDriver::swapTextureHandle ITexture tex0,
ITexture tex1
[pure virtual]
 

Special method to internally swap the Driver handle of 2 textures. USE IT WITH CARE (eg: may have Size problems, mipmap problems, format problems ...) Actually, it is used only by CAsyncTextureManager, to manage Lods of DXTC CTextureFile. NB: internally, all textures slots are disabled.

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CAsyncTextureManager::update(), and NL3D::CAsyncTextureManager::updateTextureLodSystem().

IDriver::TMessageBoxId NL3D::IDriver::systemMessageBox const char *  message,
const char *  title,
TMessageBoxType  type = okType,
TMessageBoxIcon  icon = noIcon
[virtual]
 

Output a system message box and print a message with an icon. This method can be call even if the driver is not initialized. This method is used to return internal driver problem when string can't be displayed in the driver window. If the driver can't open a messageBox, it should not override this method and let the IDriver class manage it with the ASCII console.

Parameters:
message This is the message to display in the message box.
title This is the title of the message box.
type This is the type of the message box, ie number of button and label of buttons.
icon This is the icon of the message box should use like warning, error etc...

Reimplemented in NL3D::CDriverGL.

Definition at line 137 of file driver.cpp.

References abortId, abortRetryIgnoreType, cancelId, iconCount, ignoreId, nlassert, noId, okCancelType, okId, okType, retryCancelType, retryId, type, typeCount, yesId, yesNoCancelType, and yesNoType.

Referenced by NL3D::CDriverUser::systemMessageBox().

00138 {
00139         static const char* icons[iconCount]=
00140         {
00141                 "",
00142                 "WAIT:\n",
00143                 "QUESTION:\n",
00144                 "HEY!\n",
00145                 "",
00146                 "WARNING!\n",
00147                 "ERROR!\n",
00148                 "INFORMATION:\n",
00149                 "STOP:\n"
00150         };
00151         static const char* messages[typeCount]=
00152         {
00153                 "Press any key...",
00154                 "(O)k or (C)ancel ?",
00155                 "(Y)es or (N)o ?",
00156                 "(A)bort (R)etry (I)gnore ?",
00157                 "(Y)es (N)o (C)ancel ?",
00158                 "(R)etry (C)ancel ?"
00159         };
00160         printf ("%s%s\n%s", icons[icon], title, message);
00161         while (1)
00162         {
00163                 printf ("\n%s", messages[type]);
00164                 int c=getchar();
00165                 if (type==okType)
00166                         return okId;
00167                 switch (c)
00168                 {
00169                 case 'O':
00170                 case 'o':
00171                         if ((type==okType)||(type==okCancelType))
00172                                 return okId;
00173                         break;
00174                 case 'C':
00175                 case 'c':
00176                         if ((type==yesNoCancelType)||(type==okCancelType)||(type==retryCancelType))
00177                                 return cancelId;
00178                         break;
00179                 case 'Y':
00180                 case 'y':
00181                         if ((type==yesNoCancelType)||(type==yesNoType))
00182                                 return yesId;
00183                         break;
00184                 case 'N':
00185                 case 'n':
00186                         if ((type==yesNoCancelType)||(type==yesNoType))
00187                                 return noId;
00188                         break;
00189                 case 'A':
00190                 case 'a':
00191                         if (type==abortRetryIgnoreType)
00192                                 return abortId;
00193                         break;
00194                 case 'R':
00195                 case 'r':
00196                         if (type==abortRetryIgnoreType)
00197                                 return retryId;
00198                         break;
00199                 case 'I':
00200                 case 'i':
00201                         if (type==abortRetryIgnoreType)
00202                                 return ignoreId;
00203                         break;
00204                 }
00205         }
00206         nlassert (0);           // no!
00207         return okId;
00208 }

virtual bool NL3D::IDriver::uploadTexture ITexture tex,
NLMISC::CRect rect,
uint8  nNumMipMap
[pure virtual]
 

The texture must be created or uploadTexture do nothing. These function can be used to upload piece by piece a texture. Use it in conjunction with setupTextureEx(..., false);

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CShapeBank::processWSUploadTexture(), and NL3D::CAsyncTextureManager::uploadTexturePart().

virtual bool NL3D::IDriver::uploadTextureCube ITexture tex,
NLMISC::CRect rect,
uint8  nNumMipMap,
uint8  nNumFace
[pure virtual]
 

Implemented in NL3D::CDriverGL.

Referenced by NL3D::CShapeBank::processWSUploadTexture().


Friends And Related Function Documentation

friend struct CPtrInfo [friend, inherited]
 

Definition at line 67 of file smart_ptr.h.

friend class CTextureDrvShare [friend]
 

Definition at line 993 of file driver.h.

Referenced by NL3D::CDriverGL::setupTextureEx().

friend class IShader [friend]
 

Definition at line 995 of file driver.h.

friend class ITextureDrvInfos [friend]
 

Definition at line 994 of file driver.h.

friend class IVBDrvInfos [friend]
 

Definition at line 992 of file driver.h.

friend class IVertexProgramDrvInfos [friend]
 

Definition at line 996 of file driver.h.


Field Documentation

TPolygonMode NL3D::IDriver::_PolygonMode [protected]
 

Definition at line 165 of file driver.h.

Referenced by getPolygonMode(), IDriver(), and setPolygonMode().

TShaderPtrList NL3D::IDriver::_Shaders [protected]
 

Definition at line 163 of file driver.h.

Referenced by release(), removeShaderPtr(), and ~IDriver().

CSynchronized<TTexDrvInfoPtrMap> NL3D::IDriver::_SyncTexDrvInfos [protected]
 

Definition at line 160 of file driver.h.

Referenced by invalidateShareTexture(), release(), removeTextureDrvInfoPtr(), and ~IDriver().

TTexDrvSharePtrList NL3D::IDriver::_TexDrvShares [protected]
 

Definition at line 162 of file driver.h.

Referenced by invalidateShareTexture(), release(), removeTextureDrvSharePtr(), and ~IDriver().

TVBDrvInfoPtrList NL3D::IDriver::_VBDrvInfos [protected]
 

Definition at line 164 of file driver.h.

Referenced by release(), removeVBDrvInfoPtr(), and ~IDriver().

TVtxPrgDrvInfoPtrList NL3D::IDriver::_VtxPrgDrvInfos [protected]
 

Definition at line 166 of file driver.h.

Referenced by release(), removeVtxPrgDrvInfoPtr(), and ~IDriver().

sint NLMISC::CRefCount::crefs [mutable, inherited]
 

Definition at line 79 of file smart_ptr.h.

Referenced by NLMISC::CRefCount::CRefCount(), NLMISC::CRefCount::getRefCount(), and NLMISC::CRefCount::~CRefCount().

const uint32 NL3D::IDriver::InterfaceVersion = 0x4e [static]
 

Version of the driver interface. To increment when the interface change.

Definition at line 46 of file driver.cpp.

CRefCount::CPtrInfo NLMISC::CRefCount::NullPtrInfo [static, inherited]
 

Referenced by NLMISC::CRefCount::CRefCount().

CPtrInfo* NLMISC::CRefCount::pinfo [mutable, inherited]
 

Definition at line 80 of file smart_ptr.h.

Referenced by NLMISC::CRefCount::CRefCount(), and NLMISC::CRefCount::~CRefCount().


The documentation for this class was generated from the following files:
Generated on Tue Mar 16 08:38:42 2004 for NeL by doxygen 1.3.6