|
|
|
|
Documentation |
|
Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages Search
NL3D::IDriver Class Reference#include <driver.h>
Inheritance diagram for NL3D::IDriver:
List of all members.
Vertex program interface |
enum | TMatrix { ModelView = 0,
Projection,
ModelViewProjection,
NumMatrix
} |
enum | TTransform {
Identity = 0,
Inverse,
Transpose,
InverseTranspose,
NumTransform
} |
virtual bool | isVertexProgramSupported () const=0 |
| Does the driver supports vertex programs ? More...
|
virtual bool | isVertexProgramEmulated () const=0 |
| Does the driver supports vertex program, but emulated by CPU ? More...
|
virtual bool | activeVertexProgram (CVertexProgram *program)=0 |
| Activate / disactivate a vertex program. More...
|
virtual void | setConstant (uint index, float, float, float, float)=0 |
| Setup constant values. More...
|
virtual void | setConstant (uint index, double, double, double, double)=0 |
virtual void | setConstant (uint index, const NLMISC::CVector &value)=0 |
virtual void | setConstant (uint index, const NLMISC::CVectorD &value)=0 |
virtual void | setConstant (uint index, uint num, const float *src)=0 |
| setup several 4 float csts taken from the given tab. More...
|
virtual void | setConstant (uint index, uint num, const double *src)=0 |
| setup several 4 double csts taken from the given tab. More...
|
virtual void | setConstantMatrix (uint index, TMatrix matrix, TTransform transform)=0 |
| Setup constants with a current matrix. More...
|
virtual bool | supportVertexProgramDoubleSidedColor () const=0 |
| Check if the driver support double sided colors vertex programs. More...
|
virtual void | enableVertexProgramDoubleSidedColor (bool doubleSided)=0 |
| Activate VertexProgram 2Sided Color mode. More...
|
Public Types |
enum | TMessageBoxId {
okId = 0,
yesId,
noId,
abortId,
retryId,
cancelId,
ignoreId,
idCount
} |
enum | TMessageBoxType {
okType = 0,
okCancelType,
yesNoType,
abortRetryIgnoreType,
yesNoCancelType,
retryCancelType,
typeCount
} |
enum | TMessageBoxIcon {
noIcon = 0,
handIcon,
questionIcon,
exclamationIcon,
asteriskIcon,
warningIcon,
errorIcon,
informationIcon,
stopIcon,
iconCount
} |
enum | TPolygonMode { Filled = 0,
Line,
Point
} |
| Driver's polygon modes. More...
|
enum | TMatrixCount { MaxModelMatrix = 16
} |
| Driver Max matrix count. More...
|
enum | TVBHardType { VBHardAGP = 0,
VBHardVRAM,
CountVBHard
} |
| Driver VertexBufferHard type. More...
|
Public Methods |
| IDriver (void) |
virtual | ~IDriver (void) |
virtual bool | init (void)=0 |
virtual ModeList | enumModes ()=0 |
virtual bool | setDisplay (void *wnd, const GfxMode &mode)=0 throw (EBadDisplay) |
virtual void * | getDisplay ()=0 |
virtual bool | setMonitorColorProperties (const CMonitorColorProperties &properties)=0 |
| Setup monitor color properties. More...
|
virtual emptyProc | getWindowProc ()=0 |
virtual bool | activate (void)=0 |
| Before rendering via a driver in a thread, must activate() (per thread). More...
|
virtual sint | getNbTextureStages () const=0 |
| Get the number of texture stage avaliable, for multitexturing (Normal material shaders). Valid only after setDisplay(). More...
|
virtual bool | isTextureExist (const ITexture &tex)=0 |
| is the texture is set up in the driver. More...
|
virtual NLMISC::IEventEmitter * | getEventEmitter (void)=0 |
virtual bool | clear2D (CRGBA rgba)=0 |
virtual bool | clearZBuffer (float zval=1)=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. More...
|
virtual bool | setupTexture (ITexture &tex)=0 |
| setup a texture, generate and upload if needed. More...
|
virtual bool | setupTextureEx (ITexture &tex, bool bUpload, bool &bAllUploaded, bool bMustRecreateSharedTexture=false)=0 |
| setup a texture in the driver. More...
|
virtual bool | uploadTexture (ITexture &tex, NLMISC::CRect &rect, uint8 nNumMipMap)=0 |
| The texture must be created or uploadTexture do nothing. More...
|
virtual bool | uploadTextureCube (ITexture &tex, NLMISC::CRect &rect, uint8 nNumMipMap, uint8 nNumFace)=0 |
bool | invalidateShareTexture (ITexture &) |
| Invalidate shared texture. More...
|
virtual void | forceDXTCCompression (bool dxtcComp)=0 |
| if true force all the uncompressed RGBA 32 bits and RGBA 24 bits texture to be DXTC5 compressed. More...
|
virtual void | forceTextureResize (uint divisor)=0 |
| if !=1, force mostly all the textures (but TextureFonts lightmaps, interfaces etc..) to be divided by Divisor (2, 4, 8...) Default is 1. More...
|
virtual bool | setupMaterial (CMaterial &mat)=0 |
virtual void | setFrustum (float left, float right, float bottom, float top, float znear, float zfar, bool perspective=true)=0 |
virtual void | setupViewMatrix (const CMatrix &mtx)=0 |
| setup the view matrix (inverse of camera matrix). More...
|
virtual void | setupViewMatrixEx (const CMatrix &mtx, const CVector &cameraPos)=0 |
| setup the view matrix (inverse of camera matrix). More...
|
virtual void | setupModelMatrix (const CMatrix &mtx)=0 |
| setup the model matrix. More...
|
virtual void | multiplyModelMatrix (const CMatrix &mtx)=0 |
| multipliy the model matrix. More...
|
virtual CMatrix | getViewMatrix (void) const=0 |
virtual void | forceNormalize (bool normalize)=0 |
| Force input normal to be normalized by the driver. More...
|
virtual bool | isForceNormalize () const=0 |
| return the forceNormalize() state. More...
|
virtual bool | supportVertexBufferHard () const=0 |
| return true if driver support VertexBufferHard. More...
|
virtual bool | slowUnlockVertexBufferHard () const=0 |
| return true if driver support VertexBufferHard, but vbHard->unlock() are slow (ATI-openGL). More...
|
virtual uint | getMaxVerticesByVertexBufferHard () const=0 |
| return How many vertices VertexBufferHard support. More...
|
virtual bool | initVertexArrayRange (uint agpMem, uint vramMem=0)=0 |
| Allocate the initial VertexArray Memory. More...
|
virtual IVertexBufferHard * | createVertexBufferHard (uint16 vertexFormat, const uint8 *typeArray, uint32 numVertices, TVBHardType vbType)=0 |
| create a IVertexBufferHard. More...
|
virtual void | deleteVertexBufferHard (IVertexBufferHard *VB)=0 |
| delete a IVertexBufferHard. More...
|
virtual void | activeVertexBufferHard (IVertexBufferHard *VB)=0 |
| active a current VB Hard, for future render(). More...
|
virtual bool | activeVertexBuffer (CVertexBuffer &VB)=0 |
| active a current VB, for future render(). More...
|
virtual bool | activeVertexBuffer (CVertexBuffer &VB, uint first, uint end)=0 |
| active a current VB, for future render(). More...
|
virtual void | mapTextureStageToUV (uint stage, uint uv)=0 |
| Say what Texture Stage use what UV coord. More...
|
virtual bool | render (CPrimitiveBlock &PB, CMaterial &Mat)=0 |
| render a block of primitive with previously setuped VertexBuffer / Matrixes. More...
|
virtual void | renderTriangles (CMaterial &Mat, uint32 *tri, uint32 ntris)=0 |
| render a list of triangles with previously setuped VertexBuffer / Matrixes. More...
|
virtual void | renderSimpleTriangles (uint32 *tri, uint32 ntris)=0 |
| render a list of triangles with previously setuped VertexBuffer / Matrixes, AND previously setuped MATERIAL!! This use the last material setuped. More...
|
virtual void | renderPoints (CMaterial &Mat, uint32 numPoints)=0 |
| render points with previously setuped VertexBuffer / Matrixes. More...
|
virtual void | renderQuads (CMaterial &Mat, uint32 startIndex, uint32 numQuads)=0 |
| render quads with previously setuped VertexBuffer / Matrixes. More...
|
virtual bool | swapBuffers (void)=0 |
| Swap the back and front buffers. More...
|
virtual bool | release (void) |
| Deriver should calls IDriver::release() first, to destroy all driver components (textures, shaders, VBuffers). More...
|
virtual bool | isActive ()=0 |
| Return true if driver is still active. Return false else. If he user close the window, must return false. More...
|
virtual uint8 | getBitPerPixel ()=0 |
| Return the depth of the driver after init(). More...
|
virtual TMessageBoxId | systemMessageBox (const char *message, const char *title, TMessageBoxType type=okType, TMessageBoxIcon icon=noIcon) |
| Output a system message box and print a message with an icon. More...
|
virtual void | setupViewport (const class CViewport &viewport)=0 |
| Set the current viewport. More...
|
virtual void | setupScissor (const class CScissor &scissor)=0 |
| Set the current Scissor. More...
|
virtual uint32 | getImplementationVersion () const=0 |
| Get the driver version. More...
|
virtual const char * | getDriverInformation ()=0 |
| Get driver informations. More...
|
virtual const char * | getVideocardInformation ()=0 |
| Get videocard informations. More...
|
virtual void | getWindowSize (uint32 &width, uint32 &height)=0 |
| Get the width and the height of the window. More...
|
virtual void | getBuffer (CBitmap &bitmap)=0 |
| get the RGBA back buffer. More...
|
virtual void | getZBuffer (std::vector< float > &zbuffer)=0 |
| get the ZBuffer (back buffer). More...
|
virtual void | getBufferPart (CBitmap &bitmap, NLMISC::CRect &rect)=0 |
| get a part of the RGBA back buffer NB: 0,0 is the bottom left corner of the screen. More...
|
virtual void | getZBufferPart (std::vector< float > &zbuffer, NLMISC::CRect &rect)=0 |
| get a part of the ZBuffer (back buffer). More...
|
virtual void | copyFrameBufferToTexture (ITexture *tex, uint32 level, uint32 offsetx, uint32 offsety, uint32 x, uint32 y, uint32 width, uint32 height)=0 |
| Copy a portion of the FrameBuffer into a texture. More...
|
virtual bool | fillBuffer (CBitmap &bitmap)=0 |
| fill the RGBA back buffer. More...
|
virtual void | setPolygonMode (TPolygonMode mode) |
| Set the global polygon mode. More...
|
virtual uint | getMaxLight () const=0 |
| return the number of light supported by driver. More...
|
virtual void | setLight (uint8 num, const CLight &light)=0 |
| Setup a light. More...
|
virtual void | enableLight (uint8 num, bool enable=true)=0 |
| Enable / disable light. More...
|
virtual void | setAmbientColor (CRGBA color)=0 |
| Set ambiant. More...
|
virtual void | setPerPixelLightingLight (CRGBA diffuse, CRGBA specular, float shininess)=0 |
| Setup the light used for per pixel lighting. More...
|
TPolygonMode | getPolygonMode () |
| Get the global polygon mode. More...
|
virtual bool | supportPerPixelLighting (bool specular) const=0 |
virtual void | swapTextureHandle (ITexture &tex0, ITexture &tex1)=0 |
| Special method to internally swap the Driver handle of 2 textures. More...
|
|
virtual void | disableHardwareVertexProgram ()=0 |
virtual void | disableHardwareVertexArrayAGP ()=0 |
virtual void | disableHardwareTextureShader ()=0 |
|
virtual void | profileRenderedPrimitives (CPrimitiveProfile &pIn, CPrimitiveProfile &pOut)=0 |
| Get the number of primitives rendered from the last swapBuffers() call. More...
|
virtual uint32 | profileAllocatedTextureMemory ()=0 |
| Return the amount of Texture memory requested. More...
|
virtual uint32 | profileSetupedMaterials () const=0 |
| Get the number of material setuped from the last swapBuffers() call. More...
|
virtual uint32 | profileSetupedModelMatrix () const=0 |
| Get the number of matrix setuped from the last swapBuffers() call. More...
|
virtual void | enableUsedTextureMemorySum (bool enable=true)=0 |
| Enable the sum of texture memory used since last swapBuffers() call. More...
|
virtual uint32 | getUsedTextureMemory () const=0 |
| Return the amount of texture video memory used since last swapBuffers() call. More...
|
|
virtual bool | fogEnabled ()=0 |
virtual void | enableFog (bool enable)=0 |
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. More...
|
|
virtual void | showCursor (bool b)=0 |
| show cursor if b is true, or hide it if b is false. More...
|
virtual void | setMousePos (float x, float y)=0 |
| x and y must be between 0.0 and 1.0. More...
|
virtual NLMISC::IMouseDevice * | enableLowLevelMouse (bool enable)=0 |
| Enable / disable low level mouse. More...
|
virtual NLMISC::IKeyboardDevice * | enableLowLevelKeyboard (bool enable)=0 |
| Enable / disable a low level keyboard. More...
|
virtual void | setCapture (bool b)=0 |
| If true, capture the mouse to force it to stay under the window. More...
|
virtual NLMISC::IInputDeviceManager * | getLowLevelInputDeviceManager ()=0 |
| Check wether there is a low level device manager available, and get its interface. More...
|
|
virtual bool | supportTextureShaders () const=0 |
| test wether the device supports some form of texture shader. (could be limited to DX6 EMBM for example). More...
|
virtual bool | isTextureAddrModeSupported (CMaterial::TTexAddressingMode mode) const=0 |
| test wether a texture addressing mode is supported. More...
|
virtual void | setMatrix2DForTextureOffsetAddrMode (const uint stage, const float mat[4])=0 |
| setup the 2D matrix for the OffsetTexture, OffsetTextureScale and OffsetTexture addressing mode It should be stored as the following [a0 a1] [a2 a3]. More...
|
|
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 | supportEMBM () const=0 |
virtual bool | isEMBMSupportedAtStage (uint stage) const=0 |
virtual void | setEMBMMatrix (const uint stage, const float mat[4])=0 |
|
virtual bool | supportBlendConstantColor () const=0 |
| Does the driver support Blend Constant Color ??? If yes CMaterial::blendConstant* enum can be used for blend Src ord Dst factor. More...
|
virtual void | setBlendConstantColor (NLMISC::CRGBA col)=0 |
| see supportBlendConstantColor(). More...
|
virtual NLMISC::CRGBA | getBlendConstantColor () const=0 |
| see supportBlendConstantColor(). More...
|
Static Public Methods |
void | getTextureShareName (const ITexture &tex, std::string &output) |
| Get the driver share texture name. More...
|
Static Public Attributes |
const uint32 | InterfaceVersion = 0x46 |
| Version of the driver interface. To increment when the interface change. More...
|
Protected Methods |
void | removeVBDrvInfoPtr (ItVBDrvInfoPtrList vbDrvInfoIt) |
| remove ptr from the lists in the driver. More...
|
void | removeTextureDrvInfoPtr (ItTexDrvInfoPtrMap texDrvInfoIt) |
void | removeTextureDrvSharePtr (ItTexDrvSharePtrList texDrvShareIt) |
void | removeShaderPtr (ItShaderPtrList shaderIt) |
void | removeVtxPrgDrvInfoPtr (ItVtxPrgDrvInfoPtrList vtxPrgDrvInfoIt) |
Protected Attributes |
CSynchronized< TTexDrvInfoPtrMap > | _SyncTexDrvInfos |
TTexDrvSharePtrList | _TexDrvShares |
TShaderPtrList | _Shaders |
TVBDrvInfoPtrList | _VBDrvInfos |
TPolygonMode | _PolygonMode |
TVtxPrgDrvInfoPtrList | _VtxPrgDrvInfos |
Friends |
class | IVBDrvInfos |
class | CTextureDrvShare |
class | ITextureDrvInfos |
class | IShader |
class | IVertexProgramDrvInfos |
Member Enumeration Documentation
enum NL3D::IDriver::TMatrix
|
|
|
-
Enumeration values:
-
ModelView |
|
Projection |
|
ModelViewProjection |
|
NumMatrix |
|
Definition at line 736 of file driver.h. |
enum NL3D::IDriver::TMatrixCount
|
|
|
Driver Max matrix count.
Kept for backward compatibility. Suppose any Hardware VertexProgram can handle only 16 matrix -
Enumeration values:
-
Definition at line 146 of file driver.h. |
enum NL3D::IDriver::TMessageBoxIcon
|
|
|
-
Enumeration values:
-
noIcon |
|
handIcon |
|
questionIcon |
|
exclamationIcon |
|
asteriskIcon |
|
warningIcon |
|
errorIcon |
|
informationIcon |
|
stopIcon |
|
iconCount |
|
Definition at line 131 of file driver.h. |
enum NL3D::IDriver::TMessageBoxId
|
|
|
-
Enumeration values:
-
okId |
|
yesId |
|
noId |
|
abortId |
|
retryId |
|
cancelId |
|
ignoreId |
|
idCount |
|
Definition at line 129 of file driver.h. |
enum NL3D::IDriver::TMessageBoxType
|
|
|
-
Enumeration values:
-
okType |
|
okCancelType |
|
yesNoType |
|
abortRetryIgnoreType |
|
yesNoCancelType |
|
retryCancelType |
|
typeCount |
|
Definition at line 130 of file driver.h. |
enum NL3D::IDriver::TPolygonMode
|
|
enum NL3D::IDriver::TTransform
|
|
|
-
Enumeration values:
-
Identity |
|
Inverse |
|
Transpose |
|
InverseTranspose |
|
NumTransform |
|
Definition at line 744 of file driver.h. |
enum NL3D::IDriver::TVBHardType
|
|
Constructor & Destructor Documentation
NL3D::IDriver::IDriver |
( |
void |
|
) |
|
|
NL3D::IDriver::~IDriver |
( |
void |
|
) |
[virtual] |
|
Member Function Documentation
virtual bool NL3D::IDriver::activate |
( |
void |
|
) |
[pure virtual] |
|
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::CCloud::disp, NL3D::CCloud::dispBill, NL3D::CPSUtil::displayBBox, NL3D::CCloud::dispXYZ, NL3D::CNoise3d::flush, NL3D::CNoise3d::flush2passes, NL3D::CCloud::genBill, NL3D::CCloud::generate, NL3D::CCloud::light, and NL3D::CCloud::reset. |
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. |
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. |
virtual bool NL3D::IDriver::clear2D |
( |
CRGBA |
rgba |
) |
[pure virtual] |
|
virtual bool NL3D::IDriver::clearZBuffer |
( |
float |
zval = 1 |
) |
[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::CCloud::genBill, NL3D::CCloud::generate, NL3D::CCloud::light, and NL3D::CCloud::reset. |
|
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. |
-
Returns:
-
a vertexBufferHard interface.
|
virtual void NL3D::IDriver::deleteVertexBufferHard |
( |
IVertexBufferHard * |
VB |
) |
[pure virtual] |
|
virtual void NL3D::IDriver::disableHardwareTextureShader |
( |
|
) |
[pure virtual] |
|
virtual void NL3D::IDriver::disableHardwareVertexArrayAGP |
( |
|
) |
[pure virtual] |
|
virtual void NL3D::IDriver::disableHardwareVertexProgram |
( |
|
) |
[pure virtual] |
|
virtual void NL3D::IDriver::enableFog |
( |
bool |
enable |
) |
[pure virtual] |
|
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. |
|
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. |
|
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. |
virtual void NL3D::IDriver::enableUsedTextureMemorySum |
( |
bool |
enable = true |
) |
[pure virtual] |
|
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 ModeList NL3D::IDriver::enumModes |
( |
|
) |
[pure virtual] |
|
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. |
virtual bool NL3D::IDriver::fogEnabled |
( |
|
) |
[pure virtual] |
|
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. |
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. |
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. |
virtual uint8 NL3D::IDriver::getBitPerPixel |
( |
|
) |
[pure virtual] |
|
virtual NLMISC::CRGBA NL3D::IDriver::getBlendConstantColor |
( |
|
) |
const [pure virtual] |
|
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. |
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. |
virtual void* NL3D::IDriver::getDisplay |
( |
|
) |
[pure virtual] |
|
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. |
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. |
|
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. |
virtual uint NL3D::IDriver::getMaxLight |
( |
|
) |
const [pure virtual] |
|
virtual uint NL3D::IDriver::getMaxVerticesByVertexBufferHard |
( |
|
) |
const [pure virtual] |
|
|
return How many vertices VertexBufferHard support.
Implemented in NL3D::CDriverGL. |
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. |
void NL3D::IDriver::getTextureShareName |
( |
const ITexture & |
tex, |
|
|
std::string & |
output |
|
) |
[static] |
|
virtual uint32 NL3D::IDriver::getUsedTextureMemory |
( |
|
) |
const [pure virtual] |
|
virtual const char* NL3D::IDriver::getVideocardInformation |
( |
|
) |
[pure virtual] |
|
|
Get videocard informations.
get the official name of the driver
Implemented in NL3D::CDriverGL. |
virtual CMatrix NL3D::IDriver::getViewMatrix |
( |
void |
|
) |
const [pure virtual] |
|
virtual emptyProc NL3D::IDriver::getWindowProc |
( |
|
) |
[pure virtual] |
|
virtual void NL3D::IDriver::getWindowSize |
( |
uint32 & |
width, |
|
|
uint32 & |
height |
|
) |
[pure virtual] |
|
virtual void NL3D::IDriver::getZBuffer |
( |
std::vector< float > & |
zbuffer |
) |
[pure virtual] |
|
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. |
virtual bool NL3D::IDriver::init |
( |
void |
|
) |
[pure virtual] |
|
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 & |
|
) |
|
|
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. |
virtual bool NL3D::IDriver::isEMBMSupportedAtStage |
( |
uint |
stage |
) |
const [pure virtual] |
|
virtual bool NL3D::IDriver::isForceNormalize |
( |
|
) |
const [pure virtual] |
|
|
test wether a texture addressing mode is supported.
Implemented in NL3D::CDriverGL. |
virtual bool NL3D::IDriver::isTextureExist |
( |
const ITexture & |
tex |
) |
[pure virtual] |
|
virtual bool NL3D::IDriver::isVertexProgramEmulated |
( |
|
) |
const [pure virtual] |
|
|
Does the driver supports vertex program, but emulated by CPU ?
Implemented in NL3D::CDriverGL. |
virtual bool NL3D::IDriver::isVertexProgramSupported |
( |
|
) |
const [pure virtual] |
|
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] |
|
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. |
|
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. |
virtual uint32 NL3D::IDriver::profileSetupedMaterials |
( |
|
) |
const [pure virtual] |
|
virtual uint32 NL3D::IDriver::profileSetupedModelMatrix |
( |
|
) |
const [pure virtual] |
|
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. |
void NL3D::IDriver::removeShaderPtr |
( |
ItShaderPtrList |
shaderIt |
) |
[protected] |
|
void NL3D::IDriver::removeTextureDrvInfoPtr |
( |
ItTexDrvInfoPtrMap |
texDrvInfoIt |
) |
[protected] |
|
virtual void NL3D::IDriver::renderPoints |
( |
CMaterial & |
Mat, |
|
|
uint32 |
numPoints |
|
) |
[pure virtual] |
|
|
render points with previously setuped VertexBuffer / Matrixes.
Implemented in NL3D::CDriverGL. |
virtual void NL3D::IDriver::renderQuads |
( |
CMaterial & |
Mat, |
|
|
uint32 |
startIndex, |
|
|
uint32 |
numQuads |
|
) |
[pure virtual] |
|
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. |
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. |
virtual void NL3D::IDriver::setAmbientColor |
( |
CRGBA |
color |
) |
[pure virtual] |
|
virtual void NL3D::IDriver::setBlendConstantColor |
( |
NLMISC::CRGBA |
col |
) |
[pure virtual] |
|
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. |
virtual void NL3D::IDriver::setColorMask |
( |
bool |
bRed, |
|
|
bool |
bGreen, |
|
|
bool |
bBlue, |
|
|
bool |
bAlpha |
|
) |
[pure virtual] |
|
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] |
|
virtual void NL3D::IDriver::setConstant |
( |
uint |
index, |
|
|
const NLMISC::CVector & |
value |
|
) |
[pure virtual] |
|
virtual void NL3D::IDriver::setConstant |
( |
uint |
index, |
|
|
double |
, |
|
|
double |
, |
|
|
double |
, |
|
|
double |
|
|
) |
[pure virtual] |
|
virtual void NL3D::IDriver::setConstant |
( |
uint |
index, |
|
|
float |
, |
|
|
float |
, |
|
|
float |
, |
|
|
float |
|
|
) |
[pure virtual] |
|
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. |
|
virtual bool NL3D::IDriver::setDisplay |
( |
void * |
wnd, |
|
|
const GfxMode & |
mode |
|
) |
throw (EBadDisplay) [pure virtual] |
|
virtual void NL3D::IDriver::setEMBMMatrix |
( |
const uint |
stage, |
|
|
const float |
mat[4] |
|
) |
[pure virtual] |
|
virtual void NL3D::IDriver::setFrustum |
( |
float |
left, |
|
|
float |
right, |
|
|
float |
bottom, |
|
|
float |
top, |
|
|
float |
znear, |
|
|
float |
zfar, |
|
|
bool |
perspective = true |
|
) |
[pure virtual] |
|
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. |
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. |
virtual bool NL3D::IDriver::setMonitorColorProperties |
( |
const CMonitorColorProperties & |
properties |
) |
[pure virtual] |
|
|
Setup monitor color properties.
Return false if setup failed.
Implemented in NL3D::CDriverGL. |
virtual void NL3D::IDriver::setMousePos |
( |
float |
x, |
|
|
float |
y |
|
) |
[pure virtual] |
|
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. |
virtual void NL3D::IDriver::setPolygonMode |
( |
TPolygonMode |
mode |
) |
[inline, virtual] |
|
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. |
virtual bool NL3D::IDriver::setupMaterial |
( |
CMaterial & |
mat |
) |
[pure virtual] |
|
virtual void NL3D::IDriver::setupModelMatrix |
( |
const CMatrix & |
mtx |
) |
[pure virtual] |
|
virtual void NL3D::IDriver::setupScissor |
( |
const class CScissor & |
scissor |
) |
[pure virtual] |
|
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. |
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. |
virtual void NL3D::IDriver::setupViewMatrix |
( |
const CMatrix & |
mtx |
) |
[pure virtual] |
|
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. |
virtual void NL3D::IDriver::setupViewport |
( |
const class CViewport & |
viewport |
) |
[pure virtual] |
|
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. |
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. |
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. |
virtual bool NL3D::IDriver::supportEMBM |
( |
|
) |
const [pure virtual] |
|
virtual bool NL3D::IDriver::supportPerPixelLighting |
( |
bool |
specular |
) |
const [pure virtual] |
|
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. |
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] |
|
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. |
|
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 136 of file driver.cpp.
References abortId, abortRetryIgnoreType, cancelId, iconCount, ignoreId, nlassert, noId, okCancelType, okId, okType, retryCancelType, retryId, type, typeCount, yesId, yesNoCancelType, and yesNoType. |
|
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. |
Friends And Related Function Documentation
friend class CTextureDrvShare [friend]
|
|
friend class IShader [friend]
|
|
friend class ITextureDrvInfos [friend]
|
|
friend class IVBDrvInfos [friend]
|
|
friend class IVertexProgramDrvInfos [friend]
|
|
Member Data Documentation
const uint32 NL3D::IDriver::InterfaceVersion = 0x46 [static]
|
|
|
Version of the driver interface. To increment when the interface change.
Definition at line 46 of file driver.cpp. |
The documentation for this class was generated from the following files:
|
|