|
|
|
|
Documentation |
|
Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages Search
NL3D::CDriverGL Class Reference#include <driver_opengl.h>
Inheritance diagram for NL3D::CDriverGL
[legend]Collaboration diagram for NL3D::CDriverGL:
[legend]List of all members.
Public Types |
enum | {
MaxLight = 8
} |
Public Methods |
uint32 | getHwnd () |
| CDriverGL () |
virtual | ~CDriverGL () |
virtual bool | init () |
virtual ModeList | enumModes () |
virtual bool | setDisplay (void* wnd, const GfxMode& mode) throw (EBadDisplay) |
virtual void* | getDisplay () |
virtual bool | activate () |
| Before rendering via a driver in a thread, must activate() (per thread). More...
|
virtual sint | getNbTextureStages () |
| Get the number of texture stage avaliable, for multitexturing (Normal material shaders). Valid only after setDisplay(). More...
|
virtual bool | isTextureExist (const ITexture&tex) |
| is the texture is set up in the driver. More...
|
virtual NLMISC::IEventEmitter* | getEventEmitter () |
virtual bool | clear2D (CRGBA rgba) |
virtual bool | clearZBuffer (float zval=1) |
virtual bool | setupTexture (ITexture& tex) |
virtual bool | setupMaterial (CMaterial& mat) |
virtual void | setFrustum (float left, float right, float bottom, float top, float znear, float zfar, bool perspective = true) |
virtual void | setupViewMatrix (const CMatrix& mtx) |
| setup the view matrix (inverse of camera matrix). More...
|
virtual void | setupModelMatrix (const CMatrix& mtx, uint8 n=0) |
| setup a model matrix. More...
|
virtual CMatrix | getViewMatrix () const |
virtual void | setupVertexMode (uint vmode) |
| setup the vertex transformation Mode. More...
|
virtual bool | activeVertexBuffer (CVertexBuffer& VB) |
| active a current VB, for future render(). More...
|
virtual bool | activeVertexBuffer (CVertexBuffer& VB, uint first, uint end) |
| active a current VB, for future render(). More...
|
virtual bool | render (CPrimitiveBlock& PB, CMaterial& Mat) |
| render a block of primitive with previously setuped VertexBuffer / Matrixes. More...
|
virtual void | renderTriangles (CMaterial& Mat, uint32 *tri, uint32 ntris) |
| render a list of triangles with previously setuped VertexBuffer / Matrixes. More...
|
virtual void | renderPoints (CMaterial& Mat, uint32 numPoints) |
| render points with previously setuped VertexBuffer / Matrixes. More...
|
virtual bool | swapBuffers () |
| Swap the back and front buffers. More...
|
virtual uint | getNumMatrix () |
| Returns the number of model matrices supported in hardware by the driver. More...
|
virtual bool | supportPaletteSkinning () |
| Returns true if the hardware support PaletteSkinning. More...
|
virtual bool | release () |
| Deriver should calls IDriver::release() first, to destroy all driver components (textures, shaders, VBuffers). 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 | setupScissor (const class CViewport& viewport) |
| Set the current Scissor. More...
|
virtual void | setupViewport (const class CViewport& viewport) |
| Set the current viewport. More...
|
virtual uint32 | getImplementationVersion () const |
| Get the driver version. More...
|
virtual const char* | getDriverInformation () |
| Get driver informations. More...
|
virtual const char* | getVideocardInformation () |
| Get videocard informations. More...
|
virtual bool | isActive () |
| Return true if driver is still active. Return false else. If he user close the window, must return false. More...
|
virtual void | showCursor (bool b) |
| show cursor if b is true, or hide it if b is false. More...
|
virtual void | setMousePos (float x, float y) |
| x and y must be between 0.0 and 1.0. More...
|
virtual void | setCapture (bool b) |
| If true, capture the mouse to force it to stay under the window. More...
|
virtual void | getWindowSize (uint32 &width, uint32 &height) |
| Get the width and the height of the window. More...
|
virtual void | getBuffer (CBitmap &bitmap) |
| get the RGBA back buffer. More...
|
virtual void | getZBuffer (std::vector<float> &zbuffer) |
| get the ZBuffer (back buffer). More...
|
virtual void | getBufferPart (CBitmap &bitmap, NLMISC::CRect &rect) |
| 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) |
| get a part of the ZBuffer (back buffer). More...
|
virtual void | setPolygonMode (TPolygonMode mode) |
| Set the global polygon mode. More...
|
virtual void | setLight (uint8 num, const CLight& light) |
| Setup a light. More...
|
virtual void | enableLight (uint8 num, bool enable=true) |
| Enable / disable light. More...
|
virtual void | setAmbientColor (CRGBA color) |
| Set ambiant. More...
|
virtual bool | fogEnabled () |
virtual void | enableFog (bool enable) |
virtual void | setupFog (float start, float end, CRGBA color) |
| setup fog parameters. fog must enabled to see result. start and end are in [0,1] range. More...
|
Private Methods |
bool | setupVertexBuffer (CVertexBuffer& VB) |
bool | activateTexture (uint stage, ITexture *tex) |
void | activateTexEnvMode (uint stage, const CMaterial::CTexEnv &env) |
void | activateTexEnvColor (uint stage, const CMaterial::CTexEnv &env) |
void | cleanViewMatrix () |
GLint | getGlTextureFormat (ITexture& tex, bool &compressed) |
bool | clipRect (NLMISC::CRect &rect) |
void | computeSoftwareVertexSkinning (uint8 *pSrc, CVector *pVertexDst) |
void | computeSoftwareNormalSkinning (uint8 *pSrc, CVector *pNormalDst) |
void | refreshSoftwareSkinning () |
Private Attributes |
bool | _FullScreen |
bool | _Initialized |
CGlExtensions | _Extensions |
bool | _PaletteSkinHard |
uint | _VertexMode |
bool | _MatrixSetupDirty |
bool | _ViewMatrixSetupDirty |
NLMISC::CBitSet | _ModelViewMatrixDirty |
NLMISC::CBitSet | _ModelViewMatrixDirtyPaletteSkin |
CMatrix | _ViewMtx |
CMatrix | _ModelViewMatrix [MaxModelMatrix] |
CMatrix | _ModelViewMatrixNormal [MaxModelMatrix] |
CMatrix3x4 | _ModelViewMatrix3x4 [MaxModelMatrix] |
CMatrix3x4 | _ModelViewMatrixNormal3x4 [MaxModelMatrix] |
uint8* | _CurrentSoftSkinFlags |
uint8* | _CurrentSoftSkinSrc |
uint | _CurrentSoftSkinNormalOff |
uint | _CurrentSoftSkinPaletteSkinOff |
uint | _CurrentSoftSkinWeightOff |
uint | _CurrentSoftSkinSrcStride |
uint | _CurrentSoftSkinFirst |
uint | _CurrentSoftSkinEnd |
CVector* | _CurrentSoftSkinVectorDst |
CVector* | _CurrentSoftSkinNormalDst |
bool | _FogEnabled |
uint | _MaxDriverLight |
bool | _LightEnable [MaxLight] |
uint | _LightMode [MaxLight] |
CVector | _WorldLightPos [MaxLight] |
CVector | _WorldLightDirection [MaxLight] |
ITexture* | _CurrentTexture [IDRV_MAT_MAXTEXTURES] |
CMaterial* | _CurrentMaterial |
CMaterial::CTexEnv | _CurrentTexEnv [IDRV_MAT_MAXTEXTURES] |
bool | _CurrentNormalize |
Static Private Attributes |
const uint32 | ReleaseVersion = 0x6 |
Member Enumeration Documentation
Constructor & Destructor Documentation
NL3D::CDriverGL::CDriverGL (
|
)
|
|
NL3D::CDriverGL::~CDriverGL (
|
) [inline, virtual]
|
|
Member Function Documentation
bool NL3D::CDriverGL::activate (
|
void ) [virtual]
|
|
bool NL3D::CDriverGL::activateTexture (
|
uint stage,
|
|
ITexture * tex ) [private]
|
|
|
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, but it is usefull for software skinning too. Undefined results if primitives in render() use vertices not in this range.
NB: software skinning (if any) will be actuallay done in render*() call, only one time per vertex. Vertex Skinning Flags are reseted in activeVertexBuffer(), but only for given range here!
Skinning is enabled only when VB has skinning, and when vertexMode has flag NL3D_VERTEX_MODE_SKINNING. -
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:
-
setupVertexMode()
Reimplemented from NL3D::IDriver.
Definition at line 738 of file driver_opengl.cpp. |
bool NL3D::CDriverGL::activeVertexBuffer (
|
CVertexBuffer & VB ) [virtual]
|
|
|
active a current VB, for future render().
This method suppose that all vertices in the VB will be used.
NB: software skinning (if any) will be actuallay done in render*() call, only one time per vertex. Vertex Skinning Flags are reseted in activeVertexBuffer().
Skinning is enabled only when VB has skinning, and when vertexMode has flag NL3D_VERTEX_MODE_SKINNING.
-
See also:
-
setupVertexMode()
Reimplemented from NL3D::IDriver.
Definition at line 1048 of file driver_opengl.cpp. |
void NL3D::CDriverGL::cleanViewMatrix (
|
) [private]
|
|
bool NL3D::CDriverGL::clear2D (
|
CRGBA rgba ) [virtual]
|
|
bool NL3D::CDriverGL::clearZBuffer (
|
float zval = 1 ) [virtual]
|
|
bool NL3D::CDriverGL::clipRect (
|
NLMISC::CRect & rect ) [private]
|
|
void NL3D::CDriverGL::computeSoftwareNormalSkinning (
|
uint8 * pSrc,
|
|
CVector * pDst ) [private]
|
|
void NL3D::CDriverGL::computeSoftwareVertexSkinning (
|
uint8 * pSrc,
|
|
CVector * pDst ) [private]
|
|
void NL3D::CDriverGL::enableFog (
|
bool enable ) [virtual]
|
|
void NL3D::CDriverGL::enableLight (
|
uint8 num,
|
|
bool enable = true ) [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()
Reimplemented from NL3D::IDriver.
Definition at line 122 of file driver_opengl_light.cpp. |
ModeList NL3D::CDriverGL::enumModes (
|
) [virtual]
|
|
bool NL3D::CDriverGL::fogEnabled (
|
) [virtual]
|
|
void NL3D::CDriverGL::getBuffer (
|
CBitmap & bitmap ) [virtual]
|
|
|
get the RGBA back buffer.
-
Parameters:
-
bitmap
|
the buffer will be written in this bitmap |
Reimplemented from NL3D::IDriver.
Definition at line 1591 of file driver_opengl.cpp. |
void NL3D::CDriverGL::getBufferPart (
|
CBitmap & bitmap,
|
|
NLMISC::CRect & rect ) [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. |
Reimplemented from NL3D::IDriver.
Definition at line 1559 of file driver_opengl.cpp. |
void * NL3D::CDriverGL::getDisplay (
|
) [inline, virtual]
|
|
const char * NL3D::CDriverGL::getDriverInformation (
|
) [inline, virtual]
|
|
|
Get driver informations.
get the nel name of the driver (ex: "Opengl 1.2 NeL Driver")
Reimplemented from NL3D::IDriver.
Definition at line 222 of file driver_opengl.h. |
GLint NL3D::CDriverGL::getGlTextureFormat (
|
ITexture & tex,
|
|
bool & compressed ) [private]
|
|
uint32 NL3D::CDriverGL::getHwnd (
|
) [inline]
|
|
uint32 NL3D::CDriverGL::getImplementationVersion (
|
) const [inline, virtual]
|
|
sint NL3D::CDriverGL::getNbTextureStages (
|
) [inline, virtual]
|
|
uint NL3D::CDriverGL::getNumMatrix (
|
) [virtual]
|
|
|
Returns the number of model matrices supported in hardware by the driver.
NeL will support from 2 to 4 matrices by vertices. If the user uses a model with a greater count of matrices than the hardware can support, the skinning will be made in software.
For the time, driver opengl supports 2 matrices in hardware on Geforce, and implement nothing in software. (Use paletted skinning instead)
Reimplemented from NL3D::IDriver.
Definition at line 1202 of file driver_opengl.cpp. |
const char * NL3D::CDriverGL::getVideocardInformation (
|
) [virtual]
|
|
CMatrix NL3D::CDriverGL::getViewMatrix (
|
void ) const [virtual]
|
|
void NL3D::CDriverGL::getWindowSize (
|
uint32 & width,
|
|
uint32 & height ) [virtual]
|
|
void NL3D::CDriverGL::getZBuffer (
|
std::vector< float >& zbuffer ) [virtual]
|
|
void NL3D::CDriverGL::getZBufferPart (
|
std::vector< float >& zbuffer,
|
|
NLMISC::CRect & rect ) [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. |
Reimplemented from NL3D::IDriver.
Definition at line 1572 of file driver_opengl.cpp. |
bool NL3D::CDriverGL::init (
|
void ) [virtual]
|
|
bool NL3D::CDriverGL::isActive (
|
) [virtual]
|
|
|
Return true if driver is still active. Return false else. If he user close the window, must return false.
Reimplemented from NL3D::IDriver.
Definition at line 1478 of file driver_opengl.cpp. |
bool NL3D::CDriverGL::isTextureExist (
|
const ITexture & tex ) [virtual]
|
|
void NL3D::CDriverGL::refreshSoftwareSkinning (
|
) [private]
|
|
bool NL3D::CDriverGL::release (
|
void ) [virtual]
|
|
void NL3D::CDriverGL::renderPoints (
|
CMaterial & Mat,
|
|
uint32 numPoints ) [virtual]
|
|
void NL3D::CDriverGL::setAmbientColor (
|
CRGBA color ) [virtual]
|
|
void NL3D::CDriverGL::setCapture (
|
bool b ) [virtual]
|
|
bool NL3D::CDriverGL::setDisplay (
|
void * wnd,
|
|
const GfxMode & mode ) throw (EBadDisplay) [virtual]
|
|
void NL3D::CDriverGL::setFrustum (
|
float left,
|
|
float right,
|
|
float bottom,
|
|
float top,
|
|
float znear,
|
|
float zfar,
|
|
bool perspective = true ) [virtual]
|
|
void NL3D::CDriverGL::setLight (
|
uint8 num,
|
|
const CLight & light ) [virtual]
|
|
void NL3D::CDriverGL::setMousePos (
|
float x,
|
|
float y ) [virtual]
|
|
void NL3D::CDriverGL::setPolygonMode (
|
TPolygonMode mode ) [virtual]
|
|
void NL3D::CDriverGL::setupFog (
|
float start,
|
|
float end,
|
|
CRGBA color ) [virtual]
|
|
|
setup fog parameters. fog must enabled to see result. start and end are in [0,1] range.
Reimplemented from NL3D::IDriver.
Definition at line 1633 of file driver_opengl.cpp. |
bool NL3D::CDriverGL::setupMaterial (
|
CMaterial & mat ) [virtual]
|
|
void NL3D::CDriverGL::setupModelMatrix (
|
const CMatrix & mtx,
|
|
uint8 n = 0 ) [virtual]
|
|
void NL3D::CDriverGL::setupScissor (
|
const class CViewport & viewport ) [virtual]
|
|
|
Set the current Scissor.
-
Parameters:
-
viewport
|
is a viewport to setup the current Scissor, in Window relative coordinate (0,1). |
Reimplemented from NL3D::IDriver.
Definition at line 1361 of file driver_opengl.cpp. |
bool NL3D::CDriverGL::setupTexture (
|
ITexture & tex ) [virtual]
|
|
bool NL3D::CDriverGL::setupVertexBuffer (
|
CVertexBuffer & VB ) [private]
|
|
void NL3D::CDriverGL::setupVertexMode (
|
uint vmode ) [inline, virtual]
|
|
|
setup the vertex transformation Mode.
(or vertex program). This should be a ORed of NL3D_VMODE_* Default is NL3D_VERTEX_MODE_NORMAL.
Reimplemented from NL3D::IDriver.
Definition at line 187 of file driver_opengl.h. |
void NL3D::CDriverGL::setupViewMatrix (
|
const CMatrix & mtx ) [virtual]
|
|
void NL3D::CDriverGL::setupViewport (
|
const class CViewport & viewport ) [virtual]
|
|
|
Set the current viewport.
-
Parameters:
-
viewport
|
is a viewport to setup as current viewport. |
Reimplemented from NL3D::IDriver.
Definition at line 1326 of file driver_opengl.cpp. |
void NL3D::CDriverGL::showCursor (
|
bool b ) [virtual]
|
|
bool NL3D::CDriverGL::supportPaletteSkinning (
|
) [virtual]
|
|
|
Returns true if the hardware support PaletteSkinning.
NeL will support 4 matrices by vertices, and up to IDriver::MaxModelMatrix (16) model matrixes. If the user uses PaletteSkinning while the hardware does not support it, the skinning will be made in software.
Reimplemented from NL3D::IDriver.
Definition at line 1217 of file driver_opengl.cpp. |
bool NL3D::CDriverGL::swapBuffers (
|
void ) [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 from NL3D::IDriver. |
Member Data Documentation
const uint32 NL3D::CDriverGL::ReleaseVersion = 0x6 [static, private]
|
|
CMaterial * NL3D::CDriverGL::_CurrentMaterial [private]
|
|
bool NL3D::CDriverGL::_CurrentNormalize [private]
|
|
uint NL3D::CDriverGL::_CurrentSoftSkinEnd [private]
|
|
uint NL3D::CDriverGL::_CurrentSoftSkinFirst [private]
|
|
uint8 * NL3D::CDriverGL::_CurrentSoftSkinFlags [private]
|
|
CVector * NL3D::CDriverGL::_CurrentSoftSkinNormalDst [private]
|
|
uint NL3D::CDriverGL::_CurrentSoftSkinNormalOff [private]
|
|
uint NL3D::CDriverGL::_CurrentSoftSkinPaletteSkinOff [private]
|
|
uint8 * NL3D::CDriverGL::_CurrentSoftSkinSrc [private]
|
|
uint NL3D::CDriverGL::_CurrentSoftSkinSrcStride [private]
|
|
CVector * NL3D::CDriverGL::_CurrentSoftSkinVectorDst [private]
|
|
uint NL3D::CDriverGL::_CurrentSoftSkinWeightOff [private]
|
|
bool NL3D::CDriverGL::_FogEnabled [private]
|
|
bool NL3D::CDriverGL::_FullScreen [private]
|
|
bool NL3D::CDriverGL::_Initialized [private]
|
|
bool NL3D::CDriverGL::_LightEnable[MaxLight] [private]
|
|
uint NL3D::CDriverGL::_LightMode[MaxLight] [private]
|
|
bool NL3D::CDriverGL::_MatrixSetupDirty [private]
|
|
uint NL3D::CDriverGL::_MaxDriverLight [private]
|
|
CMatrix NL3D::CDriverGL::_ModelViewMatrix[MaxModelMatrix] [private]
|
|
CMatrix3x4 NL3D::CDriverGL::_ModelViewMatrix3x4[MaxModelMatrix] [private]
|
|
NLMISC::CBitSet NL3D::CDriverGL::_ModelViewMatrixDirtyPaletteSkin [private]
|
|
CMatrix NL3D::CDriverGL::_ModelViewMatrixNormal[MaxModelMatrix] [private]
|
|
CMatrix3x4 NL3D::CDriverGL::_ModelViewMatrixNormal3x4[MaxModelMatrix] [private]
|
|
bool NL3D::CDriverGL::_PaletteSkinHard [private]
|
|
uint NL3D::CDriverGL::_VertexMode [private]
|
|
bool NL3D::CDriverGL::_ViewMatrixSetupDirty [private]
|
|
CMatrix NL3D::CDriverGL::_ViewMtx [private]
|
|
CVector NL3D::CDriverGL::_WorldLightDirection[MaxLight] [private]
|
|
CVector NL3D::CDriverGL::_WorldLightPos[MaxLight] [private]
|
|
The documentation for this class was generated from the following files:
|
|