First batch of renames.

--HG--
branch : gsoc2013-dfighter
hg/feature/gsoc2013-dfighter
dfighter1985 12 years ago
parent d5e5775f29
commit 296083ba61

File diff suppressed because it is too large Load Diff

@ -95,48 +95,44 @@ using NLMISC::CVector;
namespace NL3D { namespace NL3D {
#ifdef NL_STATIC #ifdef NL_STATIC
#ifdef USE_OPENGLES namespace NLDRIVERGL3 {
namespace NLDRIVERGLES {
#else
namespace NLDRIVERGL {
#endif
#endif #endif
class CDriverGL; class CDriverGL3;
class IVertexArrayRange; class IVertexArrayRange;
class IVertexBufferHardGL; class IVertexBufferHardGL;
class COcclusionQueryGL; class COcclusionQueryGL3;
void displayGLError(GLenum error); void displayGLError(GLenum error);
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
bool GlWndProc(CDriverGL *driver, HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); bool GlWndProc(CDriverGL3 *driver, HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
typedef HCURSOR nlCursor; typedef HCURSOR nlCursor;
#define EmptyCursor (nlCursor)NULL #define EmptyCursor (nlCursor)NULL
#elif defined (NL_OS_MAC) #elif defined (NL_OS_MAC)
bool GlWndProc(CDriverGL *driver, const void* e); bool GlWndProc(CDriverGL3 *driver, const void* e);
typedef void* nlCursor; typedef void* nlCursor;
#define EmptyCursor (nlCursor)NULL #define EmptyCursor (nlCursor)NULL
#elif defined (NL_OS_UNIX) #elif defined (NL_OS_UNIX)
bool GlWndProc(CDriverGL *driver, XEvent &e); bool GlWndProc(CDriverGL3 *driver, XEvent &e);
typedef Cursor nlCursor; typedef Cursor nlCursor;
#define EmptyCursor None #define EmptyCursor None
#endif #endif
typedef std::list<COcclusionQueryGL *> TOcclusionQueryList; typedef std::list<COcclusionQueryGL3 *> TOcclusionQueryList;
// *************************************************************************** // ***************************************************************************
class COcclusionQueryGL : public IOcclusionQuery class COcclusionQueryGL3 : public IOcclusionQuery
{ {
public: public:
GLuint ID; // id of gl object GLuint ID; // id of gl object
NLMISC::CRefPtr<CDriverGL> Driver; // owner driver NLMISC::CRefPtr<CDriverGL3> Driver; // owner driver
TOcclusionQueryList::iterator Iterator; // iterator in owner driver list of queries TOcclusionQueryList::iterator Iterator; // iterator in owner driver list of queries
TOcclusionType OcclusionType; // current type of occlusion TOcclusionType OcclusionType; // current type of occlusion
uint VisibleCount; // number of samples that passed the test uint VisibleCount; // number of samples that passed the test
@ -148,7 +144,7 @@ public:
}; };
// *************************************************************************** // ***************************************************************************
class CTextureDrvInfosGL : public ITextureDrvInfos class CTextureDrvInfosGL3 : public ITextureDrvInfos
{ {
public: public:
/* /*
@ -165,7 +161,7 @@ public:
// This is the computed size of what memory this texture take. // This is the computed size of what memory this texture take.
uint32 TextureMemory; uint32 TextureMemory;
// This is the owner driver. // This is the owner driver.
CDriverGL *_Driver; CDriverGL3 *_Driver;
// enum to use for this texture (GL_TEXTURE_2D, GL_TEXTURE_RECTANGLE_NV..) // enum to use for this texture (GL_TEXTURE_2D, GL_TEXTURE_RECTANGLE_NV..)
GLenum TextureMode; GLenum TextureMode;
@ -188,9 +184,9 @@ public:
ITexture::TMinFilter MinFilter; ITexture::TMinFilter MinFilter;
// The gl id is auto created here. // The gl id is auto created here.
CTextureDrvInfosGL(IDriver *drv, ItTexDrvInfoPtrMap it, CDriverGL *drvGl, bool isRectangleTexture); CTextureDrvInfosGL3(IDriver *drv, ItTexDrvInfoPtrMap it, CDriverGL3 *drvGl, bool isRectangleTexture);
// The gl id is auto deleted here. // The gl id is auto deleted here.
~CTextureDrvInfosGL(); ~CTextureDrvInfosGL3();
// For Debug info. return the memory cost of this texture // For Debug info. return the memory cost of this texture
virtual uint getTextureMemoryUsed() const {return TextureMemory;} virtual uint getTextureMemoryUsed() const {return TextureMemory;}
@ -200,26 +196,26 @@ public:
// *************************************************************************** // ***************************************************************************
class CVBDrvInfosGL : public IVBDrvInfos class CVBDrvInfosGL3 : public IVBDrvInfos
{ {
public: public:
CVBDrvInfosGL(CDriverGL *drv, ItVBDrvInfoPtrList it, CVertexBuffer *vb); CVBDrvInfosGL3(CDriverGL3 *drv, ItVBDrvInfoPtrList it, CVertexBuffer *vb);
// Verex buffer hard ? // Verex buffer hard ?
IVertexBufferHardGL *_VBHard; IVertexBufferHardGL *_VBHard;
class CDriverGL *_DriverGL; class CDriverGL3 *_DriverGL;
uint8 *_SystemMemory; uint8 *_SystemMemory;
// From IVBDrvInfos // From IVBDrvInfos
virtual ~CVBDrvInfosGL(); virtual ~CVBDrvInfosGL3();
virtual uint8 *lock (uint first, uint last, bool readOnly); virtual uint8 *lock (uint first, uint last, bool readOnly);
virtual void unlock (uint first, uint last); virtual void unlock (uint first, uint last);
}; };
// *************************************************************************** // ***************************************************************************
class CShaderGL : public IMaterialDrvInfos class CShaderGL3 : public IMaterialDrvInfos
{ {
public: public:
GLenum SrcBlend; GLenum SrcBlend;
@ -239,7 +235,7 @@ public:
// The supported Shader type. // The supported Shader type.
CMaterial::TShader SupportedShader; CMaterial::TShader SupportedShader;
CShaderGL(IDriver *drv, ItMatDrvInfoPtrList it) : IMaterialDrvInfos(drv, it) {} CShaderGL3(IDriver *drv, ItMatDrvInfoPtrList it) : IMaterialDrvInfos(drv, it) {}
}; };
@ -291,15 +287,15 @@ public:
// *************************************************************************** // ***************************************************************************
class CDriverGL : public IDriver class CDriverGL3 : public IDriver
{ {
public: public:
// Some constants // Some constants
enum { MaxLight=8 }; enum { MaxLight=8 };
CDriverGL(); CDriverGL3();
virtual ~CDriverGL(); virtual ~CDriverGL3();
virtual bool isLost() const { return false; } // there's no notion of 'lost device" in OpenGL virtual bool isLost() const { return false; } // there's no notion of 'lost device" in OpenGL
@ -690,8 +686,8 @@ public:
private: private:
virtual class IVertexBufferHardGL *createVertexBufferHard(uint size, uint numVertices, CVertexBuffer::TPreferredMemory vbType, CVertexBuffer *vb); virtual class IVertexBufferHardGL *createVertexBufferHard(uint size, uint numVertices, CVertexBuffer::TPreferredMemory vbType, CVertexBuffer *vb);
friend class CTextureDrvInfosGL; friend class CTextureDrvInfosGL3;
friend class CVertexProgamDrvInfosGL; friend class CVertexProgamDrvInfosGL3;
private: private:
// Version of the driver. Not the interface version!! Increment when implementation of the driver change. // Version of the driver. Not the interface version!! Increment when implementation of the driver change.
@ -784,7 +780,7 @@ private:
bool convertBitmapToIcon(const NLMISC::CBitmap &bitmap, HICON &icon, uint iconWidth, uint iconHeight, uint iconDepth, const NLMISC::CRGBA &col = NLMISC::CRGBA::White, sint hotSpotX = 0, sint hotSpotY = 0, bool cursor = false); bool convertBitmapToIcon(const NLMISC::CBitmap &bitmap, HICON &icon, uint iconWidth, uint iconHeight, uint iconDepth, const NLMISC::CRGBA &col = NLMISC::CRGBA::White, sint hotSpotX = 0, sint hotSpotY = 0, bool cursor = false);
friend bool GlWndProc(CDriverGL *driver, HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); friend bool GlWndProc(CDriverGL3 *driver, HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
static uint _Registered; static uint _Registered;
DEVMODE _OldScreenMode; DEVMODE _OldScreenMode;
@ -806,7 +802,7 @@ private:
bool convertBitmapToIcon(const NLMISC::CBitmap &bitmap, std::vector<long> &icon); bool convertBitmapToIcon(const NLMISC::CBitmap &bitmap, std::vector<long> &icon);
friend bool GlWndProc(CDriverGL *driver, XEvent &e); friend bool GlWndProc(CDriverGL3 *driver, XEvent &e);
Display* _dpy; Display* _dpy;
NLMISC::CUnixEventEmitter _EventEmitter; NLMISC::CUnixEventEmitter _EventEmitter;
@ -940,7 +936,7 @@ private:
*/ */
ITexture* _CurrentTexture[IDRV_MAT_MAXTEXTURES]; ITexture* _CurrentTexture[IDRV_MAT_MAXTEXTURES];
CTextureDrvInfosGL* _CurrentTextureInfoGL[IDRV_MAT_MAXTEXTURES]; CTextureDrvInfosGL3* _CurrentTextureInfoGL[IDRV_MAT_MAXTEXTURES];
CMaterial::CTexEnv _CurrentTexEnv[IDRV_MAT_MAXTEXTURES]; CMaterial::CTexEnv _CurrentTexEnv[IDRV_MAT_MAXTEXTURES];
// Special Texture Environnement. // Special Texture Environnement.
CTexEnvSpecial _CurrentTexEnvSpecial[IDRV_MAT_MAXTEXTURES]; CTexEnvSpecial _CurrentTexEnvSpecial[IDRV_MAT_MAXTEXTURES];
@ -960,7 +956,7 @@ private:
float _AnisotropicFilter; float _AnisotropicFilter;
// Prec settings for material. // Prec settings for material.
CDriverGLStates _DriverGLStates; CDriverGLStates3 _DriverGLStates;
// Optim: To not test change in Materials states if just texture has changed. Very useful for landscape. // Optim: To not test change in Materials states if just texture has changed. Very useful for landscape.
uint32 _MaterialAllTextureTouchedFlag; uint32 _MaterialAllTextureTouchedFlag;
@ -1044,7 +1040,7 @@ private:
} }
void forceActivateTexEnvColor(uint stage, const CMaterial::CTexEnv &env) void forceActivateTexEnvColor(uint stage, const CMaterial::CTexEnv &env)
{ {
H_AUTO_OGL(CDriverGL_forceActivateTexEnvColor) H_AUTO_OGL(CDriverGL3_forceActivateTexEnvColor)
forceActivateTexEnvColor(stage, env.ConstantColor); forceActivateTexEnvColor(stage, env.ConstantColor);
} }
@ -1236,7 +1232,7 @@ private:
friend class CVertexBufferHardGLATI; friend class CVertexBufferHardGLATI;
friend class CVertexArrayRangeMapObjectATI; friend class CVertexArrayRangeMapObjectATI;
friend class CVertexBufferHardGLMapObjectATI; friend class CVertexBufferHardGLMapObjectATI;
friend class CVBDrvInfosGL; friend class CVBDrvInfosGL3;
// The VertexArrayRange activated. // The VertexArrayRange activated.
IVertexArrayRange *_CurrentVertexArrayRange; IVertexArrayRange *_CurrentVertexArrayRange;
@ -1273,7 +1269,7 @@ private:
uint32 _NbSetupMaterialCall; uint32 _NbSetupMaterialCall;
uint32 _NbSetupModelMatrixCall; uint32 _NbSetupModelMatrixCall;
bool _SumTextureMemoryUsed; bool _SumTextureMemoryUsed;
std::set<CTextureDrvInfosGL*> _TextureUsed; std::set<CTextureDrvInfosGL3*> _TextureUsed;
uint computeMipMapMemoryUsage(uint w, uint h, GLint glfmt) const; uint computeMipMapMemoryUsage(uint w, uint h, GLint glfmt) const;
// VBHard Lock Profiling // VBHard Lock Profiling
@ -1462,7 +1458,7 @@ public:
static CMaterial::CTexEnv _TexEnvReplace; static CMaterial::CTexEnv _TexEnvReplace;
// occlusion query // occlusion query
TOcclusionQueryList _OcclusionQueryList; TOcclusionQueryList _OcclusionQueryList;
COcclusionQueryGL *_CurrentOcclusionQuery; COcclusionQueryGL3 *_CurrentOcclusionQuery;
protected: protected:
// is the window active , // is the window active ,
bool _WndActive; bool _WndActive;
@ -1494,7 +1490,7 @@ private:
}; };
// *************************************************************************** // ***************************************************************************
class CVertexProgamDrvInfosGL : public IVertexProgramDrvInfos class CVertexProgamDrvInfosGL3 : public IVertexProgramDrvInfos
{ {
public: public:
// The GL Id. // The GL Id.
@ -1506,7 +1502,7 @@ public:
/** EXTVertexShader specific /** EXTVertexShader specific
* handle of allocated variants * handle of allocated variants
*/ */
GLuint Variants[CDriverGL::EVSNumVariants]; GLuint Variants[CDriverGL3::EVSNumVariants];
/** EXTVertexShader specific /** EXTVertexShader specific
* Used input registers. * Used input registers.
* This allow to activate only the gl arrays that are needed by a given shader. * This allow to activate only the gl arrays that are needed by a given shader.
@ -1515,7 +1511,7 @@ public:
// The gl id is auto created here. // The gl id is auto created here.
CVertexProgamDrvInfosGL (CDriverGL *drv, ItVtxPrgDrvInfoPtrList it); CVertexProgamDrvInfosGL3 (CDriverGL3 *drv, ItVtxPrgDrvInfoPtrList it);
}; };
#ifdef NL_STATIC #ifdef NL_STATIC

@ -525,7 +525,7 @@ namespace NL3D {
#ifdef USE_OPENGLES #ifdef USE_OPENGLES
namespace NLDRIVERGLES { namespace NLDRIVERGLES {
#else #else
namespace NLDRIVERGL { namespace NLDRIVERGL3 {
#endif #endif
#endif #endif

@ -29,7 +29,7 @@ namespace NL3D {
#ifdef USE_OPENGLES #ifdef USE_OPENGLES
namespace NLDRIVERGLES { namespace NLDRIVERGLES {
#else #else
namespace NLDRIVERGL { namespace NLDRIVERGL3 {
#endif #endif
#endif #endif

@ -41,12 +41,12 @@ namespace NL3D {
#ifdef USE_OPENGLES #ifdef USE_OPENGLES
namespace NLDRIVERGLES { namespace NLDRIVERGLES {
#else #else
namespace NLDRIVERGL { namespace NLDRIVERGL3 {
#endif #endif
#endif #endif
// ************************************************************************************* // *************************************************************************************
CDriverGL::CCursor::CCursor() : ColorDepth(CDriverGL::ColorDepth32), CDriverGL3::CCursor::CCursor() : ColorDepth(CDriverGL3::ColorDepth32),
OrigHeight(32), OrigHeight(32),
HotspotScale(1.f), HotspotScale(1.f),
HotspotOffsetX(0), HotspotOffsetX(0),
@ -63,13 +63,13 @@ CDriverGL::CCursor::CCursor() : ColorDepth(CDriverGL::ColorDepth32),
} }
// ************************************************************************************* // *************************************************************************************
CDriverGL::CCursor::~CCursor() CDriverGL3::CCursor::~CCursor()
{ {
reset(); reset();
} }
// ************************************************************************************* // *************************************************************************************
void CDriverGL::CCursor::reset() void CDriverGL3::CCursor::reset()
{ {
if (Cursor != EmptyCursor) if (Cursor != EmptyCursor)
{ {
@ -84,7 +84,7 @@ void CDriverGL::CCursor::reset()
} }
// ************************************************************************************* // *************************************************************************************
CDriverGL::CCursor& CDriverGL::CCursor::operator= (const CDriverGL::CCursor& from) CDriverGL3::CCursor& CDriverGL3::CCursor::operator= (const CDriverGL3::CCursor& from)
{ {
if (&from == this) if (&from == this)
return *this; return *this;
@ -105,7 +105,7 @@ CDriverGL::CCursor& CDriverGL::CCursor::operator= (const CDriverGL::CCursor& fro
} }
// ************************************************************************************* // *************************************************************************************
bool CDriverGL::isAlphaBlendedCursorSupported() bool CDriverGL3::isAlphaBlendedCursorSupported()
{ {
if (!_AlphaBlendedCursorSupportRetrieved) if (!_AlphaBlendedCursorSupportRetrieved)
{ {
@ -143,7 +143,7 @@ bool CDriverGL::isAlphaBlendedCursorSupported()
} }
// ************************************************************************************* // *************************************************************************************
void CDriverGL::addCursor(const std::string &name, const NLMISC::CBitmap &cursorBitmap) void CDriverGL3::addCursor(const std::string &name, const NLMISC::CBitmap &cursorBitmap)
{ {
if (!isAlphaBlendedCursorSupported()) return; if (!isAlphaBlendedCursorSupported()) return;
@ -269,7 +269,7 @@ void CDriverGL::addCursor(const std::string &name, const NLMISC::CBitmap &cursor
} }
// ************************************************************************************* // *************************************************************************************
void CDriverGL::createCursors() void CDriverGL3::createCursors()
{ {
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
_DefaultCursor = LoadCursor(NULL, IDC_ARROW); _DefaultCursor = LoadCursor(NULL, IDC_ARROW);
@ -293,7 +293,7 @@ void CDriverGL::createCursors()
} }
// ************************************************************************************* // *************************************************************************************
void CDriverGL::releaseCursors() void CDriverGL3::releaseCursors()
{ {
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
SetClassLongPtr(_win, GCLP_HCURSOR, 0); SetClassLongPtr(_win, GCLP_HCURSOR, 0);
@ -307,13 +307,13 @@ void CDriverGL::releaseCursors()
} }
// ************************************************************************************* // *************************************************************************************
void CDriverGL::updateCursor(bool forceRebuild) void CDriverGL3::updateCursor(bool forceRebuild)
{ {
setCursor(_CurrName, _CurrCol, _CurrRot, _CurrHotSpotX, _CurrHotSpotY, forceRebuild); setCursor(_CurrName, _CurrCol, _CurrRot, _CurrHotSpotX, _CurrHotSpotY, forceRebuild);
} }
// ************************************************************************************* // *************************************************************************************
void CDriverGL::setCursor(const std::string &name, NLMISC::CRGBA col, uint8 rot, sint hotSpotX, sint hotSpotY, bool forceRebuild) void CDriverGL3::setCursor(const std::string &name, NLMISC::CRGBA col, uint8 rot, sint hotSpotX, sint hotSpotY, bool forceRebuild)
{ {
// don't update cursor if it's hidden or if custom cursors are not suppported // don't update cursor if it's hidden or if custom cursors are not suppported
if (!isAlphaBlendedCursorSupported() || _CurrName == "none") return; if (!isAlphaBlendedCursorSupported() || _CurrName == "none") return;
@ -386,13 +386,13 @@ void CDriverGL::setCursor(const std::string &name, NLMISC::CRGBA col, uint8 rot,
} }
// ************************************************************************************* // *************************************************************************************
void CDriverGL::setCursorScale(float scale) void CDriverGL3::setCursorScale(float scale)
{ {
_CursorScale = scale; _CursorScale = scale;
} }
// ************************************************************************************* // *************************************************************************************
nlCursor CDriverGL::buildCursor(const CBitmap &src, NLMISC::CRGBA col, uint8 rot, sint hotSpotX, sint hotSpotY) nlCursor CDriverGL3::buildCursor(const CBitmap &src, NLMISC::CRGBA col, uint8 rot, sint hotSpotX, sint hotSpotY)
{ {
nlassert(isAlphaBlendedCursorSupported()); nlassert(isAlphaBlendedCursorSupported());
@ -417,9 +417,9 @@ nlCursor CDriverGL::buildCursor(const CBitmap &src, NLMISC::CRGBA col, uint8 rot
// ************************************************************************************* // *************************************************************************************
void CDriverGL::setSystemArrow() void CDriverGL3::setSystemArrow()
{ {
H_AUTO_OGL(CDriverGL_setSystemArrow); H_AUTO_OGL(CDriverGL3_setSystemArrow);
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
if (isSystemCursorInClientArea() || isSystemCursorCaptured()) if (isSystemCursorInClientArea() || isSystemCursorCaptured())
@ -436,9 +436,9 @@ void CDriverGL::setSystemArrow()
} }
// *************************************************************************** // ***************************************************************************
void CDriverGL::showCursor(bool b) void CDriverGL3::showCursor(bool b)
{ {
H_AUTO_OGL(CDriverGL_showCursor); H_AUTO_OGL(CDriverGL3_showCursor);
if (_win == EmptyWindow) if (_win == EmptyWindow)
return; return;
@ -503,9 +503,9 @@ void CDriverGL::showCursor(bool b)
} }
// *************************************************************************** // ***************************************************************************
void CDriverGL::setMousePos(float x, float y) void CDriverGL3::setMousePos(float x, float y)
{ {
H_AUTO_OGL(CDriverGL_setMousePos) H_AUTO_OGL(CDriverGL3_setMousePos)
if (_win == EmptyWindow) if (_win == EmptyWindow)
return; return;
@ -557,9 +557,9 @@ void CDriverGL::setMousePos(float x, float y)
} }
// *************************************************************************** // ***************************************************************************
void CDriverGL::setCapture (bool b) void CDriverGL3::setCapture (bool b)
{ {
H_AUTO_OGL(CDriverGL_setCapture); H_AUTO_OGL(CDriverGL3_setCapture);
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
@ -603,7 +603,7 @@ void CDriverGL::setCapture (bool b)
} }
// *************************************************************************** // ***************************************************************************
bool CDriverGL::isSystemCursorInClientArea() bool CDriverGL3::isSystemCursorInClientArea()
{ {
if (!_CurrentMode.Windowed) if (!_CurrentMode.Windowed)
{ {
@ -655,9 +655,9 @@ bool CDriverGL::isSystemCursorInClientArea()
} }
// *************************************************************************** // ***************************************************************************
bool CDriverGL::isSystemCursorCaptured() bool CDriverGL3::isSystemCursorCaptured()
{ {
H_AUTO_OGL(CDriverGL_isSystemCursorCaptured); H_AUTO_OGL(CDriverGL3_isSystemCursorCaptured);
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
return GetCapture() == _win; return GetCapture() == _win;
@ -667,9 +667,9 @@ bool CDriverGL::isSystemCursorCaptured()
} }
// *************************************************************************** // ***************************************************************************
NLMISC::IMouseDevice* CDriverGL::enableLowLevelMouse(bool enable, bool exclusive) NLMISC::IMouseDevice* CDriverGL3::enableLowLevelMouse(bool enable, bool exclusive)
{ {
H_AUTO_OGL(CDriverGL_enableLowLevelMouse); H_AUTO_OGL(CDriverGL3_enableLowLevelMouse);
NLMISC::IMouseDevice *res = NULL; NLMISC::IMouseDevice *res = NULL;
@ -705,9 +705,9 @@ NLMISC::IMouseDevice* CDriverGL::enableLowLevelMouse(bool enable, bool exclusive
} }
// *************************************************************************** // ***************************************************************************
NLMISC::IKeyboardDevice* CDriverGL::enableLowLevelKeyboard(bool enable) NLMISC::IKeyboardDevice* CDriverGL3::enableLowLevelKeyboard(bool enable)
{ {
H_AUTO_OGL(CDriverGL_enableLowLevelKeyboard); H_AUTO_OGL(CDriverGL3_enableLowLevelKeyboard);
NLMISC::IKeyboardDevice *res = NULL; NLMISC::IKeyboardDevice *res = NULL;
@ -743,9 +743,9 @@ NLMISC::IKeyboardDevice* CDriverGL::enableLowLevelKeyboard(bool enable)
} }
// *************************************************************************** // ***************************************************************************
NLMISC::IInputDeviceManager* CDriverGL::getLowLevelInputDeviceManager() NLMISC::IInputDeviceManager* CDriverGL3::getLowLevelInputDeviceManager()
{ {
H_AUTO_OGL(CDriverGL_getLowLevelInputDeviceManager); H_AUTO_OGL(CDriverGL3_getLowLevelInputDeviceManager);
NLMISC::IInputDeviceManager *res = NULL; NLMISC::IInputDeviceManager *res = NULL;
@ -762,9 +762,9 @@ NLMISC::IInputDeviceManager* CDriverGL::getLowLevelInputDeviceManager()
} }
// *************************************************************************** // ***************************************************************************
uint CDriverGL::getDoubleClickDelay(bool hardwareMouse) uint CDriverGL3::getDoubleClickDelay(bool hardwareMouse)
{ {
H_AUTO_OGL(CDriverGL_getDoubleClickDelay); H_AUTO_OGL(CDriverGL3_getDoubleClickDelay);
uint res = 250; uint res = 250;
@ -811,7 +811,7 @@ uint CDriverGL::getDoubleClickDelay(bool hardwareMouse)
return res; return res;
} }
bool CDriverGL::getBestCursorSize(uint srcWidth, uint srcHeight, uint &dstWidth, uint &dstHeight) bool CDriverGL3::getBestCursorSize(uint srcWidth, uint srcHeight, uint &dstWidth, uint &dstHeight)
{ {
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
@ -834,7 +834,7 @@ bool CDriverGL::getBestCursorSize(uint srcWidth, uint srcHeight, uint &dstWidth,
return true; return true;
} }
bool CDriverGL::convertBitmapToCursor(const NLMISC::CBitmap &bitmap, nlCursor &cursor, uint iconWidth, uint iconHeight, uint iconDepth, const NLMISC::CRGBA &col, sint hotSpotX, sint hotSpotY) bool CDriverGL3::convertBitmapToCursor(const NLMISC::CBitmap &bitmap, nlCursor &cursor, uint iconWidth, uint iconHeight, uint iconDepth, const NLMISC::CRGBA &col, sint hotSpotX, sint hotSpotY)
{ {
#if defined(NL_OS_WINDOWS) #if defined(NL_OS_WINDOWS)

@ -25,23 +25,23 @@ namespace NL3D {
#ifdef USE_OPENGLES #ifdef USE_OPENGLES
namespace NLDRIVERGLES { namespace NLDRIVERGLES {
#else #else
namespace NLDRIVERGL { namespace NLDRIVERGL3 {
#endif #endif
#endif #endif
// *************************************************************************** // ***************************************************************************
uint CDriverGL::getMaxLight () const uint CDriverGL3::getMaxLight () const
{ {
H_AUTO_OGL(CDriverGL_getMaxLight ) H_AUTO_OGL(CDriverGL3_getMaxLight )
// return min(maxLight supported by openGL, MaxLight=8). // return min(maxLight supported by openGL, MaxLight=8).
return _MaxDriverLight; return _MaxDriverLight;
} }
// *************************************************************************** // ***************************************************************************
void CDriverGL::setLight (uint8 num, const CLight& light) void CDriverGL3::setLight (uint8 num, const CLight& light)
{ {
H_AUTO_OGL(CDriverGL_setLight ) H_AUTO_OGL(CDriverGL3_setLight )
// bkup real light, for lightmap dynamic lighting purpose // bkup real light, for lightmap dynamic lighting purpose
if(num==0) if(num==0)
{ {
@ -55,9 +55,9 @@ void CDriverGL::setLight (uint8 num, const CLight& light)
// *************************************************************************** // ***************************************************************************
void CDriverGL::setLightInternal(uint8 num, const CLight& light) void CDriverGL3::setLightInternal(uint8 num, const CLight& light)
{ {
H_AUTO_OGL(CDriverGL_setLightInternal) H_AUTO_OGL(CDriverGL3_setLightInternal)
// Check light count is good // Check light count is good
// nlassert (num<_MaxDriverLight); // nlassert (num<_MaxDriverLight);
@ -164,9 +164,9 @@ void CDriverGL::setLightInternal(uint8 num, const CLight& light)
} }
// *************************************************************************** // ***************************************************************************
void CDriverGL::enableLight (uint8 num, bool enable) void CDriverGL3::enableLight (uint8 num, bool enable)
{ {
H_AUTO_OGL(CDriverGL_enableLight ) H_AUTO_OGL(CDriverGL3_enableLight )
// User call => set the User flag // User call => set the User flag
if(num<_MaxDriverLight) if(num<_MaxDriverLight)
{ {
@ -182,9 +182,9 @@ void CDriverGL::enableLight (uint8 num, bool enable)
// *************************************************************************** // ***************************************************************************
void CDriverGL::enableLightInternal(uint8 num, bool enable) void CDriverGL3::enableLightInternal(uint8 num, bool enable)
{ {
H_AUTO_OGL(CDriverGL_enableLightInternal) H_AUTO_OGL(CDriverGL3_enableLightInternal)
// Check light count is good // Check light count is good
// nlassert (num<_MaxDriverLight); // nlassert (num<_MaxDriverLight);
@ -205,9 +205,9 @@ void CDriverGL::enableLightInternal(uint8 num, bool enable)
// *************************************************************************** // ***************************************************************************
void CDriverGL::setAmbientColor (CRGBA color) void CDriverGL3::setAmbientColor (CRGBA color)
{ {
H_AUTO_OGL(CDriverGL_setAmbientColor ) H_AUTO_OGL(CDriverGL3_setAmbientColor )
// Gl array // Gl array
GLfloat array[4]; GLfloat array[4];
array[0]=(float)color.R/255.f; array[0]=(float)color.R/255.f;
@ -221,9 +221,9 @@ void CDriverGL::setAmbientColor (CRGBA color)
// *************************************************************************** // ***************************************************************************
void CDriverGL::cleanLightSetup () void CDriverGL3::cleanLightSetup ()
{ {
H_AUTO_OGL(CDriverGL_cleanLightSetup ) H_AUTO_OGL(CDriverGL3_cleanLightSetup )
// Should be dirty // Should be dirty
nlassert (_LightSetupDirty); nlassert (_LightSetupDirty);
@ -311,9 +311,9 @@ void CDriverGL::cleanLightSetup ()
// *************************************************************************** // ***************************************************************************
void CDriverGL::setLightMapDynamicLight (bool enable, const CLight& light) void CDriverGL3::setLightMapDynamicLight (bool enable, const CLight& light)
{ {
H_AUTO_OGL(CDriverGL_setLightMapDynamicLight ) H_AUTO_OGL(CDriverGL3_setLightMapDynamicLight )
// just store, for future setup in lightmap material rendering // just store, for future setup in lightmap material rendering
_LightMapDynamicLightEnabled= enable; _LightMapDynamicLightEnabled= enable;
_LightMapDynamicLight= light; _LightMapDynamicLight= light;
@ -322,9 +322,9 @@ void CDriverGL::setLightMapDynamicLight (bool enable, const CLight& light)
// *************************************************************************** // ***************************************************************************
void CDriverGL::setupLightMapDynamicLighting(bool enable) void CDriverGL3::setupLightMapDynamicLighting(bool enable)
{ {
H_AUTO_OGL(CDriverGL_setupLightMapDynamicLighting) H_AUTO_OGL(CDriverGL3_setupLightMapDynamicLighting)
// start lightmap dynamic lighting // start lightmap dynamic lighting
if(enable) if(enable)
{ {

@ -27,7 +27,7 @@ namespace NL3D {
#ifdef USE_OPENGLES #ifdef USE_OPENGLES
namespace NLDRIVERGLES { namespace NLDRIVERGLES {
#else #else
namespace NLDRIVERGL { namespace NLDRIVERGL3 {
#endif #endif
#endif #endif
@ -122,9 +122,9 @@ static inline void convTexAddr(ITexture *tex, CMaterial::TTexAddressingMode mode
} }
// -------------------------------------------------- // --------------------------------------------------
void CDriverGL::setTextureEnvFunction(uint stage, CMaterial& mat) void CDriverGL3::setTextureEnvFunction(uint stage, CMaterial& mat)
{ {
H_AUTO_OGL(CDriverGL_setTextureEnvFunction) H_AUTO_OGL(CDriverGL3_setTextureEnvFunction)
ITexture *text= mat.getTexture(uint8(stage)); ITexture *text= mat.getTexture(uint8(stage));
if(text) if(text)
{ {
@ -179,9 +179,9 @@ void CDriverGL::setTextureEnvFunction(uint stage, CMaterial& mat)
} }
//-------------------------------- //--------------------------------
void CDriverGL::setupUserTextureMatrix(uint numStages, CMaterial& mat) void CDriverGL3::setupUserTextureMatrix(uint numStages, CMaterial& mat)
{ {
H_AUTO_OGL(CDriverGL_setupUserTextureMatrix) H_AUTO_OGL(CDriverGL3_setupUserTextureMatrix)
if ( if (
(_UserTexMatEnabled != 0 && (mat.getFlags() & IDRV_MAT_USER_TEX_MAT_ALL) == 0) (_UserTexMatEnabled != 0 && (mat.getFlags() & IDRV_MAT_USER_TEX_MAT_ALL) == 0)
|| (mat.getFlags() & IDRV_MAT_USER_TEX_MAT_ALL) != 0 || (mat.getFlags() & IDRV_MAT_USER_TEX_MAT_ALL) != 0
@ -220,9 +220,9 @@ void CDriverGL::setupUserTextureMatrix(uint numStages, CMaterial& mat)
} }
} }
void CDriverGL::disableUserTextureMatrix() void CDriverGL3::disableUserTextureMatrix()
{ {
H_AUTO_OGL(CDriverGL_disableUserTextureMatrix) H_AUTO_OGL(CDriverGL3_disableUserTextureMatrix)
if (_UserTexMatEnabled != 0) if (_UserTexMatEnabled != 0)
{ {
glMatrixMode(GL_TEXTURE); glMatrixMode(GL_TEXTURE);
@ -245,9 +245,9 @@ void CDriverGL::disableUserTextureMatrix()
} }
// -------------------------------------------------- // --------------------------------------------------
CMaterial::TShader CDriverGL::getSupportedShader(CMaterial::TShader shader) CMaterial::TShader CDriverGL3::getSupportedShader(CMaterial::TShader shader)
{ {
H_AUTO_OGL(CDriverGL_CDriverGL) H_AUTO_OGL(CDriverGL3_CDriverGL)
switch (shader) switch (shader)
{ {
case CMaterial::PerPixelLighting: return _SupportPerPixelShader ? CMaterial::PerPixelLighting : CMaterial::Normal; case CMaterial::PerPixelLighting: return _SupportPerPixelShader ? CMaterial::PerPixelLighting : CMaterial::Normal;
@ -260,9 +260,9 @@ CMaterial::TShader CDriverGL::getSupportedShader(CMaterial::TShader shader)
} }
// -------------------------------------------------- // --------------------------------------------------
void CDriverGL::setTextureShaders(const uint8 *addressingModes, const CSmartPtr<ITexture> *textures) void CDriverGL3::setTextureShaders(const uint8 *addressingModes, const CSmartPtr<ITexture> *textures)
{ {
H_AUTO_OGL(CDriverGL_setTextureShaders) H_AUTO_OGL(CDriverGL3_setTextureShaders)
GLenum glAddrMode; GLenum glAddrMode;
for (uint stage = 0; stage < IDRV_MAT_MAXTEXTURES; ++stage) for (uint stage = 0; stage < IDRV_MAT_MAXTEXTURES; ++stage)
{ {
@ -280,10 +280,10 @@ void CDriverGL::setTextureShaders(const uint8 *addressingModes, const CSmartPtr<
} }
// -------------------------------------------------- // --------------------------------------------------
bool CDriverGL::setupMaterial(CMaterial& mat) bool CDriverGL3::setupMaterial(CMaterial& mat)
{ {
H_AUTO_OGL(CDriverGL_setupMaterial) H_AUTO_OGL(CDriverGL3_setupMaterial)
CShaderGL* pShader; CShaderGL3* pShader;
GLenum glenum = GL_ZERO; GLenum glenum = GL_ZERO;
uint32 touched = mat.getTouched(); uint32 touched = mat.getTouched();
uint stage; uint stage;
@ -299,12 +299,12 @@ bool CDriverGL::setupMaterial(CMaterial& mat)
// insert into driver list. (so it is deleted when driver is deleted). // insert into driver list. (so it is deleted when driver is deleted).
ItMatDrvInfoPtrList it= _MatDrvInfos.insert(_MatDrvInfos.end(), (NL3D::IMaterialDrvInfos*)NULL); ItMatDrvInfoPtrList it= _MatDrvInfos.insert(_MatDrvInfos.end(), (NL3D::IMaterialDrvInfos*)NULL);
// create and set iterator, for future deletion. // create and set iterator, for future deletion.
*it= mat._MatDrvInfo= new CShaderGL(this, it); *it= mat._MatDrvInfo= new CShaderGL3(this, it);
// Must create all OpenGL shader states. // Must create all OpenGL shader states.
touched= IDRV_TOUCHED_ALL; touched= IDRV_TOUCHED_ALL;
} }
pShader=static_cast<CShaderGL*>((IMaterialDrvInfos*)(mat._MatDrvInfo)); pShader=static_cast<CShaderGL3*>((IMaterialDrvInfos*)(mat._MatDrvInfo));
// 1. Setup modified fields of material. // 1. Setup modified fields of material.
//===================================== //=====================================
@ -561,9 +561,9 @@ bool CDriverGL::setupMaterial(CMaterial& mat)
} }
// *************************************************************************** // ***************************************************************************
sint CDriverGL::beginMultiPass() sint CDriverGL3::beginMultiPass()
{ {
H_AUTO_OGL(CDriverGL_beginMultiPass) H_AUTO_OGL(CDriverGL3_beginMultiPass)
// Depending on material type and hardware, return number of pass required to draw this material. // Depending on material type and hardware, return number of pass required to draw this material.
switch(_CurrentMaterialSupportedShader) switch(_CurrentMaterialSupportedShader)
{ {
@ -588,9 +588,9 @@ sint CDriverGL::beginMultiPass()
} }
// *************************************************************************** // ***************************************************************************
void CDriverGL::setupPass(uint pass) void CDriverGL3::setupPass(uint pass)
{ {
H_AUTO_OGL(CDriverGL_setupPass) H_AUTO_OGL(CDriverGL3_setupPass)
switch(_CurrentMaterialSupportedShader) switch(_CurrentMaterialSupportedShader)
{ {
case CMaterial::LightMap: case CMaterial::LightMap:
@ -621,9 +621,9 @@ void CDriverGL::setupPass(uint pass)
} }
// *************************************************************************** // ***************************************************************************
void CDriverGL::endMultiPass() void CDriverGL3::endMultiPass()
{ {
H_AUTO_OGL(CDriverGL_endMultiPass) H_AUTO_OGL(CDriverGL3_endMultiPass)
switch(_CurrentMaterialSupportedShader) switch(_CurrentMaterialSupportedShader)
{ {
case CMaterial::LightMap: case CMaterial::LightMap:
@ -653,9 +653,9 @@ void CDriverGL::endMultiPass()
} }
// *************************************************************************** // ***************************************************************************
void CDriverGL::computeLightMapInfos (const CMaterial &mat) void CDriverGL3::computeLightMapInfos (const CMaterial &mat)
{ {
H_AUTO_OGL(CDriverGL_computeLightMapInfos ) H_AUTO_OGL(CDriverGL3_computeLightMapInfos )
static const uint32 RGBMaskPacked = CRGBA(255,255,255,0).getPacked(); static const uint32 RGBMaskPacked = CRGBA(255,255,255,0).getPacked();
// For optimisation consideration, suppose there is not too much lightmap. // For optimisation consideration, suppose there is not too much lightmap.
@ -694,9 +694,9 @@ void CDriverGL::computeLightMapInfos (const CMaterial &mat)
} }
// *************************************************************************** // ***************************************************************************
sint CDriverGL::beginLightMapMultiPass () sint CDriverGL3::beginLightMapMultiPass ()
{ {
H_AUTO_OGL(CDriverGL_beginLightMapMultiPass ) H_AUTO_OGL(CDriverGL3_beginLightMapMultiPass )
const CMaterial &mat= *_CurrentMaterial; const CMaterial &mat= *_CurrentMaterial;
// compute how many lightmap and pass we must process. // compute how many lightmap and pass we must process.
@ -726,9 +726,9 @@ sint CDriverGL::beginLightMapMultiPass ()
} }
// *************************************************************************** // ***************************************************************************
void CDriverGL::setupLightMapPass(uint pass) void CDriverGL3::setupLightMapPass(uint pass)
{ {
H_AUTO_OGL(CDriverGL_setupLightMapPass) H_AUTO_OGL(CDriverGL3_setupLightMapPass)
const CMaterial &mat= *_CurrentMaterial; const CMaterial &mat= *_CurrentMaterial;
// common colors // common colors
@ -1052,9 +1052,9 @@ void CDriverGL::setupLightMapPass(uint pass)
} }
// *************************************************************************** // ***************************************************************************
void CDriverGL::endLightMapMultiPass() void CDriverGL3::endLightMapMultiPass()
{ {
H_AUTO_OGL(CDriverGL_endLightMapMultiPass) H_AUTO_OGL(CDriverGL3_endLightMapMultiPass)
// Flag the fact that VertexSetup is dirty (special lightmap). reseted in activeVertexBuffer(), and setupMaterial() // Flag the fact that VertexSetup is dirty (special lightmap). reseted in activeVertexBuffer(), and setupMaterial()
// NB: if no lightmaps, no setupUVPtr() has been called => don't need to flag // NB: if no lightmaps, no setupUVPtr() has been called => don't need to flag
// (important else crash if graphist error while exporting a Lightmap material, with a MeshVertexProgram (WindTree) ) // (important else crash if graphist error while exporting a Lightmap material, with a MeshVertexProgram (WindTree) )
@ -1083,9 +1083,9 @@ void CDriverGL::endLightMapMultiPass()
} }
// *************************************************************************** // ***************************************************************************
void CDriverGL::resetLightMapVertexSetup() void CDriverGL3::resetLightMapVertexSetup()
{ {
H_AUTO_OGL(CDriverGL_resetLightMapVertexSetup) H_AUTO_OGL(CDriverGL3_resetLightMapVertexSetup)
// special for all stage, std UV behavior. // special for all stage, std UV behavior.
for(uint i = 0; i < inlGetNumTextStages(); i++) for(uint i = 0; i < inlGetNumTextStages(); i++)
{ {
@ -1104,27 +1104,27 @@ void CDriverGL::resetLightMapVertexSetup()
} }
// *************************************************************************** // ***************************************************************************
void CDriverGL::startSpecularBatch() void CDriverGL3::startSpecularBatch()
{ {
H_AUTO_OGL(CDriverGL_startSpecularBatch) H_AUTO_OGL(CDriverGL3_startSpecularBatch)
_SpecularBatchOn= true; _SpecularBatchOn= true;
setupSpecularBegin(); setupSpecularBegin();
} }
// *************************************************************************** // ***************************************************************************
void CDriverGL::endSpecularBatch() void CDriverGL3::endSpecularBatch()
{ {
H_AUTO_OGL(CDriverGL_endSpecularBatch) H_AUTO_OGL(CDriverGL3_endSpecularBatch)
_SpecularBatchOn= false; _SpecularBatchOn= false;
setupSpecularEnd(); setupSpecularEnd();
} }
// *************************************************************************** // ***************************************************************************
void CDriverGL::setupSpecularBegin() void CDriverGL3::setupSpecularBegin()
{ {
H_AUTO_OGL(CDriverGL_setupSpecularBegin) H_AUTO_OGL(CDriverGL3_setupSpecularBegin)
// ---- Reset any textures with id>=2 // ---- Reset any textures with id>=2
uint stage = 2; uint stage = 2;
for(; stage < inlGetNumTextStages(); stage++) for(; stage < inlGetNumTextStages(); stage++)
@ -1150,7 +1150,7 @@ void CDriverGL::setupSpecularBegin()
_DriverGLStates.activeTextureARB(1); _DriverGLStates.activeTextureARB(1);
// todo hulud remove // todo hulud remove
// _DriverGLStates.setTextureMode(CDriverGLStates::TextureCubeMap); // _DriverGLStates.setTextureMode(CDriverGLStates3::TextureCubeMap);
_DriverGLStates.setTexGenMode (1, GL_REFLECTION_MAP_ARB); _DriverGLStates.setTexGenMode (1, GL_REFLECTION_MAP_ARB);
// setup the good matrix for stage 1. // setup the good matrix for stage 1.
@ -1160,9 +1160,9 @@ void CDriverGL::setupSpecularBegin()
} }
// *************************************************************************** // ***************************************************************************
void CDriverGL::setupSpecularEnd() void CDriverGL3::setupSpecularEnd()
{ {
H_AUTO_OGL(CDriverGL_setupSpecularEnd) H_AUTO_OGL(CDriverGL3_setupSpecularEnd)
// Disable Texture coord generation. // Disable Texture coord generation.
_DriverGLStates.activeTextureARB(1); _DriverGLStates.activeTextureARB(1);
_DriverGLStates.setTexGenMode(1, 0); _DriverGLStates.setTexGenMode(1, 0);
@ -1174,9 +1174,9 @@ void CDriverGL::setupSpecularEnd()
} }
// *************************************************************************** // ***************************************************************************
sint CDriverGL::beginSpecularMultiPass() sint CDriverGL3::beginSpecularMultiPass()
{ {
H_AUTO_OGL(CDriverGL_beginSpecularMultiPass) H_AUTO_OGL(CDriverGL3_beginSpecularMultiPass)
const CMaterial &mat= *_CurrentMaterial; const CMaterial &mat= *_CurrentMaterial;
// activate the 2 textures here // activate the 2 textures here
@ -1208,9 +1208,9 @@ sint CDriverGL::beginSpecularMultiPass()
} }
// *************************************************************************** // ***************************************************************************
void CDriverGL::setupSpecularPass(uint pass) void CDriverGL3::setupSpecularPass(uint pass)
{ {
H_AUTO_OGL(CDriverGL_setupSpecularPass) H_AUTO_OGL(CDriverGL3_setupSpecularPass)
const CMaterial &mat= *_CurrentMaterial; const CMaterial &mat= *_CurrentMaterial;
// Manage the rare case when the SpecularMap is not provided (error of a graphist). // Manage the rare case when the SpecularMap is not provided (error of a graphist).
@ -1391,7 +1391,7 @@ void CDriverGL::setupSpecularPass(uint pass)
// Just display the texture // Just display the texture
_DriverGLStates.enableBlend(false); _DriverGLStates.enableBlend(false);
_DriverGLStates.activeTextureARB(1); _DriverGLStates.activeTextureARB(1);
_DriverGLStates.setTextureMode(CDriverGLStates::TextureDisabled); _DriverGLStates.setTextureMode(CDriverGLStates3::TextureDisabled);
} }
else else
{ {
@ -1432,9 +1432,9 @@ void CDriverGL::setupSpecularPass(uint pass)
} }
// *************************************************************************** // ***************************************************************************
void CDriverGL::endSpecularMultiPass() void CDriverGL3::endSpecularMultiPass()
{ {
H_AUTO_OGL(CDriverGL_endSpecularMultiPass) H_AUTO_OGL(CDriverGL3_endSpecularMultiPass)
// End specular , only if not Batching mode. // End specular , only if not Batching mode.
if(!_SpecularBatchOn) if(!_SpecularBatchOn)
setupSpecularEnd(); setupSpecularEnd();
@ -1461,9 +1461,9 @@ const uint SpecularExpStep = 8;
const uint SpecularMapSize = 32; */ const uint SpecularMapSize = 32; */
// *************************************************************************** // ***************************************************************************
CTextureCube *CDriverGL::getSpecularCubeMap(uint exp) CTextureCube *CDriverGL3::getSpecularCubeMap(uint exp)
{ {
H_AUTO_OGL(CDriverGL__getSpecularCubeMap) H_AUTO_OGL(CDriverGL3__getSpecularCubeMap)
const uint DiffuseMapSize = 64; const uint DiffuseMapSize = 64;
const uint SpecularMapSize = 32; const uint SpecularMapSize = 32;
const uint SpecularMapSizeHighExponent = 64; const uint SpecularMapSizeHighExponent = 64;
@ -1560,9 +1560,9 @@ CTextureCube *CDriverGL::getSpecularCubeMap(uint exp)
} }
// *************************************************************************** // ***************************************************************************
sint CDriverGL::beginPPLMultiPass() sint CDriverGL3::beginPPLMultiPass()
{ {
H_AUTO_OGL(CDriverGL_beginPPLMultiPass) H_AUTO_OGL(CDriverGL3_beginPPLMultiPass)
#ifdef NL_DEBUG #ifdef NL_DEBUG
nlassert(supportPerPixelLighting(true)); // make sure the hardware can do that nlassert(supportPerPixelLighting(true)); // make sure the hardware can do that
#endif #endif
@ -1570,9 +1570,9 @@ sint CDriverGL::beginPPLMultiPass()
} }
// *************************************************************************** // ***************************************************************************
void CDriverGL::setupPPLPass(uint pass) void CDriverGL3::setupPPLPass(uint pass)
{ {
H_AUTO_OGL(CDriverGL_setupPPLPass) H_AUTO_OGL(CDriverGL3_setupPPLPass)
const CMaterial &mat= *_CurrentMaterial; const CMaterial &mat= *_CurrentMaterial;
nlassert(pass == 0); nlassert(pass == 0);
@ -1779,16 +1779,16 @@ void CDriverGL::setupPPLPass(uint pass)
} }
// *************************************************************************** // ***************************************************************************
void CDriverGL::endPPLMultiPass() void CDriverGL3::endPPLMultiPass()
{ {
H_AUTO_OGL(CDriverGL_endPPLMultiPass) H_AUTO_OGL(CDriverGL3_endPPLMultiPass)
// nothing to do there ... // nothing to do there ...
} }
// ******PER PIXEL LIGHTING, NO SPECULAR************************************** // ******PER PIXEL LIGHTING, NO SPECULAR**************************************
sint CDriverGL::beginPPLNoSpecMultiPass() sint CDriverGL3::beginPPLNoSpecMultiPass()
{ {
H_AUTO_OGL(CDriverGL_beginPPLNoSpecMultiPass) H_AUTO_OGL(CDriverGL3_beginPPLNoSpecMultiPass)
#ifdef NL_DEBUG #ifdef NL_DEBUG
nlassert(supportPerPixelLighting(false)); // make sure the hardware can do that nlassert(supportPerPixelLighting(false)); // make sure the hardware can do that
#endif #endif
@ -1796,9 +1796,9 @@ sint CDriverGL::beginPPLNoSpecMultiPass()
} }
// ******PER PIXEL LIGHTING, NO SPECULAR************************************** // ******PER PIXEL LIGHTING, NO SPECULAR**************************************
void CDriverGL::setupPPLNoSpecPass(uint pass) void CDriverGL3::setupPPLNoSpecPass(uint pass)
{ {
H_AUTO_OGL(CDriverGL_setupPPLNoSpecPass) H_AUTO_OGL(CDriverGL3_setupPPLNoSpecPass)
const CMaterial &mat= *_CurrentMaterial; const CMaterial &mat= *_CurrentMaterial;
nlassert(pass == 0); nlassert(pass == 0);
@ -1887,14 +1887,14 @@ void CDriverGL::setupPPLNoSpecPass(uint pass)
} }
// ******PER PIXEL LIGHTING, NO SPECULAR************************************** // ******PER PIXEL LIGHTING, NO SPECULAR**************************************
void CDriverGL::endPPLNoSpecMultiPass() void CDriverGL3::endPPLNoSpecMultiPass()
{ {
H_AUTO_OGL(CDriverGL_endPPLNoSpecMultiPass) H_AUTO_OGL(CDriverGL3_endPPLNoSpecMultiPass)
// nothing to do there ... // nothing to do there ...
} }
// *************************************************************************** // ***************************************************************************
/* sint CDriverGL::beginCausticsMultiPass(const CMaterial &mat) /* sint CDriverGL3::beginCausticsMultiPass(const CMaterial &mat)
{ {
nlassert(mat.getShader() == CMaterial::Caustics); nlassert(mat.getShader() == CMaterial::Caustics);
if (!_Extensions.ARBTextureCubeMap) return 1; if (!_Extensions.ARBTextureCubeMap) return 1;
@ -1908,7 +1908,7 @@ void CDriverGL::endPPLNoSpecMultiPass()
}*/ }*/
// *************************************************************************** // ***************************************************************************
/*inline void CDriverGL::setupCausticsFirstTex(const CMaterial &mat) /*inline void CDriverGL3::setupCausticsFirstTex(const CMaterial &mat)
{ {
/// setup texture 0 /// setup texture 0
activateTexture(0, mat.getTexture(0)); activateTexture(0, mat.getTexture(0));
@ -1921,14 +1921,14 @@ void CDriverGL::endPPLNoSpecMultiPass()
} }
// *************************************************************************** // ***************************************************************************
inline void CDriverGL::setupCausticsSecondTex(uint stage) inline void CDriverGL3::setupCausticsSecondTex(uint stage)
{ {
activateTexture(stage, mat.getTexture(0)); activateTexture(stage, mat.getTexture(0));
_CausticCubeMap _CausticCubeMap
} }
// *************************************************************************** // ***************************************************************************
void CDriverGL::setupCausticsPass(const CMaterial &mat, uint pass) void CDriverGL3::setupCausticsPass(const CMaterial &mat, uint pass)
{ {
nlassert(mat.getShader() == CMaterial::Caustics); nlassert(mat.getShader() == CMaterial::Caustics);
@ -1960,7 +1960,7 @@ void CDriverGL::setupCausticsPass(const CMaterial &mat, uint pass)
} }
// *************************************************************************** // ***************************************************************************
void CDriverGL::endCausticsMultiPass(const CMaterial &mat) void CDriverGL3::endCausticsMultiPass(const CMaterial &mat)
{ {
nlassert(mat.getShader() == CMaterial::Caustics); nlassert(mat.getShader() == CMaterial::Caustics);
@ -1968,17 +1968,17 @@ void CDriverGL::endCausticsMultiPass(const CMaterial &mat)
*/ */
// *************************************************************************** // ***************************************************************************
sint CDriverGL::beginCloudMultiPass () sint CDriverGL3::beginCloudMultiPass ()
{ {
H_AUTO_OGL(CDriverGL_beginCloudMultiPass ) H_AUTO_OGL(CDriverGL3_beginCloudMultiPass )
nlassert(_CurrentMaterial->getShader() == CMaterial::Cloud); nlassert(_CurrentMaterial->getShader() == CMaterial::Cloud);
return 1; return 1;
} }
// *************************************************************************** // ***************************************************************************
void CDriverGL::setupCloudPass (uint /* pass */) void CDriverGL3::setupCloudPass (uint /* pass */)
{ {
H_AUTO_OGL(CDriverGL_setupCloudPass ) H_AUTO_OGL(CDriverGL3_setupCloudPass )
nlassert(_CurrentMaterial->getShader() == CMaterial::Cloud); nlassert(_CurrentMaterial->getShader() == CMaterial::Cloud);
const CMaterial &mat= *_CurrentMaterial; const CMaterial &mat= *_CurrentMaterial;
@ -2113,9 +2113,9 @@ void CDriverGL::setupCloudPass (uint /* pass */)
} }
// *************************************************************************** // ***************************************************************************
void CDriverGL::endCloudMultiPass() void CDriverGL3::endCloudMultiPass()
{ {
H_AUTO_OGL(CDriverGL_endCloudMultiPass) H_AUTO_OGL(CDriverGL3_endCloudMultiPass)
nlassert(_CurrentMaterial->getShader() == CMaterial::Cloud); nlassert(_CurrentMaterial->getShader() == CMaterial::Cloud);
if (ATICloudShaderHandle) if (ATICloudShaderHandle)
{ {
@ -2126,9 +2126,9 @@ void CDriverGL::endCloudMultiPass()
} }
// *************************************************************************** // ***************************************************************************
sint CDriverGL::beginWaterMultiPass() sint CDriverGL3::beginWaterMultiPass()
{ {
H_AUTO_OGL(CDriverGL_beginWaterMultiPass) H_AUTO_OGL(CDriverGL3_beginWaterMultiPass)
nlassert(_CurrentMaterial->getShader() == CMaterial::Water); nlassert(_CurrentMaterial->getShader() == CMaterial::Water);
return 1; return 1;
} }
@ -2137,9 +2137,9 @@ sint CDriverGL::beginWaterMultiPass()
// *************************************************************************** // ***************************************************************************
/** water setup for ATI /** water setup for ATI
*/ */
void CDriverGL::setupWaterPassR200(const CMaterial &mat) void CDriverGL3::setupWaterPassR200(const CMaterial &mat)
{ {
H_AUTO_OGL(CDriverGL_setupWaterPassR200); H_AUTO_OGL(CDriverGL3_setupWaterPassR200);
#ifndef USE_OPENGLES #ifndef USE_OPENGLES
uint k; uint k;
@ -2219,9 +2219,9 @@ void CDriverGL::setupWaterPassR200(const CMaterial &mat)
// *************************************************************************** // ***************************************************************************
/** water setup for ARB_fragment_program /** water setup for ARB_fragment_program
*/ */
void CDriverGL::setupWaterPassARB(const CMaterial &mat) void CDriverGL3::setupWaterPassARB(const CMaterial &mat)
{ {
H_AUTO_OGL(CDriverGL_setupWaterPassARB); H_AUTO_OGL(CDriverGL3_setupWaterPassARB);
#ifndef USE_OPENGLES #ifndef USE_OPENGLES
uint k; uint k;
@ -2327,9 +2327,9 @@ static const uint8 WaterTexAddrMode[IDRV_MAT_MAXTEXTURES] =
static const float IdentityTexMat[4] = { 1.f, 0.f, 0.f, 1.f }; static const float IdentityTexMat[4] = { 1.f, 0.f, 0.f, 1.f };
// *************************************************************************** // ***************************************************************************
void CDriverGL::setupWaterPassNV20(const CMaterial &mat) void CDriverGL3::setupWaterPassNV20(const CMaterial &mat)
{ {
H_AUTO_OGL(CDriverGL_setupWaterPassNV20); H_AUTO_OGL(CDriverGL3_setupWaterPassNV20);
#ifndef USE_OPENGLES #ifndef USE_OPENGLES
static bool setupDone = false; static bool setupDone = false;
@ -2420,9 +2420,9 @@ void CDriverGL::setupWaterPassNV20(const CMaterial &mat)
} }
// *************************************************************************** // ***************************************************************************
void CDriverGL::setupWaterPass(uint /* pass */) void CDriverGL3::setupWaterPass(uint /* pass */)
{ {
H_AUTO_OGL(CDriverGL_setupWaterPass) H_AUTO_OGL(CDriverGL3_setupWaterPass)
nlassert (_CurrentMaterial); nlassert (_CurrentMaterial);
CMaterial &mat = *_CurrentMaterial; CMaterial &mat = *_CurrentMaterial;
nlassert(_CurrentMaterial->getShader() == CMaterial::Water); nlassert(_CurrentMaterial->getShader() == CMaterial::Water);
@ -2442,9 +2442,9 @@ void CDriverGL::setupWaterPass(uint /* pass */)
} }
// *************************************************************************** // ***************************************************************************
void CDriverGL::endWaterMultiPass() void CDriverGL3::endWaterMultiPass()
{ {
H_AUTO_OGL(CDriverGL_endWaterMultiPass); H_AUTO_OGL(CDriverGL3_endWaterMultiPass);
#ifndef USE_OPENGLES #ifndef USE_OPENGLES
nlassert(_CurrentMaterial->getShader() == CMaterial::Water); nlassert(_CurrentMaterial->getShader() == CMaterial::Water);

@ -23,14 +23,14 @@ namespace NL3D {
#ifdef USE_OPENGLES #ifdef USE_OPENGLES
namespace NLDRIVERGLES { namespace NLDRIVERGLES {
#else #else
namespace NLDRIVERGL { namespace NLDRIVERGL3 {
#endif #endif
#endif #endif
// *************************************************************************** // ***************************************************************************
void CDriverGL::setFrustum(float left, float right, float bottom, float top, float znear, float zfar, bool perspective) void CDriverGL3::setFrustum(float left, float right, float bottom, float top, float znear, float zfar, bool perspective)
{ {
H_AUTO_OGL(CDriverGL_setFrustum); H_AUTO_OGL(CDriverGL3_setFrustum);
glMatrixMode(GL_PROJECTION); glMatrixMode(GL_PROJECTION);
glLoadIdentity(); glLoadIdentity();
@ -62,9 +62,9 @@ void CDriverGL::setFrustum(float left, float right, float bottom, float top, flo
// *************************************************************************** // ***************************************************************************
void CDriverGL::setFrustumMatrix(CMatrix &frustumMatrix) void CDriverGL3::setFrustumMatrix(CMatrix &frustumMatrix)
{ {
H_AUTO_OGL(CDriverGL_setFrustum) H_AUTO_OGL(CDriverGL3_setFrustum)
glMatrixMode(GL_PROJECTION); glMatrixMode(GL_PROJECTION);
glLoadMatrixf(((GLfloat*)frustumMatrix.get())); glLoadMatrixf(((GLfloat*)frustumMatrix.get()));
@ -74,9 +74,9 @@ void CDriverGL::setFrustumMatrix(CMatrix &frustumMatrix)
// *************************************************************************** // ***************************************************************************
CMatrix CDriverGL::getFrustumMatrix() CMatrix CDriverGL3::getFrustumMatrix()
{ {
H_AUTO_OGL(CDriverGL_getFrustum) H_AUTO_OGL(CDriverGL3_getFrustum)
glMatrixMode(GL_PROJECTION); glMatrixMode(GL_PROJECTION);
@ -91,9 +91,9 @@ CMatrix CDriverGL::getFrustumMatrix()
} }
// *************************************************************************** // ***************************************************************************
void CDriverGL::setupViewMatrixEx(const CMatrix& mtx, const CVector &cameraPos) void CDriverGL3::setupViewMatrixEx(const CMatrix& mtx, const CVector &cameraPos)
{ {
H_AUTO_OGL(CDriverGL_setupViewMatrixEx) H_AUTO_OGL(CDriverGL3_setupViewMatrixEx)
_UserViewMtx= mtx; _UserViewMtx= mtx;
// Setup the matrix to transform the CScene basis in openGL basis. // Setup the matrix to transform the CScene basis in openGL basis.
@ -125,9 +125,9 @@ void CDriverGL::setupViewMatrixEx(const CMatrix& mtx, const CVector &cameraPos)
// *************************************************************************** // ***************************************************************************
void CDriverGL::setupViewMatrix(const CMatrix& mtx) void CDriverGL3::setupViewMatrix(const CMatrix& mtx)
{ {
H_AUTO_OGL(CDriverGL_setupViewMatrix) H_AUTO_OGL(CDriverGL3_setupViewMatrix)
_UserViewMtx= mtx; _UserViewMtx= mtx;
// Setup the matrix to transform the CScene basis in openGL basis. // Setup the matrix to transform the CScene basis in openGL basis.
@ -158,16 +158,16 @@ void CDriverGL::setupViewMatrix(const CMatrix& mtx)
} }
// *************************************************************************** // ***************************************************************************
CMatrix CDriverGL::getViewMatrix(void) const CMatrix CDriverGL3::getViewMatrix(void) const
{ {
H_AUTO_OGL(CDriverGL_getViewMatrix) H_AUTO_OGL(CDriverGL3_getViewMatrix)
return _UserViewMtx; return _UserViewMtx;
} }
// *************************************************************************** // ***************************************************************************
void CDriverGL::setupModelMatrix(const CMatrix& mtx) void CDriverGL3::setupModelMatrix(const CMatrix& mtx)
{ {
H_AUTO_OGL(CDriverGL_setupModelMatrix) H_AUTO_OGL(CDriverGL3_setupModelMatrix)
// profiling // profiling
_NbSetupModelMatrixCall++; _NbSetupModelMatrixCall++;
@ -185,9 +185,9 @@ void CDriverGL::setupModelMatrix(const CMatrix& mtx)
} }
// *************************************************************************** // ***************************************************************************
void CDriverGL::doRefreshRenderSetup() void CDriverGL3::doRefreshRenderSetup()
{ {
H_AUTO_OGL(CDriverGL_doRefreshRenderSetup) H_AUTO_OGL(CDriverGL3_doRefreshRenderSetup)
// Check if the light setup has been modified first // Check if the light setup has been modified first
if (_LightSetupDirty) if (_LightSetupDirty)
// Recompute light setup // Recompute light setup

@ -28,14 +28,14 @@ namespace NL3D {
#ifdef USE_OPENGLES #ifdef USE_OPENGLES
namespace NLDRIVERGLES { namespace NLDRIVERGLES {
#else #else
namespace NLDRIVERGL { namespace NLDRIVERGL3 {
#endif #endif
#endif #endif
// *************************************************************************** // ***************************************************************************
CDriverGLStates::CDriverGLStates() CDriverGLStates3::CDriverGLStates3()
{ {
H_AUTO_OGL(CDriverGLStates_CDriverGLStates) H_AUTO_OGL(CDriverGLStates3_CDriverGLStates)
_TextureCubeMapSupported= false; _TextureCubeMapSupported= false;
_CurrARBVertexBuffer = 0; _CurrARBVertexBuffer = 0;
_DepthRangeNear = 0.f; _DepthRangeNear = 0.f;
@ -47,9 +47,9 @@ CDriverGLStates::CDriverGLStates()
// *************************************************************************** // ***************************************************************************
void CDriverGLStates::init(bool supportTextureCubeMap, bool supportTextureRectangle, uint maxLight) void CDriverGLStates3::init(bool supportTextureCubeMap, bool supportTextureRectangle, uint maxLight)
{ {
H_AUTO_OGL(CDriverGLStates_init) H_AUTO_OGL(CDriverGLStates3_init)
_TextureCubeMapSupported= supportTextureCubeMap; _TextureCubeMapSupported= supportTextureCubeMap;
_TextureRectangleSupported= supportTextureRectangle; _TextureRectangleSupported= supportTextureRectangle;
_MaxDriverLight= maxLight; _MaxDriverLight= maxLight;
@ -82,9 +82,9 @@ void CDriverGLStates::init(bool supportTextureCubeMap, bool supportTextureRect
// *************************************************************************** // ***************************************************************************
void CDriverGLStates::forceDefaults(uint nbStages) void CDriverGLStates3::forceDefaults(uint nbStages)
{ {
H_AUTO_OGL(CDriverGLStates_forceDefaults); H_AUTO_OGL(CDriverGLStates3_forceDefaults);
// Enable / disable. // Enable / disable.
_CurFog= false; _CurFog= false;
@ -216,9 +216,9 @@ void CDriverGLStates::forceDefaults(uint nbStages)
} }
// *************************************************************************** // ***************************************************************************
void CDriverGLStates::enableBlend(uint enable) void CDriverGLStates3::enableBlend(uint enable)
{ {
H_AUTO_OGL(CDriverGLStates_enableBlend) H_AUTO_OGL(CDriverGLStates3_enableBlend)
// If different from current setup, update. // If different from current setup, update.
bool enabled= (enable!=0); bool enabled= (enable!=0);
#ifndef NL3D_GLSTATE_DISABLE_CACHE #ifndef NL3D_GLSTATE_DISABLE_CACHE
@ -236,9 +236,9 @@ void CDriverGLStates::enableBlend(uint enable)
} }
// *************************************************************************** // ***************************************************************************
void CDriverGLStates::enableCullFace(uint enable) void CDriverGLStates3::enableCullFace(uint enable)
{ {
H_AUTO_OGL(CDriverGLStates_enableCullFace) H_AUTO_OGL(CDriverGLStates3_enableCullFace)
// If different from current setup, update. // If different from current setup, update.
bool enabled= (enable!=0); bool enabled= (enable!=0);
#ifndef NL3D_GLSTATE_DISABLE_CACHE #ifndef NL3D_GLSTATE_DISABLE_CACHE
@ -256,9 +256,9 @@ void CDriverGLStates::enableCullFace(uint enable)
} }
// *************************************************************************** // ***************************************************************************
void CDriverGLStates::enableAlphaTest(uint enable) void CDriverGLStates3::enableAlphaTest(uint enable)
{ {
H_AUTO_OGL(CDriverGLStates_enableAlphaTest) H_AUTO_OGL(CDriverGLStates3_enableAlphaTest)
// If different from current setup, update. // If different from current setup, update.
bool enabled= (enable!=0); bool enabled= (enable!=0);
#ifndef NL3D_GLSTATE_DISABLE_CACHE #ifndef NL3D_GLSTATE_DISABLE_CACHE
@ -283,9 +283,9 @@ void CDriverGLStates::enableAlphaTest(uint enable)
// *************************************************************************** // ***************************************************************************
void CDriverGLStates::enableLighting(uint enable) void CDriverGLStates3::enableLighting(uint enable)
{ {
H_AUTO_OGL(CDriverGLStates_enableLighting) H_AUTO_OGL(CDriverGLStates3_enableLighting)
// If different from current setup, update. // If different from current setup, update.
bool enabled= (enable!=0); bool enabled= (enable!=0);
#ifndef NL3D_GLSTATE_DISABLE_CACHE #ifndef NL3D_GLSTATE_DISABLE_CACHE
@ -305,9 +305,9 @@ void CDriverGLStates::enableLighting(uint enable)
} }
// *************************************************************************** // ***************************************************************************
void CDriverGLStates::enableLight(uint num, uint enable) void CDriverGLStates3::enableLight(uint num, uint enable)
{ {
H_AUTO_OGL(CDriverGLStates_enableLight) H_AUTO_OGL(CDriverGLStates3_enableLight)
if(num>=_MaxDriverLight) if(num>=_MaxDriverLight)
return; return;
@ -328,9 +328,9 @@ void CDriverGLStates::enableLight(uint num, uint enable)
} }
// *************************************************************************** // ***************************************************************************
bool CDriverGLStates::isLightEnabled(uint num) const bool CDriverGLStates3::isLightEnabled(uint num) const
{ {
H_AUTO_OGL(CDriverGLStates_isLightEnabled) H_AUTO_OGL(CDriverGLStates3_isLightEnabled)
if(num>=_MaxDriverLight) if(num>=_MaxDriverLight)
return false; return false;
else else
@ -339,9 +339,9 @@ bool CDriverGLStates::isLightEnabled(uint num) const
// *************************************************************************** // ***************************************************************************
void CDriverGLStates::enableZWrite(uint enable) void CDriverGLStates3::enableZWrite(uint enable)
{ {
H_AUTO_OGL(CDriverGLStates_enableZWrite) H_AUTO_OGL(CDriverGLStates3_enableZWrite)
// If different from current setup, update. // If different from current setup, update.
bool enabled= (enable!=0); bool enabled= (enable!=0);
#ifndef NL3D_GLSTATE_DISABLE_CACHE #ifndef NL3D_GLSTATE_DISABLE_CACHE
@ -360,9 +360,9 @@ void CDriverGLStates::enableZWrite(uint enable)
// *************************************************************************** // ***************************************************************************
void CDriverGLStates::enableStencilTest(bool enable) void CDriverGLStates3::enableStencilTest(bool enable)
{ {
H_AUTO_OGL(CDriverGLStates_enableStencilTest); H_AUTO_OGL(CDriverGLStates3_enableStencilTest);
// If different from current setup, update. // If different from current setup, update.
#ifndef NL3D_GLSTATE_DISABLE_CACHE #ifndef NL3D_GLSTATE_DISABLE_CACHE
@ -380,9 +380,9 @@ void CDriverGLStates::enableStencilTest(bool enable)
} }
// *************************************************************************** // ***************************************************************************
void CDriverGLStates::enableMultisample(bool enable) void CDriverGLStates3::enableMultisample(bool enable)
{ {
H_AUTO_OGL(CDriverGLStates_enableMultisample); H_AUTO_OGL(CDriverGLStates3_enableMultisample);
// If different from current setup, update. // If different from current setup, update.
#ifndef NL3D_GLSTATE_DISABLE_CACHE #ifndef NL3D_GLSTATE_DISABLE_CACHE
@ -401,9 +401,9 @@ void CDriverGLStates::enableMultisample(bool enable)
} }
// *************************************************************************** // ***************************************************************************
void CDriverGLStates::blendFunc(GLenum src, GLenum dst) void CDriverGLStates3::blendFunc(GLenum src, GLenum dst)
{ {
H_AUTO_OGL(CDriverGLStates_blendFunc) H_AUTO_OGL(CDriverGLStates3_blendFunc)
// If different from current setup, update. // If different from current setup, update.
#ifndef NL3D_GLSTATE_DISABLE_CACHE #ifndef NL3D_GLSTATE_DISABLE_CACHE
if( src!= _CurBlendSrc || dst!=_CurBlendDst ) if( src!= _CurBlendSrc || dst!=_CurBlendDst )
@ -418,9 +418,9 @@ void CDriverGLStates::blendFunc(GLenum src, GLenum dst)
} }
// *************************************************************************** // ***************************************************************************
void CDriverGLStates::depthFunc(GLenum zcomp) void CDriverGLStates3::depthFunc(GLenum zcomp)
{ {
H_AUTO_OGL(CDriverGLStates_depthFunc) H_AUTO_OGL(CDriverGLStates3_depthFunc)
// If different from current setup, update. // If different from current setup, update.
#ifndef NL3D_GLSTATE_DISABLE_CACHE #ifndef NL3D_GLSTATE_DISABLE_CACHE
if( zcomp != _CurDepthFunc ) if( zcomp != _CurDepthFunc )
@ -435,9 +435,9 @@ void CDriverGLStates::depthFunc(GLenum zcomp)
// *************************************************************************** // ***************************************************************************
void CDriverGLStates::alphaFunc(float threshold) void CDriverGLStates3::alphaFunc(float threshold)
{ {
H_AUTO_OGL(CDriverGLStates_alphaFunc) H_AUTO_OGL(CDriverGLStates3_alphaFunc)
#ifndef NL3D_GLSTATE_DISABLE_CACHE #ifndef NL3D_GLSTATE_DISABLE_CACHE
if(threshold != _CurAlphaTestThreshold) if(threshold != _CurAlphaTestThreshold)
#endif #endif
@ -451,9 +451,9 @@ void CDriverGLStates::alphaFunc(float threshold)
// *************************************************************************** // ***************************************************************************
void CDriverGLStates::stencilFunc(GLenum func, GLint ref, GLuint mask) void CDriverGLStates3::stencilFunc(GLenum func, GLint ref, GLuint mask)
{ {
H_AUTO_OGL(CDriverGLStates_stencilFunc) H_AUTO_OGL(CDriverGLStates3_stencilFunc)
#ifndef NL3D_GLSTATE_DISABLE_CACHE #ifndef NL3D_GLSTATE_DISABLE_CACHE
if((func!=_CurStencilFunc) || (ref!=_CurStencilRef) || (mask!=_CurStencilMask)) if((func!=_CurStencilFunc) || (ref!=_CurStencilRef) || (mask!=_CurStencilMask))
#endif #endif
@ -470,9 +470,9 @@ void CDriverGLStates::stencilFunc(GLenum func, GLint ref, GLuint mask)
// *************************************************************************** // ***************************************************************************
void CDriverGLStates::stencilOp(GLenum fail, GLenum zfail, GLenum zpass) void CDriverGLStates3::stencilOp(GLenum fail, GLenum zfail, GLenum zpass)
{ {
H_AUTO_OGL(CDriverGLStates_stencilOp) H_AUTO_OGL(CDriverGLStates3_stencilOp)
#ifndef NL3D_GLSTATE_DISABLE_CACHE #ifndef NL3D_GLSTATE_DISABLE_CACHE
if((fail!=_CurStencilOpFail) || (zfail!=_CurStencilOpZFail) || (zpass!=_CurStencilOpZPass)) if((fail!=_CurStencilOpFail) || (zfail!=_CurStencilOpZFail) || (zpass!=_CurStencilOpZPass))
#endif #endif
@ -488,9 +488,9 @@ void CDriverGLStates::stencilOp(GLenum fail, GLenum zfail, GLenum zpass)
} }
// *************************************************************************** // ***************************************************************************
void CDriverGLStates::stencilMask(GLuint mask) void CDriverGLStates3::stencilMask(GLuint mask)
{ {
H_AUTO_OGL(CDriverGLStates_stencilMask) H_AUTO_OGL(CDriverGLStates3_stencilMask)
#ifndef NL3D_GLSTATE_DISABLE_CACHE #ifndef NL3D_GLSTATE_DISABLE_CACHE
if(mask!=_CurStencilWriteMask) if(mask!=_CurStencilWriteMask)
#endif #endif
@ -505,9 +505,9 @@ void CDriverGLStates::stencilMask(GLuint mask)
// *************************************************************************** // ***************************************************************************
void CDriverGLStates::setEmissive(uint32 packedColor, const GLfloat color[4]) void CDriverGLStates3::setEmissive(uint32 packedColor, const GLfloat color[4])
{ {
H_AUTO_OGL(CDriverGLStates_setEmissive) H_AUTO_OGL(CDriverGLStates3_setEmissive)
#ifndef NL3D_GLSTATE_DISABLE_CACHE #ifndef NL3D_GLSTATE_DISABLE_CACHE
if( packedColor!=_CurEmissive ) if( packedColor!=_CurEmissive )
#endif #endif
@ -518,9 +518,9 @@ void CDriverGLStates::setEmissive(uint32 packedColor, const GLfloat color[4])
} }
// *************************************************************************** // ***************************************************************************
void CDriverGLStates::setAmbient(uint32 packedColor, const GLfloat color[4]) void CDriverGLStates3::setAmbient(uint32 packedColor, const GLfloat color[4])
{ {
H_AUTO_OGL(CDriverGLStates_setAmbient) H_AUTO_OGL(CDriverGLStates3_setAmbient)
#ifndef NL3D_GLSTATE_DISABLE_CACHE #ifndef NL3D_GLSTATE_DISABLE_CACHE
if( packedColor!=_CurAmbient ) if( packedColor!=_CurAmbient )
#endif #endif
@ -531,9 +531,9 @@ void CDriverGLStates::setAmbient(uint32 packedColor, const GLfloat color[4])
} }
// *************************************************************************** // ***************************************************************************
void CDriverGLStates::setDiffuse(uint32 packedColor, const GLfloat color[4]) void CDriverGLStates3::setDiffuse(uint32 packedColor, const GLfloat color[4])
{ {
H_AUTO_OGL(CDriverGLStates_setDiffuse) H_AUTO_OGL(CDriverGLStates3_setDiffuse)
#ifndef NL3D_GLSTATE_DISABLE_CACHE #ifndef NL3D_GLSTATE_DISABLE_CACHE
if( packedColor!=_CurDiffuse ) if( packedColor!=_CurDiffuse )
#endif #endif
@ -544,9 +544,9 @@ void CDriverGLStates::setDiffuse(uint32 packedColor, const GLfloat color[4])
} }
// *************************************************************************** // ***************************************************************************
void CDriverGLStates::setSpecular(uint32 packedColor, const GLfloat color[4]) void CDriverGLStates3::setSpecular(uint32 packedColor, const GLfloat color[4])
{ {
H_AUTO_OGL(CDriverGLStates_setSpecular) H_AUTO_OGL(CDriverGLStates3_setSpecular)
#ifndef NL3D_GLSTATE_DISABLE_CACHE #ifndef NL3D_GLSTATE_DISABLE_CACHE
if( packedColor!=_CurSpecular ) if( packedColor!=_CurSpecular )
#endif #endif
@ -557,9 +557,9 @@ void CDriverGLStates::setSpecular(uint32 packedColor, const GLfloat color[4])
} }
// *************************************************************************** // ***************************************************************************
void CDriverGLStates::setShininess(float shin) void CDriverGLStates3::setShininess(float shin)
{ {
H_AUTO_OGL(CDriverGLStates_setShininess) H_AUTO_OGL(CDriverGLStates3_setShininess)
#ifndef NL3D_GLSTATE_DISABLE_CACHE #ifndef NL3D_GLSTATE_DISABLE_CACHE
if( shin != _CurShininess ) if( shin != _CurShininess )
#endif #endif
@ -582,9 +582,9 @@ static void convColor(CRGBA col, GLfloat glcol[4])
} }
// *************************************************************************** // ***************************************************************************
void CDriverGLStates::setVertexColorLighted(bool enable) void CDriverGLStates3::setVertexColorLighted(bool enable)
{ {
H_AUTO_OGL(CDriverGLStates_setVertexColorLighted) H_AUTO_OGL(CDriverGLStates3_setVertexColorLighted)
#ifndef NL3D_GLSTATE_DISABLE_CACHE #ifndef NL3D_GLSTATE_DISABLE_CACHE
if( enable != _VertexColorLighted) if( enable != _VertexColorLighted)
#endif #endif
@ -616,9 +616,9 @@ void CDriverGLStates::setVertexColorLighted(bool enable)
// *************************************************************************** // ***************************************************************************
void CDriverGLStates::updateDepthRange() void CDriverGLStates3::updateDepthRange()
{ {
H_AUTO_OGL(CDriverGLStates_updateDepthRange); H_AUTO_OGL(CDriverGLStates3_updateDepthRange);
float delta = _ZBias * (_DepthRangeFar - _DepthRangeNear); float delta = _ZBias * (_DepthRangeFar - _DepthRangeNear);
@ -630,9 +630,9 @@ void CDriverGLStates::updateDepthRange()
} }
// *************************************************************************** // ***************************************************************************
void CDriverGLStates::setZBias(float zbias) void CDriverGLStates3::setZBias(float zbias)
{ {
H_AUTO_OGL(CDriverGLStates_setZBias) H_AUTO_OGL(CDriverGLStates3_setZBias)
#ifndef NL3D_GLSTATE_DISABLE_CACHE #ifndef NL3D_GLSTATE_DISABLE_CACHE
if (zbias != _ZBias) if (zbias != _ZBias)
#endif #endif
@ -644,9 +644,9 @@ void CDriverGLStates::setZBias(float zbias)
// *************************************************************************** // ***************************************************************************
void CDriverGLStates::setDepthRange(float znear, float zfar) void CDriverGLStates3::setDepthRange(float znear, float zfar)
{ {
H_AUTO_OGL(CDriverGLStates_setDepthRange) H_AUTO_OGL(CDriverGLStates3_setDepthRange)
nlassert(znear != zfar); nlassert(znear != zfar);
#ifndef NL3D_GLSTATE_DISABLE_CACHE #ifndef NL3D_GLSTATE_DISABLE_CACHE
if (znear != _DepthRangeNear || zfar != _DepthRangeFar) if (znear != _DepthRangeNear || zfar != _DepthRangeFar)
@ -659,9 +659,9 @@ void CDriverGLStates::setDepthRange(float znear, float zfar)
} }
// *************************************************************************** // ***************************************************************************
void CDriverGLStates::setTexGenMode (uint stage, GLint mode) void CDriverGLStates3::setTexGenMode (uint stage, GLint mode)
{ {
H_AUTO_OGL(CDriverGLStates_setTexGenMode); H_AUTO_OGL(CDriverGLStates3_setTexGenMode);
#ifndef NL3D_GLSTATE_DISABLE_CACHE #ifndef NL3D_GLSTATE_DISABLE_CACHE
if (mode != _TexGenMode[stage]) if (mode != _TexGenMode[stage])
@ -733,9 +733,9 @@ void CDriverGLStates::setTexGenMode (uint stage, GLint mode)
} }
// *************************************************************************** // ***************************************************************************
void CDriverGLStates::resetTextureMode() void CDriverGLStates3::resetTextureMode()
{ {
H_AUTO_OGL(CDriverGLStates_resetTextureMode); H_AUTO_OGL(CDriverGLStates3_resetTextureMode);
glDisable(GL_TEXTURE_2D); glDisable(GL_TEXTURE_2D);
@ -756,9 +756,9 @@ void CDriverGLStates::resetTextureMode()
// *************************************************************************** // ***************************************************************************
void CDriverGLStates::setTextureMode(TTextureMode texMode) void CDriverGLStates3::setTextureMode(TTextureMode texMode)
{ {
H_AUTO_OGL(CDriverGLStates_setTextureMode) H_AUTO_OGL(CDriverGLStates3_setTextureMode)
TTextureMode oldTexMode = _TextureMode[_CurrentActiveTextureARB]; TTextureMode oldTexMode = _TextureMode[_CurrentActiveTextureARB];
if(oldTexMode != texMode) if(oldTexMode != texMode)
{ {
@ -829,9 +829,9 @@ void CDriverGLStates::setTextureMode(TTextureMode texMode)
// *************************************************************************** // ***************************************************************************
void CDriverGLStates::activeTextureARB(uint stage) void CDriverGLStates3::activeTextureARB(uint stage)
{ {
H_AUTO_OGL(CDriverGLStates_activeTextureARB); H_AUTO_OGL(CDriverGLStates3_activeTextureARB);
if( _CurrentActiveTextureARB != stage ) if( _CurrentActiveTextureARB != stage )
{ {
@ -846,9 +846,9 @@ void CDriverGLStates::activeTextureARB(uint stage)
} }
// *************************************************************************** // ***************************************************************************
void CDriverGLStates::forceActiveTextureARB(uint stage) void CDriverGLStates3::forceActiveTextureARB(uint stage)
{ {
H_AUTO_OGL(CDriverGLStates_forceActiveTextureARB); H_AUTO_OGL(CDriverGLStates3_forceActiveTextureARB);
#ifdef USE_OPENGLES #ifdef USE_OPENGLES
glActiveTexture(GL_TEXTURE0+stage); glActiveTexture(GL_TEXTURE0+stage);
@ -860,9 +860,9 @@ void CDriverGLStates::forceActiveTextureARB(uint stage)
} }
// *************************************************************************** // ***************************************************************************
void CDriverGLStates::enableVertexArray(bool enable) void CDriverGLStates3::enableVertexArray(bool enable)
{ {
H_AUTO_OGL(CDriverGLStates_enableVertexArray); H_AUTO_OGL(CDriverGLStates3_enableVertexArray);
if(_VertexArrayEnabled != enable) if(_VertexArrayEnabled != enable)
{ {
@ -875,9 +875,9 @@ void CDriverGLStates::enableVertexArray(bool enable)
} }
} }
// *************************************************************************** // ***************************************************************************
void CDriverGLStates::enableNormalArray(bool enable) void CDriverGLStates3::enableNormalArray(bool enable)
{ {
H_AUTO_OGL(CDriverGLStates_enableNormalArray) H_AUTO_OGL(CDriverGLStates3_enableNormalArray)
if(_NormalArrayEnabled != enable) if(_NormalArrayEnabled != enable)
{ {
if(enable) if(enable)
@ -890,9 +890,9 @@ void CDriverGLStates::enableNormalArray(bool enable)
} }
} }
// *************************************************************************** // ***************************************************************************
void CDriverGLStates::enableWeightArray(bool enable) void CDriverGLStates3::enableWeightArray(bool enable)
{ {
H_AUTO_OGL(CDriverGLStates_enableWeightArray); H_AUTO_OGL(CDriverGLStates3_enableWeightArray);
if(_WeightArrayEnabled != enable) if(_WeightArrayEnabled != enable)
{ {
@ -907,9 +907,9 @@ void CDriverGLStates::enableWeightArray(bool enable)
} }
} }
// *************************************************************************** // ***************************************************************************
void CDriverGLStates::enableColorArray(bool enable) void CDriverGLStates3::enableColorArray(bool enable)
{ {
H_AUTO_OGL(CDriverGLStates_enableColorArray); H_AUTO_OGL(CDriverGLStates3_enableColorArray);
if(_ColorArrayEnabled != enable) if(_ColorArrayEnabled != enable)
{ {
@ -925,9 +925,9 @@ void CDriverGLStates::enableColorArray(bool enable)
// *************************************************************************** // ***************************************************************************
void CDriverGLStates::enableSecondaryColorArray(bool enable) void CDriverGLStates3::enableSecondaryColorArray(bool enable)
{ {
H_AUTO_OGL(CDriverGLStates_enableSecondaryColorArray); H_AUTO_OGL(CDriverGLStates3_enableSecondaryColorArray);
if(_SecondaryColorArrayEnabled != enable) if(_SecondaryColorArrayEnabled != enable)
{ {
@ -952,9 +952,9 @@ void CDriverGLStates::enableSecondaryColorArray(bool enable)
} }
// *************************************************************************** // ***************************************************************************
void CDriverGLStates::clientActiveTextureARB(uint stage) void CDriverGLStates3::clientActiveTextureARB(uint stage)
{ {
H_AUTO_OGL(CDriverGLStates_clientActiveTextureARB); H_AUTO_OGL(CDriverGLStates3_clientActiveTextureARB);
if( _CurrentClientActiveTextureARB != stage ) if( _CurrentClientActiveTextureARB != stage )
{ {
@ -968,9 +968,9 @@ void CDriverGLStates::clientActiveTextureARB(uint stage)
} }
// *************************************************************************** // ***************************************************************************
void CDriverGLStates::enableTexCoordArray(bool enable) void CDriverGLStates3::enableTexCoordArray(bool enable)
{ {
H_AUTO_OGL(CDriverGLStates_enableTexCoordArray); H_AUTO_OGL(CDriverGLStates3_enableTexCoordArray);
if(_TexCoordArrayEnabled[_CurrentClientActiveTextureARB] != enable) if(_TexCoordArrayEnabled[_CurrentClientActiveTextureARB] != enable)
{ {
@ -985,9 +985,9 @@ void CDriverGLStates::enableTexCoordArray(bool enable)
} }
// *************************************************************************** // ***************************************************************************
void CDriverGLStates::enableVertexAttribArray(uint glIndex, bool enable) void CDriverGLStates3::enableVertexAttribArray(uint glIndex, bool enable)
{ {
H_AUTO_OGL(CDriverGLStates_enableVertexAttribArray); H_AUTO_OGL(CDriverGLStates3_enableVertexAttribArray);
if(_VertexAttribArrayEnabled[glIndex] != enable) if(_VertexAttribArrayEnabled[glIndex] != enable)
{ {
@ -1003,9 +1003,9 @@ void CDriverGLStates::enableVertexAttribArray(uint glIndex, bool enable)
} }
// *************************************************************************** // ***************************************************************************
void CDriverGLStates::enableVertexAttribArrayARB(uint glIndex,bool enable) void CDriverGLStates3::enableVertexAttribArrayARB(uint glIndex,bool enable)
{ {
H_AUTO_OGL(CDriverGLStates_enableVertexAttribArrayARB); H_AUTO_OGL(CDriverGLStates3_enableVertexAttribArrayARB);
#ifndef NL3D_GLSTATE_DISABLE_CACHE #ifndef NL3D_GLSTATE_DISABLE_CACHE
if(_VertexAttribArrayEnabled[glIndex] != enable) if(_VertexAttribArrayEnabled[glIndex] != enable)
@ -1023,9 +1023,9 @@ void CDriverGLStates::enableVertexAttribArrayARB(uint glIndex,bool enable)
} }
// *************************************************************************** // ***************************************************************************
void CDriverGLStates::enableVertexAttribArrayForEXTVertexShader(uint glIndex, bool enable, uint *variants) void CDriverGLStates3::enableVertexAttribArrayForEXTVertexShader(uint glIndex, bool enable, uint *variants)
{ {
H_AUTO_OGL(CDriverGLStates_enableVertexAttribArrayForEXTVertexShader); H_AUTO_OGL(CDriverGLStates3_enableVertexAttribArrayForEXTVertexShader);
if(_VertexAttribArrayEnabled[glIndex] != enable) if(_VertexAttribArrayEnabled[glIndex] != enable)
{ {
@ -1037,9 +1037,9 @@ void CDriverGLStates::enableVertexAttribArrayForEXTVertexShader(uint glIndex, bo
case 1: // skin weight case 1: // skin weight
#ifndef USE_OPENGLES #ifndef USE_OPENGLES
if(enable) if(enable)
nglEnableVariantClientStateEXT(variants[CDriverGL::EVSSkinWeightVariant]); nglEnableVariantClientStateEXT(variants[CDriverGL3::EVSSkinWeightVariant]);
else else
nglDisableVariantClientStateEXT(variants[CDriverGL::EVSSkinWeightVariant]); nglDisableVariantClientStateEXT(variants[CDriverGL3::EVSSkinWeightVariant]);
#endif #endif
break; break;
case 2: // normal case 2: // normal
@ -1051,25 +1051,25 @@ void CDriverGLStates::enableVertexAttribArrayForEXTVertexShader(uint glIndex, bo
case 4: // secondary color case 4: // secondary color
#ifndef USE_OPENGLES #ifndef USE_OPENGLES
if(enable) if(enable)
nglEnableVariantClientStateEXT(variants[CDriverGL::EVSSecondaryColorVariant]); nglEnableVariantClientStateEXT(variants[CDriverGL3::EVSSecondaryColorVariant]);
else else
nglDisableVariantClientStateEXT(variants[CDriverGL::EVSSecondaryColorVariant]); nglDisableVariantClientStateEXT(variants[CDriverGL3::EVSSecondaryColorVariant]);
#endif #endif
break; break;
case 5: // fog coordinate case 5: // fog coordinate
#ifndef USE_OPENGLES #ifndef USE_OPENGLES
if(enable) if(enable)
nglEnableVariantClientStateEXT(variants[CDriverGL::EVSFogCoordsVariant]); nglEnableVariantClientStateEXT(variants[CDriverGL3::EVSFogCoordsVariant]);
else else
nglDisableVariantClientStateEXT(variants[CDriverGL::EVSFogCoordsVariant]); nglDisableVariantClientStateEXT(variants[CDriverGL3::EVSFogCoordsVariant]);
#endif #endif
break; break;
case 6: // palette skin case 6: // palette skin
#ifndef USE_OPENGLES #ifndef USE_OPENGLES
if(enable) if(enable)
nglEnableVariantClientStateEXT(variants[CDriverGL::EVSPaletteSkinVariant]); nglEnableVariantClientStateEXT(variants[CDriverGL3::EVSPaletteSkinVariant]);
else else
nglDisableVariantClientStateEXT(variants[CDriverGL::EVSPaletteSkinVariant]); nglDisableVariantClientStateEXT(variants[CDriverGL3::EVSPaletteSkinVariant]);
#endif #endif
break; break;
case 7: // empty case 7: // empty
@ -1097,9 +1097,9 @@ void CDriverGLStates::enableVertexAttribArrayForEXTVertexShader(uint glIndex, bo
// *************************************************************************** // ***************************************************************************
void CDriverGLStates::enableFog(uint enable) void CDriverGLStates3::enableFog(uint enable)
{ {
H_AUTO_OGL(CDriverGLStates_enableFog) H_AUTO_OGL(CDriverGLStates3_enableFog)
// If different from current setup, update. // If different from current setup, update.
bool enabled= (enable!=0); bool enabled= (enable!=0);
#ifndef NL3D_GLSTATE_DISABLE_CACHE #ifndef NL3D_GLSTATE_DISABLE_CACHE
@ -1117,9 +1117,9 @@ void CDriverGLStates::enableFog(uint enable)
} }
// *************************************************************************** // ***************************************************************************
void CDriverGLStates::forceBindARBVertexBuffer(uint objectID) void CDriverGLStates3::forceBindARBVertexBuffer(uint objectID)
{ {
H_AUTO_OGL(CDriverGLStates_forceBindARBVertexBuffer) H_AUTO_OGL(CDriverGLStates3_forceBindARBVertexBuffer)
#ifdef USE_OPENGLES #ifdef USE_OPENGLES
glBindBuffer(GL_ARRAY_BUFFER, objectID); glBindBuffer(GL_ARRAY_BUFFER, objectID);
@ -1131,9 +1131,9 @@ void CDriverGLStates::forceBindARBVertexBuffer(uint objectID)
} }
// *************************************************************************** // ***************************************************************************
void CDriverGLStates::bindARBVertexBuffer(uint objectID) void CDriverGLStates3::bindARBVertexBuffer(uint objectID)
{ {
H_AUTO_OGL(CDriverGLStates_bindARBVertexBuffer) H_AUTO_OGL(CDriverGLStates3_bindARBVertexBuffer)
#ifndef NL3D_GLSTATE_DISABLE_CACHE #ifndef NL3D_GLSTATE_DISABLE_CACHE
if (objectID != _CurrARBVertexBuffer) if (objectID != _CurrARBVertexBuffer)
#endif #endif
@ -1143,9 +1143,9 @@ void CDriverGLStates::bindARBVertexBuffer(uint objectID)
} }
// *************************************************************************** // ***************************************************************************
void CDriverGLStates::setCullMode(TCullMode cullMode) void CDriverGLStates3::setCullMode(TCullMode cullMode)
{ {
H_AUTO_OGL(CDriverGLStates_setCullMode) H_AUTO_OGL(CDriverGLStates3_setCullMode)
#ifndef NL3D_GLSTATE_DISABLE_CACHE #ifndef NL3D_GLSTATE_DISABLE_CACHE
if (cullMode != _CullMode) if (cullMode != _CullMode)
#endif #endif
@ -1156,9 +1156,9 @@ void CDriverGLStates::setCullMode(TCullMode cullMode)
} }
// *************************************************************************** // ***************************************************************************
CDriverGLStates::TCullMode CDriverGLStates::getCullMode() const CDriverGLStates3::TCullMode CDriverGLStates3::getCullMode() const
{ {
H_AUTO_OGL(CDriverGLStates_CDriverGLStates) H_AUTO_OGL(CDriverGLStates3_CDriverGLStates)
return _CullMode; return _CullMode;
} }

@ -26,7 +26,7 @@ namespace NL3D {
#ifdef USE_OPENGLES #ifdef USE_OPENGLES
namespace NLDRIVERGLES { namespace NLDRIVERGLES {
#else #else
namespace NLDRIVERGL { namespace NLDRIVERGL3 {
#endif #endif
#endif #endif
@ -72,11 +72,11 @@ namespace NLDRIVERGL {
* \author Nevrax France * \author Nevrax France
* \date 2001 * \date 2001
*/ */
class CDriverGLStates class CDriverGLStates3
{ {
public: public:
/// Constructor. no-op. /// Constructor. no-op.
CDriverGLStates(); CDriverGLStates3();
// init. Do it just after setDisplay() // init. Do it just after setDisplay()
void init(bool supportTextureCubeMap, bool supportTextureRectangle, uint maxLight); void init(bool supportTextureCubeMap, bool supportTextureRectangle, uint maxLight);

@ -47,15 +47,15 @@ namespace NL3D {
#ifdef USE_OPENGLES #ifdef USE_OPENGLES
namespace NLDRIVERGLES { namespace NLDRIVERGLES {
#else #else
namespace NLDRIVERGL { namespace NLDRIVERGL3 {
#endif #endif
#endif #endif
// *************************************************************************** // ***************************************************************************
CTextureDrvInfosGL::CTextureDrvInfosGL(IDriver *drv, ItTexDrvInfoPtrMap it, CDriverGL *drvGl, bool isRectangleTexture) : ITextureDrvInfos(drv, it) CTextureDrvInfosGL3::CTextureDrvInfosGL3(IDriver *drv, ItTexDrvInfoPtrMap it, CDriverGL3 *drvGl, bool isRectangleTexture) : ITextureDrvInfos(drv, it)
{ {
H_AUTO_OGL(CTextureDrvInfosGL_CTextureDrvInfosGL) H_AUTO_OGL(CTextureDrvInfosGL3_CTextureDrvInfosGL3)
//nldebug("3D: CTextureDrvInfosGL::ctor()"); //nldebug("3D: CTextureDrvInfosGL3::ctor()");
// The id is auto created here. // The id is auto created here.
glGenTextures(1,&ID); glGenTextures(1,&ID);
@ -81,9 +81,9 @@ CTextureDrvInfosGL::CTextureDrvInfosGL(IDriver *drv, ItTexDrvInfoPtrMap it, CDri
UsePackedDepthStencil = drvGl->supportPackedDepthStencil(); UsePackedDepthStencil = drvGl->supportPackedDepthStencil();
} }
// *************************************************************************** // ***************************************************************************
CTextureDrvInfosGL::~CTextureDrvInfosGL() CTextureDrvInfosGL3::~CTextureDrvInfosGL3()
{ {
H_AUTO_OGL(CTextureDrvInfosGL_CTextureDrvInfosGLDtor) H_AUTO_OGL(CTextureDrvInfosGL3_CTextureDrvInfosGLDtor)
// The id is auto deleted here. // The id is auto deleted here.
glDeleteTextures(1,&ID); glDeleteTextures(1,&ID);
@ -116,7 +116,7 @@ CTextureDrvInfosGL::~CTextureDrvInfosGL()
} }
// *************************************************************************** // ***************************************************************************
bool CTextureDrvInfosGL::initFrameBufferObject(ITexture * tex) bool CTextureDrvInfosGL3::initFrameBufferObject(ITexture * tex)
{ {
if(!InitFBO) if(!InitFBO)
{ {
@ -354,7 +354,7 @@ bool CTextureDrvInfosGL::initFrameBufferObject(ITexture * tex)
} }
// *************************************************************************** // ***************************************************************************
bool CTextureDrvInfosGL::activeFrameBufferObject(ITexture * tex) bool CTextureDrvInfosGL3::activeFrameBufferObject(ITexture * tex)
{ {
if(tex) if(tex)
{ {
@ -384,19 +384,19 @@ bool CTextureDrvInfosGL::activeFrameBufferObject(ITexture * tex)
// *************************************************************************** // ***************************************************************************
// Get the glText mirror of an existing setuped texture. // Get the glText mirror of an existing setuped texture.
static inline CTextureDrvInfosGL* getTextureGl(ITexture& tex) static inline CTextureDrvInfosGL3* getTextureGl(ITexture& tex)
{ {
H_AUTO_OGL(getTextureGl) H_AUTO_OGL(getTextureGl)
CTextureDrvInfosGL* gltex; CTextureDrvInfosGL3* gltex;
gltex= (CTextureDrvInfosGL*)(ITextureDrvInfos*)(tex.TextureDrvShare->DrvTexture); gltex= (CTextureDrvInfosGL3*)(ITextureDrvInfos*)(tex.TextureDrvShare->DrvTexture);
return gltex; return gltex;
} }
// *************************************************************************** // ***************************************************************************
// Translation of TexFmt mode. // Translation of TexFmt mode.
GLint CDriverGL::getGlTextureFormat(ITexture& tex, bool &compressed) GLint CDriverGL3::getGlTextureFormat(ITexture& tex, bool &compressed)
{ {
H_AUTO_OGL(CDriverGL_getGlTextureFormat) H_AUTO_OGL(CDriverGL3_getGlTextureFormat)
ITexture::TUploadFormat texfmt= tex.getUploadFormat(); ITexture::TUploadFormat texfmt= tex.getUploadFormat();
// If auto, retrieve the pixel format of the bitmap. // If auto, retrieve the pixel format of the bitmap.
@ -549,9 +549,9 @@ static GLenum getGlSrcTextureComponentType(GLint texSrcFormat)
} }
// *************************************************************************** // ***************************************************************************
uint CDriverGL::computeMipMapMemoryUsage(uint w, uint h, GLint glfmt) const uint CDriverGL3::computeMipMapMemoryUsage(uint w, uint h, GLint glfmt) const
{ {
H_AUTO_OGL(CDriverGL_computeMipMapMemoryUsage) H_AUTO_OGL(CDriverGL3_computeMipMapMemoryUsage)
switch(glfmt) switch(glfmt)
{ {
#ifdef GL_RGBA8 #ifdef GL_RGBA8
@ -640,7 +640,7 @@ static inline GLenum translateWrapToGl(ITexture::TWrapMode mode, const CGlExtens
} }
// *************************************************************************** // ***************************************************************************
static inline GLenum translateMagFilterToGl(CTextureDrvInfosGL *glText) static inline GLenum translateMagFilterToGl(CTextureDrvInfosGL3 *glText)
{ {
H_AUTO_OGL(translateMagFilterToGl) H_AUTO_OGL(translateMagFilterToGl)
#ifdef NEL_FORCE_NEAREST #ifdef NEL_FORCE_NEAREST
@ -660,7 +660,7 @@ static inline GLenum translateMagFilterToGl(CTextureDrvInfosGL *glText)
// *************************************************************************** // ***************************************************************************
static inline GLenum translateMinFilterToGl(CTextureDrvInfosGL *glText) static inline GLenum translateMinFilterToGl(CTextureDrvInfosGL3 *glText)
{ {
H_AUTO_OGL(translateMinFilterToGl) H_AUTO_OGL(translateMinFilterToGl)
#ifdef NEL_FORCE_NEAREST #ifdef NEL_FORCE_NEAREST
@ -758,7 +758,7 @@ static inline bool isDXTCFormat(GLint glfmt)
} }
// *************************************************************************** // ***************************************************************************
bool CDriverGL::setupTexture (ITexture& tex) bool CDriverGL3::setupTexture (ITexture& tex)
{ {
H_AUTO_OGL(setupTexture) H_AUTO_OGL(setupTexture)
bool nTmp; bool nTmp;
@ -769,9 +769,9 @@ bool CDriverGL::setupTexture (ITexture& tex)
#ifndef NL_DEBUG #ifndef NL_DEBUG
inline inline
#endif #endif
void CDriverGL::bindTextureWithMode(ITexture &tex) void CDriverGL3::bindTextureWithMode(ITexture &tex)
{ {
CTextureDrvInfosGL* gltext; CTextureDrvInfosGL3* gltext;
gltext= getTextureGl(tex); gltext= getTextureGl(tex);
// system of "backup the previous binded texture" seems to not work with some drivers.... // system of "backup the previous binded texture" seems to not work with some drivers....
_DriverGLStates.activeTextureARB(0); _DriverGLStates.activeTextureARB(0);
@ -779,17 +779,17 @@ void CDriverGL::bindTextureWithMode(ITexture &tex)
{ {
if (_Extensions.ARBTextureCubeMap) if (_Extensions.ARBTextureCubeMap)
{ {
_DriverGLStates.setTextureMode(CDriverGLStates::TextureCubeMap); _DriverGLStates.setTextureMode(CDriverGLStates3::TextureCubeMap);
// Bind this texture // Bind this texture
glBindTexture(GL_TEXTURE_CUBE_MAP_ARB, gltext->ID); glBindTexture(GL_TEXTURE_CUBE_MAP_ARB, gltext->ID);
} }
} }
else else
{ {
CDriverGLStates::TTextureMode textureMode= CDriverGLStates::Texture2D; CDriverGLStates3::TTextureMode textureMode= CDriverGLStates3::Texture2D;
#ifndef USE_OPENGLES #ifndef USE_OPENGLES
if(gltext->TextureMode == GL_TEXTURE_RECTANGLE_NV) if(gltext->TextureMode == GL_TEXTURE_RECTANGLE_NV)
textureMode = CDriverGLStates::TextureRect; textureMode = CDriverGLStates3::TextureRect;
#endif #endif
_DriverGLStates.setTextureMode(textureMode); _DriverGLStates.setTextureMode(textureMode);
@ -802,9 +802,9 @@ void CDriverGL::bindTextureWithMode(ITexture &tex)
#ifndef NL_DEBUG #ifndef NL_DEBUG
inline inline
#endif #endif
void CDriverGL::setupTextureBasicParameters(ITexture &tex) void CDriverGL3::setupTextureBasicParameters(ITexture &tex)
{ {
CTextureDrvInfosGL* gltext; CTextureDrvInfosGL3* gltext;
gltext= getTextureGl(tex); gltext= getTextureGl(tex);
// TODO: possible cache here, but beware, this is called just after texture creation as well, so these fields // TODO: possible cache here, but beware, this is called just after texture creation as well, so these fields
// haven't ever been filled. // haven't ever been filled.
@ -843,10 +843,10 @@ void CDriverGL::setupTextureBasicParameters(ITexture &tex)
} }
// *************************************************************************** // ***************************************************************************
bool CDriverGL::setupTextureEx (ITexture& tex, bool bUpload, bool &bAllUploaded, bool bMustRecreateSharedTexture) bool CDriverGL3::setupTextureEx (ITexture& tex, bool bUpload, bool &bAllUploaded, bool bMustRecreateSharedTexture)
{ {
H_AUTO_OGL(setupTextureEx) H_AUTO_OGL(setupTextureEx)
//nldebug("3D: CDriverGL::setupTextureEx(%016p, %d, %d, %d)", &tex, bUpload, bAllUploaded, bMustRecreateSharedTexture); //nldebug("3D: CDriverGL3::setupTextureEx(%016p, %d, %d, %d)", &tex, bUpload, bAllUploaded, bMustRecreateSharedTexture);
bAllUploaded = false; bAllUploaded = false;
if(tex.isTextureCube() && (!_Extensions.ARBTextureCubeMap)) if(tex.isTextureCube() && (!_Extensions.ARBTextureCubeMap))
@ -881,7 +881,7 @@ bool CDriverGL::setupTextureEx (ITexture& tex, bool bUpload, bool &bAllUploaded,
// Disable texture 0 // Disable texture 0
_CurrentTexture[0]= NULL; _CurrentTexture[0]= NULL;
_CurrentTextureInfoGL[0]= NULL; _CurrentTextureInfoGL[0]= NULL;
_DriverGLStates.setTextureMode(CDriverGLStates::TextureDisabled); _DriverGLStates.setTextureMode(CDriverGLStates3::TextureDisabled);
// //
} }
// //
@ -928,7 +928,7 @@ bool CDriverGL::setupTextureEx (ITexture& tex, bool bUpload, bool &bAllUploaded,
// insert into driver map. (so it is deleted when driver is deleted). // insert into driver map. (so it is deleted when driver is deleted).
itTex= (rTexDrvInfos.insert(make_pair(name, (ITextureDrvInfos*)NULL))).first; itTex= (rTexDrvInfos.insert(make_pair(name, (ITextureDrvInfos*)NULL))).first;
// create and set iterator, for future deletion. // create and set iterator, for future deletion.
itTex->second= tex.TextureDrvShare->DrvTexture = new CTextureDrvInfosGL(this, itTex, this, isTextureRectangle(&tex)); itTex->second= tex.TextureDrvShare->DrvTexture = new CTextureDrvInfosGL3(this, itTex, this, isTextureRectangle(&tex));
// need to load ALL this texture. // need to load ALL this texture.
mustLoadAll= true; mustLoadAll= true;
@ -957,7 +957,7 @@ bool CDriverGL::setupTextureEx (ITexture& tex, bool bUpload, bool &bAllUploaded,
// Must create it. Create auto a GL id (in constructor). // Must create it. Create auto a GL id (in constructor).
// Do not insert into the map. This un-shared texture will be deleted at deletion of the texture. // Do not insert into the map. This un-shared texture will be deleted at deletion of the texture.
// Inform ITextureDrvInfos by passing NULL _Driver. // Inform ITextureDrvInfos by passing NULL _Driver.
tex.TextureDrvShare->DrvTexture = new CTextureDrvInfosGL(NULL, ItTexDrvInfoPtrMap(), this, isTextureRectangle(&tex)); tex.TextureDrvShare->DrvTexture = new CTextureDrvInfosGL3(NULL, ItTexDrvInfoPtrMap(), this, isTextureRectangle(&tex));
// need to load ALL this texture. // need to load ALL this texture.
mustLoadAll= true; mustLoadAll= true;
@ -975,7 +975,7 @@ bool CDriverGL::setupTextureEx (ITexture& tex, bool bUpload, bool &bAllUploaded,
// system of "backup the previous binded texture" seems to not work with some drivers.... // system of "backup the previous binded texture" seems to not work with some drivers....
bindTextureWithMode(tex); bindTextureWithMode(tex);
CTextureDrvInfosGL* gltext; CTextureDrvInfosGL3* gltext;
gltext= getTextureGl(tex); gltext= getTextureGl(tex);
glPixelStorei(GL_UNPACK_ALIGNMENT,1); glPixelStorei(GL_UNPACK_ALIGNMENT,1);
@ -1296,7 +1296,7 @@ bool CDriverGL::setupTextureEx (ITexture& tex, bool bUpload, bool &bAllUploaded,
// Disable texture 0 // Disable texture 0
_CurrentTexture[0]= NULL; _CurrentTexture[0]= NULL;
_CurrentTextureInfoGL[0]= NULL; _CurrentTextureInfoGL[0]= NULL;
_DriverGLStates.setTextureMode(CDriverGLStates::TextureDisabled); _DriverGLStates.setTextureMode(CDriverGLStates3::TextureDisabled);
} }
// The texture is correctly setuped. // The texture is correctly setuped.
@ -1305,7 +1305,7 @@ bool CDriverGL::setupTextureEx (ITexture& tex, bool bUpload, bool &bAllUploaded,
} }
// *************************************************************************** // ***************************************************************************
bool CDriverGL::uploadTexture (ITexture& tex, CRect& rect, uint8 nNumMipMap) bool CDriverGL3::uploadTexture (ITexture& tex, CRect& rect, uint8 nNumMipMap)
{ {
H_AUTO_OGL(uploadTexture) H_AUTO_OGL(uploadTexture)
if (tex.TextureDrvShare == NULL) if (tex.TextureDrvShare == NULL)
@ -1330,16 +1330,16 @@ bool CDriverGL::uploadTexture (ITexture& tex, CRect& rect, uint8 nNumMipMap)
clamp (y1, y0, h); clamp (y1, y0, h);
// bind the texture to upload // bind the texture to upload
CTextureDrvInfosGL* gltext; CTextureDrvInfosGL3* gltext;
gltext = getTextureGl (tex); gltext = getTextureGl (tex);
// system of "backup the previous binded texture" seems to not work with some drivers.... // system of "backup the previous binded texture" seems to not work with some drivers....
_DriverGLStates.activeTextureARB (0); _DriverGLStates.activeTextureARB (0);
CDriverGLStates::TTextureMode textureMode= CDriverGLStates::Texture2D; CDriverGLStates3::TTextureMode textureMode= CDriverGLStates3::Texture2D;
#ifndef USE_OPENGLES #ifndef USE_OPENGLES
if(gltext->TextureMode == GL_TEXTURE_RECTANGLE_NV) if(gltext->TextureMode == GL_TEXTURE_RECTANGLE_NV)
textureMode = CDriverGLStates::TextureRect; textureMode = CDriverGLStates3::TextureRect;
#endif #endif
_DriverGLStates.setTextureMode (textureMode); _DriverGLStates.setTextureMode (textureMode);
@ -1390,7 +1390,7 @@ bool CDriverGL::uploadTexture (ITexture& tex, CRect& rect, uint8 nNumMipMap)
{ {
_CurrentTexture[0]= NULL; _CurrentTexture[0]= NULL;
_CurrentTextureInfoGL[0]= NULL; _CurrentTextureInfoGL[0]= NULL;
_DriverGLStates.setTextureMode (CDriverGLStates::TextureDisabled); _DriverGLStates.setTextureMode (CDriverGLStates3::TextureDisabled);
return false; return false;
} }
@ -1457,13 +1457,13 @@ bool CDriverGL::uploadTexture (ITexture& tex, CRect& rect, uint8 nNumMipMap)
// Disable texture 0 // Disable texture 0
_CurrentTexture[0]= NULL; _CurrentTexture[0]= NULL;
_CurrentTextureInfoGL[0]= NULL; _CurrentTextureInfoGL[0]= NULL;
_DriverGLStates.setTextureMode (CDriverGLStates::TextureDisabled); _DriverGLStates.setTextureMode (CDriverGLStates3::TextureDisabled);
return true; return true;
} }
// *************************************************************************** // ***************************************************************************
bool CDriverGL::uploadTextureCube (ITexture& tex, CRect& /* rect */, uint8 /* nNumMipMap */, uint8 /* nNumFace */) bool CDriverGL3::uploadTextureCube (ITexture& tex, CRect& /* rect */, uint8 /* nNumMipMap */, uint8 /* nNumFace */)
{ {
H_AUTO_OGL(uploadTextureCube) H_AUTO_OGL(uploadTextureCube)
if (tex.TextureDrvShare == NULL) if (tex.TextureDrvShare == NULL)
@ -1475,7 +1475,7 @@ bool CDriverGL::uploadTextureCube (ITexture& tex, CRect& /* rect */, uint8 /* nN
} }
// *************************************************************************** // ***************************************************************************
bool CDriverGL::activateTexture(uint stage, ITexture *tex) bool CDriverGL3::activateTexture(uint stage, ITexture *tex)
{ {
H_AUTO_OGL(activateTexture) H_AUTO_OGL(activateTexture)
if (this->_CurrentTexture[stage]!=tex) if (this->_CurrentTexture[stage]!=tex)
@ -1484,7 +1484,7 @@ bool CDriverGL::activateTexture(uint stage, ITexture *tex)
if(tex && tex->TextureDrvShare) if(tex && tex->TextureDrvShare)
{ {
// get the drv info. should be not NULL. // get the drv info. should be not NULL.
CTextureDrvInfosGL* gltext; CTextureDrvInfosGL3* gltext;
gltext= getTextureGl(*tex); gltext= getTextureGl(*tex);
// Profile, log the use of this texture // Profile, log the use of this texture
@ -1498,7 +1498,7 @@ bool CDriverGL::activateTexture(uint stage, ITexture *tex)
if(tex->isTextureCube()) if(tex->isTextureCube())
{ {
// setup texture mode, after activeTextureARB() // setup texture mode, after activeTextureARB()
_DriverGLStates.setTextureMode(CDriverGLStates::TextureCubeMap); _DriverGLStates.setTextureMode(CDriverGLStates3::TextureCubeMap);
if(_Extensions.ARBTextureCubeMap) if(_Extensions.ARBTextureCubeMap)
{ {
@ -1532,12 +1532,12 @@ bool CDriverGL::activateTexture(uint stage, ITexture *tex)
else else
{ {
// setup texture mode, after activeTextureARB() // setup texture mode, after activeTextureARB()
CDriverGLStates::TTextureMode textureMode= CDriverGLStates::Texture2D; CDriverGLStates3::TTextureMode textureMode= CDriverGLStates3::Texture2D;
#ifndef USE_OPENGLES #ifndef USE_OPENGLES
if(gltext->TextureMode == GL_TEXTURE_RECTANGLE_NV) if(gltext->TextureMode == GL_TEXTURE_RECTANGLE_NV)
textureMode = CDriverGLStates::TextureRect; textureMode = CDriverGLStates3::TextureRect;
#endif #endif
_DriverGLStates.setTextureMode(/*CDriverGLStates::Texture2D*/textureMode); _DriverGLStates.setTextureMode(/*CDriverGLStates3::Texture2D*/textureMode);
// Activate texture... // Activate texture...
//====================== //======================
@ -1582,7 +1582,7 @@ bool CDriverGL::activateTexture(uint stage, ITexture *tex)
// Force no texturing for this stage. // Force no texturing for this stage.
_CurrentTextureInfoGL[stage]= NULL; _CurrentTextureInfoGL[stage]= NULL;
// setup texture mode, after activeTextureARB() // setup texture mode, after activeTextureARB()
_DriverGLStates.setTextureMode(CDriverGLStates::TextureDisabled); _DriverGLStates.setTextureMode(CDriverGLStates3::TextureDisabled);
#ifndef USE_OPENGLES #ifndef USE_OPENGLES
if (_Extensions.ATITextureEnvCombine3) if (_Extensions.ATITextureEnvCombine3)
@ -1907,7 +1907,7 @@ static void forceActivateTexEnvModeEnvCombine4(const CMaterial::CTexEnv &env)
#endif #endif
// *************************************************************************** // ***************************************************************************
void CDriverGL::forceActivateTexEnvMode(uint stage, const CMaterial::CTexEnv &env) void CDriverGL3::forceActivateTexEnvMode(uint stage, const CMaterial::CTexEnv &env)
{ {
H_AUTO_OGL(forceActivateTexEnvMode) H_AUTO_OGL(forceActivateTexEnvMode)
// cache mgt. // cache mgt.
@ -2150,9 +2150,9 @@ void CDriverGL::forceActivateTexEnvMode(uint stage, const CMaterial::CTexEnv &
} }
// *************************************************************************** // ***************************************************************************
void CDriverGL::activateTexEnvColor(uint stage, NLMISC::CRGBA col) void CDriverGL3::activateTexEnvColor(uint stage, NLMISC::CRGBA col)
{ {
H_AUTO_OGL(CDriverGL_activateTexEnvColor) H_AUTO_OGL(CDriverGL3_activateTexEnvColor)
if (col != _CurrentTexEnv[stage].ConstantColor) if (col != _CurrentTexEnv[stage].ConstantColor)
{ {
forceActivateTexEnvColor(stage, col); forceActivateTexEnvColor(stage, col);
@ -2160,9 +2160,9 @@ void CDriverGL::activateTexEnvColor(uint stage, NLMISC::CRGBA col)
} }
// *************************************************************************** // ***************************************************************************
void CDriverGL::activateTexEnvMode(uint stage, const CMaterial::CTexEnv &env) void CDriverGL3::activateTexEnvMode(uint stage, const CMaterial::CTexEnv &env)
{ {
H_AUTO_OGL(CDriverGL_activateTexEnvMode) H_AUTO_OGL(CDriverGL3_activateTexEnvMode)
// If a special Texture environnement is setuped, or if not the same normal texture environnement, // If a special Texture environnement is setuped, or if not the same normal texture environnement,
// must setup a new normal Texture environnement. // must setup a new normal Texture environnement.
if(_CurrentTexEnvSpecial[stage] != TexEnvSpecialDisabled || _CurrentTexEnv[stage].EnvPacked!= env.EnvPacked) if(_CurrentTexEnvSpecial[stage] != TexEnvSpecialDisabled || _CurrentTexEnv[stage].EnvPacked!= env.EnvPacked)
@ -2173,9 +2173,9 @@ void CDriverGL::activateTexEnvMode(uint stage, const CMaterial::CTexEnv &env)
// *************************************************************************** // ***************************************************************************
void CDriverGL::activateTexEnvColor(uint stage, const CMaterial::CTexEnv &env) void CDriverGL3::activateTexEnvColor(uint stage, const CMaterial::CTexEnv &env)
{ {
H_AUTO_OGL(CDriverGL_activateTexEnvColor) H_AUTO_OGL(CDriverGL3_activateTexEnvColor)
if(_CurrentTexEnv[stage].ConstantColor!= env.ConstantColor) if(_CurrentTexEnv[stage].ConstantColor!= env.ConstantColor)
{ {
forceActivateTexEnvColor(stage, env); forceActivateTexEnvColor(stage, env);
@ -2184,16 +2184,16 @@ void CDriverGL::activateTexEnvColor(uint stage, const CMaterial::CTexEnv &env)
// *************************************************************************** // ***************************************************************************
void CDriverGL::forceDXTCCompression(bool dxtcComp) void CDriverGL3::forceDXTCCompression(bool dxtcComp)
{ {
H_AUTO_OGL(CDriverGL_forceDXTCCompression) H_AUTO_OGL(CDriverGL3_forceDXTCCompression)
_ForceDXTCCompression= dxtcComp; _ForceDXTCCompression= dxtcComp;
} }
// *************************************************************************** // ***************************************************************************
void CDriverGL::setAnisotropicFilter(sint filtering) void CDriverGL3::setAnisotropicFilter(sint filtering)
{ {
H_AUTO_OGL(CDriverGL_setAnisotropicFiltering); H_AUTO_OGL(CDriverGL3_setAnisotropicFiltering);
if (!_Extensions.EXTTextureFilterAnisotropic) return; if (!_Extensions.EXTTextureFilterAnisotropic) return;
@ -2210,9 +2210,9 @@ void CDriverGL::setAnisotropicFilter(sint filtering)
} }
// *************************************************************************** // ***************************************************************************
void CDriverGL::forceTextureResize(uint divisor) void CDriverGL3::forceTextureResize(uint divisor)
{ {
H_AUTO_OGL(CDriverGL_forceTextureResize) H_AUTO_OGL(CDriverGL3_forceTextureResize)
clamp(divisor, 1U, 256U); clamp(divisor, 1U, 256U);
// 16 -> 4. // 16 -> 4.
@ -2221,9 +2221,9 @@ void CDriverGL::forceTextureResize(uint divisor)
// *************************************************************************** // ***************************************************************************
void CDriverGL::swapTextureHandle(ITexture &tex0, ITexture &tex1) void CDriverGL3::swapTextureHandle(ITexture &tex0, ITexture &tex1)
{ {
H_AUTO_OGL(CDriverGL_swapTextureHandle) H_AUTO_OGL(CDriverGL3_swapTextureHandle)
// ensure creation of both texture // ensure creation of both texture
setupTexture(tex0); setupTexture(tex0);
setupTexture(tex1); setupTexture(tex1);
@ -2235,8 +2235,8 @@ void CDriverGL::swapTextureHandle(ITexture &tex0, ITexture &tex1)
} }
// get the handle. // get the handle.
CTextureDrvInfosGL *t0= getTextureGl(tex0); CTextureDrvInfosGL3 *t0= getTextureGl(tex0);
CTextureDrvInfosGL *t1= getTextureGl(tex1); CTextureDrvInfosGL3 *t1= getTextureGl(tex1);
/* Swap contents. Can't swap directly the pointers cause would have to change all CTextureDrvShare which point on /* Swap contents. Can't swap directly the pointers cause would have to change all CTextureDrvShare which point on
Can't do swap(*t0, *t1), because must keep the correct _DriverIterator Can't do swap(*t0, *t1), because must keep the correct _DriverIterator
@ -2260,15 +2260,15 @@ void CDriverGL::swapTextureHandle(ITexture &tex0, ITexture &tex1)
// *************************************************************************** // ***************************************************************************
uint CDriverGL::getTextureHandle(const ITexture &tex) uint CDriverGL3::getTextureHandle(const ITexture &tex)
{ {
H_AUTO_OGL(CDriverGL_getTextureHandle) H_AUTO_OGL(CDriverGL3_getTextureHandle)
// If DrvShare not setuped // If DrvShare not setuped
if(!tex.TextureDrvShare) if(!tex.TextureDrvShare)
return 0; return 0;
// If DrvInfo not setuped // If DrvInfo not setuped
const CTextureDrvInfosGL *t0= (const CTextureDrvInfosGL*)(const ITextureDrvInfos*)(tex.TextureDrvShare->DrvTexture); const CTextureDrvInfosGL3 *t0= (const CTextureDrvInfosGL3*)(const ITextureDrvInfos*)(tex.TextureDrvShare->DrvTexture);
if(!t0) if(!t0)
return 0; return 0;
@ -2285,9 +2285,9 @@ uint CDriverGL::getTextureHandle(const ITexture &tex)
setRenderTarget (NULL) copies the modified framebuffer area into "tex" and then, updates the viewport and scissor setRenderTarget (NULL) copies the modified framebuffer area into "tex" and then, updates the viewport and scissor
*/ */
bool CDriverGL::setRenderTarget (ITexture *tex, uint32 x, uint32 y, uint32 width, uint32 height, uint32 mipmapLevel, uint32 cubeFace) bool CDriverGL3::setRenderTarget (ITexture *tex, uint32 x, uint32 y, uint32 width, uint32 height, uint32 mipmapLevel, uint32 cubeFace)
{ {
H_AUTO_OGL(CDriverGL_setRenderTarget ) H_AUTO_OGL(CDriverGL3_setRenderTarget )
// make backup of offscreen buffer to old texture if not using FBOs // make backup of offscreen buffer to old texture if not using FBOs
if (!_RenderTargetFBO && _TextureTarget && _TextureTargetUpload && (_TextureTarget != tex || _TextureTargetCubeFace != cubeFace)) if (!_RenderTargetFBO && _TextureTarget && _TextureTargetUpload && (_TextureTarget != tex || _TextureTargetCubeFace != cubeFace))
@ -2355,7 +2355,7 @@ bool CDriverGL::setRenderTarget (ITexture *tex, uint32 x, uint32 y, uint32 width
// *************************************************************************** // ***************************************************************************
bool CDriverGL::copyTargetToTexture (ITexture *tex, bool CDriverGL3::copyTargetToTexture (ITexture *tex,
uint32 offsetx, uint32 offsetx,
uint32 offsety, uint32 offsety,
uint32 x, uint32 x,
@ -2364,7 +2364,7 @@ bool CDriverGL::copyTargetToTexture (ITexture *tex,
uint32 height, uint32 height,
uint32 mipmapLevel) uint32 mipmapLevel)
{ {
H_AUTO_OGL(CDriverGL_copyTargetToTexture) H_AUTO_OGL(CDriverGL3_copyTargetToTexture)
if (!_TextureTarget) if (!_TextureTarget)
return false; return false;
_TextureTargetUpload = false; _TextureTargetUpload = false;
@ -2384,9 +2384,9 @@ bool CDriverGL::copyTargetToTexture (ITexture *tex,
// *************************************************************************** // ***************************************************************************
bool CDriverGL::getRenderTargetSize (uint32 &width, uint32 &height) bool CDriverGL3::getRenderTargetSize (uint32 &width, uint32 &height)
{ {
H_AUTO_OGL(CDriverGL_getRenderTargetSize) H_AUTO_OGL(CDriverGL3_getRenderTargetSize)
if (_TextureTarget) if (_TextureTarget)
{ {
width = _TextureTarget->getWidth(); width = _TextureTarget->getWidth();

@ -52,13 +52,13 @@ namespace NL3D {
#ifdef USE_OPENGLES #ifdef USE_OPENGLES
namespace NLDRIVERGLES { namespace NLDRIVERGLES {
#else #else
namespace NLDRIVERGL { namespace NLDRIVERGL3 {
#endif #endif
#endif #endif
// *************************************************************************** // ***************************************************************************
CVBDrvInfosGL::CVBDrvInfosGL(CDriverGL *drv, ItVBDrvInfoPtrList it, CVertexBuffer *vb) : IVBDrvInfos(drv, it, vb) CVBDrvInfosGL3::CVBDrvInfosGL3(CDriverGL3 *drv, ItVBDrvInfoPtrList it, CVertexBuffer *vb) : IVBDrvInfos(drv, it, vb)
{ {
H_AUTO_OGL(CVBDrvInfosGL_CVBDrvInfosGL) H_AUTO_OGL(CVBDrvInfosGL_CVBDrvInfosGL)
_DriverGL = drv; _DriverGL = drv;
@ -68,7 +68,7 @@ CVBDrvInfosGL::CVBDrvInfosGL(CDriverGL *drv, ItVBDrvInfoPtrList it, CVertexBuffe
// *************************************************************************** // ***************************************************************************
CVBDrvInfosGL::~CVBDrvInfosGL() CVBDrvInfosGL3::~CVBDrvInfosGL3()
{ {
H_AUTO_OGL(CVBDrvInfosGL_CVBDrvInfosGLDtor) H_AUTO_OGL(CVBDrvInfosGL_CVBDrvInfosGLDtor)
// Restaure non resident memory // Restaure non resident memory
@ -92,7 +92,7 @@ CVBDrvInfosGL::~CVBDrvInfosGL()
} }
// *************************************************************************** // ***************************************************************************
uint8 *CVBDrvInfosGL::lock (uint /* first */, uint /* last */, bool /* readOnly */) uint8 *CVBDrvInfosGL3::lock (uint /* first */, uint /* last */, bool /* readOnly */)
{ {
H_AUTO_OGL(CVBDrvInfosGL_lock) H_AUTO_OGL(CVBDrvInfosGL_lock)
if (_VBHard) if (_VBHard)
@ -108,7 +108,7 @@ uint8 *CVBDrvInfosGL::lock (uint /* first */, uint /* last */, bool /* readOnly
} }
// *************************************************************************** // ***************************************************************************
void CVBDrvInfosGL::unlock (uint first, uint last) void CVBDrvInfosGL3::unlock (uint first, uint last)
{ {
H_AUTO_OGL(CVBDrvInfosGL_unlock) H_AUTO_OGL(CVBDrvInfosGL_unlock)
if (_VBHard) if (_VBHard)
@ -123,9 +123,9 @@ void CVBDrvInfosGL::unlock (uint first, uint last)
} }
// *************************************************************************** // ***************************************************************************
bool CDriverGL::setupVertexBuffer(CVertexBuffer& VB) bool CDriverGL3::setupVertexBuffer(CVertexBuffer& VB)
{ {
H_AUTO_OGL(CDriverGL_setupVertexBuffer) H_AUTO_OGL(CDriverGL3_setupVertexBuffer)
// 2. If necessary, do modifications. // 2. If necessary, do modifications.
//================================== //==================================
const bool touched = (VB.getTouchFlags() & (CVertexBuffer::TouchedReserve|CVertexBuffer::TouchedVertexFormat)) != 0; const bool touched = (VB.getTouchFlags() & (CVertexBuffer::TouchedReserve|CVertexBuffer::TouchedVertexFormat)) != 0;
@ -144,7 +144,7 @@ bool CDriverGL::setupVertexBuffer(CVertexBuffer& VB)
// insert into driver list. (so it is deleted when driver is deleted). // insert into driver list. (so it is deleted when driver is deleted).
ItVBDrvInfoPtrList it= _VBDrvInfos.insert(_VBDrvInfos.end(), (NL3D::IVBDrvInfos*)NULL); ItVBDrvInfoPtrList it= _VBDrvInfos.insert(_VBDrvInfos.end(), (NL3D::IVBDrvInfos*)NULL);
// create and set iterator, for future deletion. // create and set iterator, for future deletion.
CVBDrvInfosGL *info = new CVBDrvInfosGL(this, it, &VB); CVBDrvInfosGL3 *info = new CVBDrvInfosGL3(this, it, &VB);
*it= VB.DrvInfos = info; *it= VB.DrvInfos = info;
// Preferred memory // Preferred memory
@ -179,9 +179,9 @@ bool CDriverGL::setupVertexBuffer(CVertexBuffer& VB)
// *************************************************************************** // ***************************************************************************
bool CDriverGL::activeVertexBuffer(CVertexBuffer& VB) bool CDriverGL3::activeVertexBuffer(CVertexBuffer& VB)
{ {
H_AUTO_OGL(CDriverGL_activeVertexBuffer) H_AUTO_OGL(CDriverGL3_activeVertexBuffer)
// NB: must duplicate changes in activeVertexBufferHard() // NB: must duplicate changes in activeVertexBufferHard()
uint32 flags; uint32 flags;
@ -206,7 +206,7 @@ bool CDriverGL::activeVertexBuffer(CVertexBuffer& VB)
//=================== //===================
// For MultiPass Material. // For MultiPass Material.
CVertexBufferInfo::TVBMode lastVBMode = _LastVB.VBMode; CVertexBufferInfo::TVBMode lastVBMode = _LastVB.VBMode;
CVBDrvInfosGL *info= safe_cast<CVBDrvInfosGL*>((IVBDrvInfos*)VB.DrvInfos); CVBDrvInfosGL3 *info= safe_cast<CVBDrvInfosGL3*>((IVBDrvInfos*)VB.DrvInfos);
if (!info->_VBHard || (info->_VBHard && !info->_VBHard->isInvalid())) if (!info->_VBHard || (info->_VBHard && !info->_VBHard->isInvalid()))
{ {
_LastVB.setupVertexBuffer(VB); _LastVB.setupVertexBuffer(VB);
@ -243,18 +243,18 @@ bool CDriverGL::activeVertexBuffer(CVertexBuffer& VB)
} }
// *************************************************************************** // ***************************************************************************
bool CDriverGL::activeIndexBuffer(CIndexBuffer& IB) bool CDriverGL3::activeIndexBuffer(CIndexBuffer& IB)
{ {
H_AUTO_OGL(CDriverGL_activeIndexBuffer) H_AUTO_OGL(CDriverGL3_activeIndexBuffer)
_LastIB.setupIndexBuffer(IB); _LastIB.setupIndexBuffer(IB);
return true; return true;
} }
// *************************************************************************** // ***************************************************************************
bool CDriverGL::renderLines(CMaterial& mat, uint32 firstIndex, uint32 nlines) bool CDriverGL3::renderLines(CMaterial& mat, uint32 firstIndex, uint32 nlines)
{ {
H_AUTO_OGL(CDriverGL_renderLines) H_AUTO_OGL(CDriverGL3_renderLines)
// update matrix and Light in OpenGL if needed // update matrix and Light in OpenGL if needed
refreshRenderSetup(); refreshRenderSetup();
@ -307,9 +307,9 @@ bool CDriverGL::renderLines(CMaterial& mat, uint32 firstIndex, uint32 nlines)
// *************************************************************************** // ***************************************************************************
bool CDriverGL::renderTriangles(CMaterial& mat, uint32 firstIndex, uint32 ntris) bool CDriverGL3::renderTriangles(CMaterial& mat, uint32 firstIndex, uint32 ntris)
{ {
H_AUTO_OGL(CDriverGL_renderTriangles); H_AUTO_OGL(CDriverGL3_renderTriangles);
// update matrix and Light in OpenGL if needed // update matrix and Light in OpenGL if needed
refreshRenderSetup(); refreshRenderSetup();
@ -367,9 +367,9 @@ bool CDriverGL::renderTriangles(CMaterial& mat, uint32 firstIndex, uint32 ntris)
// *************************************************************************** // ***************************************************************************
bool CDriverGL::renderSimpleTriangles(uint32 firstTri, uint32 ntris) bool CDriverGL3::renderSimpleTriangles(uint32 firstTri, uint32 ntris)
{ {
H_AUTO_OGL(CDriverGL_renderSimpleTriangles); H_AUTO_OGL(CDriverGL3_renderSimpleTriangles);
nlassert(ntris>0); nlassert(ntris>0);
@ -411,9 +411,9 @@ bool CDriverGL::renderSimpleTriangles(uint32 firstTri, uint32 ntris)
// *************************************************************************** // ***************************************************************************
bool CDriverGL::renderRawPoints(CMaterial& mat, uint32 startIndex, uint32 numPoints) bool CDriverGL3::renderRawPoints(CMaterial& mat, uint32 startIndex, uint32 numPoints)
{ {
H_AUTO_OGL(CDriverGL_renderRawPoints) H_AUTO_OGL(CDriverGL3_renderRawPoints)
// update matrix and Light in OpenGL if needed // update matrix and Light in OpenGL if needed
refreshRenderSetup(); refreshRenderSetup();
@ -452,9 +452,9 @@ bool CDriverGL::renderRawPoints(CMaterial& mat, uint32 startIndex, uint32 numPoi
// *************************************************************************** // ***************************************************************************
bool CDriverGL::renderRawLines(CMaterial& mat, uint32 startIndex, uint32 numLines) bool CDriverGL3::renderRawLines(CMaterial& mat, uint32 startIndex, uint32 numLines)
{ {
H_AUTO_OGL(CDriverGL_renderRawLines) H_AUTO_OGL(CDriverGL3_renderRawLines)
// update matrix and Light in OpenGL if needed // update matrix and Light in OpenGL if needed
refreshRenderSetup(); refreshRenderSetup();
@ -493,9 +493,9 @@ bool CDriverGL::renderRawLines(CMaterial& mat, uint32 startIndex, uint32 numLine
// *************************************************************************** // ***************************************************************************
bool CDriverGL::renderRawTriangles(CMaterial& mat, uint32 startIndex, uint32 numTris) bool CDriverGL3::renderRawTriangles(CMaterial& mat, uint32 startIndex, uint32 numTris)
{ {
H_AUTO_OGL(CDriverGL_renderRawTriangles) H_AUTO_OGL(CDriverGL3_renderRawTriangles)
// update matrix and Light in OpenGL if needed // update matrix and Light in OpenGL if needed
refreshRenderSetup(); refreshRenderSetup();
@ -536,9 +536,9 @@ bool CDriverGL::renderRawTriangles(CMaterial& mat, uint32 startIndex, uint32 num
// *************************************************************************** // ***************************************************************************
bool CDriverGL::renderRawQuads(CMaterial& mat, uint32 startIndex, uint32 numQuads) bool CDriverGL3::renderRawQuads(CMaterial& mat, uint32 startIndex, uint32 numQuads)
{ {
H_AUTO_OGL(CDriverGL_renderRawQuads) H_AUTO_OGL(CDriverGL3_renderRawQuads)
if (!numQuads) return true; if (!numQuads) return true;
// update matrix and Light in OpenGL if needed // update matrix and Light in OpenGL if needed
refreshRenderSetup(); refreshRenderSetup();
@ -664,9 +664,9 @@ bool CDriverGL::renderRawQuads(CMaterial& mat, uint32 startIndex, uint32 numQuad
// *************************************************************************** // ***************************************************************************
void CDriverGL::setupUVPtr(uint stage, CVertexBufferInfo &VB, uint uvId) void CDriverGL3::setupUVPtr(uint stage, CVertexBufferInfo &VB, uint uvId)
{ {
H_AUTO_OGL(CDriverGL_setupUVPtr) H_AUTO_OGL(CDriverGL3_setupUVPtr)
// sould not be called with vertex program Array setuped. // sould not be called with vertex program Array setuped.
nlassert(!_LastSetupGLArrayVertexProgram); nlassert(!_LastSetupGLArrayVertexProgram);
@ -713,9 +713,9 @@ void CDriverGL::setupUVPtr(uint stage, CVertexBufferInfo &VB, uint uvId)
// *************************************************************************** // ***************************************************************************
void CDriverGL::mapTextureStageToUV(uint stage, uint uv) void CDriverGL3::mapTextureStageToUV(uint stage, uint uv)
{ {
H_AUTO_OGL(CDriverGL_mapTextureStageToUV) H_AUTO_OGL(CDriverGL3_mapTextureStageToUV)
// Just call it for last VertexBuffer setuped. // Just call it for last VertexBuffer setuped.
setupUVPtr(stage, _LastVB, uv); setupUVPtr(stage, _LastVB, uv);
} }
@ -730,41 +730,41 @@ void CDriverGL::mapTextureStageToUV(uint stage, uint uv)
// *************************************************************************** // ***************************************************************************
bool CDriverGL::supportVertexBufferHard() const bool CDriverGL3::supportVertexBufferHard() const
{ {
H_AUTO_OGL(CDriverGL_supportVertexBufferHard) H_AUTO_OGL(CDriverGL3_supportVertexBufferHard)
return _SupportVBHard; return _SupportVBHard;
} }
// *************************************************************************** // ***************************************************************************
bool CDriverGL::supportVolatileVertexBuffer() const bool CDriverGL3::supportVolatileVertexBuffer() const
{ {
H_AUTO_OGL(CDriverGL_supportVolatileVertexBuffer) H_AUTO_OGL(CDriverGL3_supportVolatileVertexBuffer)
return false; return false;
} }
// *************************************************************************** // ***************************************************************************
bool CDriverGL::slowUnlockVertexBufferHard() const bool CDriverGL3::slowUnlockVertexBufferHard() const
{ {
H_AUTO_OGL(CDriverGL_slowUnlockVertexBufferHard) H_AUTO_OGL(CDriverGL3_slowUnlockVertexBufferHard)
return _SlowUnlockVBHard; return _SlowUnlockVBHard;
} }
// *************************************************************************** // ***************************************************************************
uint CDriverGL::getMaxVerticesByVertexBufferHard() const uint CDriverGL3::getMaxVerticesByVertexBufferHard() const
{ {
H_AUTO_OGL(CDriverGL_getMaxVerticesByVertexBufferHard) H_AUTO_OGL(CDriverGL3_getMaxVerticesByVertexBufferHard)
return _MaxVerticesByVBHard; return _MaxVerticesByVBHard;
} }
// *************************************************************************** // ***************************************************************************
IVertexBufferHardGL *CDriverGL::createVertexBufferHard(uint size, uint numVertices, CVertexBuffer::TPreferredMemory vbType, CVertexBuffer *vb) IVertexBufferHardGL *CDriverGL3::createVertexBufferHard(uint size, uint numVertices, CVertexBuffer::TPreferredMemory vbType, CVertexBuffer *vb)
{ {
H_AUTO_OGL(CDriverGL_createVertexBufferHard) H_AUTO_OGL(CDriverGL3_createVertexBufferHard)
// choose the VertexArrayRange of good type // choose the VertexArrayRange of good type
IVertexArrayRange *vertexArrayRange= NULL; IVertexArrayRange *vertexArrayRange= NULL;
switch(vbType) switch(vbType)
@ -810,7 +810,7 @@ IVertexBufferHardGL *CDriverGL::createVertexBufferHard(uint size, uint numVertic
// *************************************************************************** // ***************************************************************************
const uint CDriverGL::NumCoordinatesType[CVertexBuffer::NumType]= const uint CDriverGL3::NumCoordinatesType[CVertexBuffer::NumType]=
{ {
1, // Double1 1, // Double1
1, // Float1 1, // Float1
@ -829,7 +829,7 @@ const uint CDriverGL::NumCoordinatesType[CVertexBuffer::NumType]=
// *************************************************************************** // ***************************************************************************
const uint CDriverGL::GLType[CVertexBuffer::NumType]= const uint CDriverGL3::GLType[CVertexBuffer::NumType]=
{ {
#ifdef USE_OPENGLES #ifdef USE_OPENGLES
GL_FLOAT, // Double1 GL_FLOAT, // Double1
@ -863,7 +863,7 @@ const uint CDriverGL::GLType[CVertexBuffer::NumType]=
}; };
// *************************************************************************** // ***************************************************************************
const bool CDriverGL::GLTypeIsIntegral[CVertexBuffer::NumType] = const bool CDriverGL3::GLTypeIsIntegral[CVertexBuffer::NumType] =
{ {
false, // Double1 false, // Double1
false, // Float1 false, // Float1
@ -883,7 +883,7 @@ const bool CDriverGL::GLTypeIsIntegral[CVertexBuffer::NumType] =
// *************************************************************************** // ***************************************************************************
const uint CDriverGL::GLVertexAttribIndex[CVertexBuffer::NumValue]= const uint CDriverGL3::GLVertexAttribIndex[CVertexBuffer::NumValue]=
{ {
0, // Position 0, // Position
2, // Normal 2, // Normal
@ -906,9 +906,9 @@ const uint CDriverGL::GLVertexAttribIndex[CVertexBuffer::NumValue]=
// *************************************************************************** // ***************************************************************************
void CDriverGL::setupGlArraysStd(CVertexBufferInfo &vb) void CDriverGL3::setupGlArraysStd(CVertexBufferInfo &vb)
{ {
H_AUTO_OGL(CDriverGL_setupGlArraysStd) H_AUTO_OGL(CDriverGL3_setupGlArraysStd)
uint32 flags= vb.VertexFormat; uint32 flags= vb.VertexFormat;
if (vb.VBMode == CVertexBufferInfo::HwARB) if (vb.VBMode == CVertexBufferInfo::HwARB)
@ -1023,9 +1023,9 @@ void CDriverGL::setupGlArraysStd(CVertexBufferInfo &vb)
// *************************************************************************** // ***************************************************************************
void CDriverGL::toggleGlArraysForNVVertexProgram() void CDriverGL3::toggleGlArraysForNVVertexProgram()
{ {
H_AUTO_OGL(CDriverGL_toggleGlArraysForNVVertexProgram) H_AUTO_OGL(CDriverGL3_toggleGlArraysForNVVertexProgram)
// If change of setup type, must disable olds. // If change of setup type, must disable olds.
//======================= //=======================
@ -1066,9 +1066,9 @@ void CDriverGL::toggleGlArraysForNVVertexProgram()
} }
// *************************************************************************** // ***************************************************************************
void CDriverGL::toggleGlArraysForARBVertexProgram() void CDriverGL3::toggleGlArraysForARBVertexProgram()
{ {
H_AUTO_OGL(CDriverGL_toggleGlArraysForARBVertexProgram) H_AUTO_OGL(CDriverGL3_toggleGlArraysForARBVertexProgram)
// If change of setup type, must disable olds. // If change of setup type, must disable olds.
//======================= //=======================
@ -1138,9 +1138,9 @@ void CDriverGL::toggleGlArraysForARBVertexProgram()
// *************************************************************************** // ***************************************************************************
void CDriverGL::toggleGlArraysForEXTVertexShader() void CDriverGL3::toggleGlArraysForEXTVertexShader()
{ {
H_AUTO_OGL(CDriverGL_toggleGlArraysForEXTVertexShader) H_AUTO_OGL(CDriverGL3_toggleGlArraysForEXTVertexShader)
// If change of setup type, must disable olds. // If change of setup type, must disable olds.
//======================= //=======================
@ -1151,7 +1151,7 @@ void CDriverGL::toggleGlArraysForEXTVertexShader()
CVertexProgram *vp = _LastSetuppedVP; CVertexProgram *vp = _LastSetuppedVP;
if (vp) if (vp)
{ {
CVertexProgamDrvInfosGL *drvInfo = NLMISC::safe_cast<CVertexProgamDrvInfosGL *>((IVertexProgramDrvInfos *) vp->_DrvInfo); CVertexProgamDrvInfosGL3 *drvInfo = NLMISC::safe_cast<CVertexProgamDrvInfosGL3 *>((IVertexProgramDrvInfos *) vp->_DrvInfo);
if (drvInfo) if (drvInfo)
{ {
// Disable all VertexAttribs. // Disable all VertexAttribs.
@ -1185,9 +1185,9 @@ void CDriverGL::toggleGlArraysForEXTVertexShader()
} }
// *************************************************************************** // ***************************************************************************
void CDriverGL::setupGlArraysForNVVertexProgram(CVertexBufferInfo &vb) void CDriverGL3::setupGlArraysForNVVertexProgram(CVertexBufferInfo &vb)
{ {
H_AUTO_OGL(CDriverGL_setupGlArraysForNVVertexProgram) H_AUTO_OGL(CDriverGL3_setupGlArraysForNVVertexProgram)
uint16 flags= vb.VertexFormat; uint16 flags= vb.VertexFormat;
if (vb.VBMode == CVertexBufferInfo::HwARB) if (vb.VBMode == CVertexBufferInfo::HwARB)
@ -1302,9 +1302,9 @@ static const GLboolean ARBVertexProgramMustNormalizeAttrib[] =
}; };
// *************************************************************************** // ***************************************************************************
void CDriverGL::setupGlArraysForARBVertexProgram(CVertexBufferInfo &vb) void CDriverGL3::setupGlArraysForARBVertexProgram(CVertexBufferInfo &vb)
{ {
H_AUTO_OGL(CDriverGL_setupGlArraysForARBVertexProgram) H_AUTO_OGL(CDriverGL3_setupGlArraysForARBVertexProgram)
uint32 flags= vb.VertexFormat; uint32 flags= vb.VertexFormat;
@ -1389,14 +1389,14 @@ void CDriverGL::setupGlArraysForARBVertexProgram(CVertexBufferInfo &vb)
// *************************************************************************** // ***************************************************************************
void CDriverGL::setupGlArraysForEXTVertexShader(CVertexBufferInfo &vb) void CDriverGL3::setupGlArraysForEXTVertexShader(CVertexBufferInfo &vb)
{ {
H_AUTO_OGL(CDriverGL_setupGlArraysForEXTVertexShader) H_AUTO_OGL(CDriverGL3_setupGlArraysForEXTVertexShader)
CVertexProgram *vp = _LastSetuppedVP; CVertexProgram *vp = _LastSetuppedVP;
if (!vp) return; if (!vp) return;
CVertexProgamDrvInfosGL *drvInfo = NLMISC::safe_cast<CVertexProgamDrvInfosGL *>((IVertexProgramDrvInfos *) vp->_DrvInfo); CVertexProgamDrvInfosGL3 *drvInfo = NLMISC::safe_cast<CVertexProgamDrvInfosGL3 *>((IVertexProgramDrvInfos *) vp->_DrvInfo);
if (!drvInfo) return; if (!drvInfo) return;
uint32 flags= vb.VertexFormat; uint32 flags= vb.VertexFormat;
@ -1438,7 +1438,7 @@ void CDriverGL::setupGlArraysForEXTVertexShader(CVertexBufferInfo &vb)
case CVertexBuffer::Weight: // skin weight case CVertexBuffer::Weight: // skin weight
{ {
nlassert(NumCoordinatesType[type] == 4); // variant, only 4 component supported nlassert(NumCoordinatesType[type] == 4); // variant, only 4 component supported
nglVariantArrayObjectATI(drvInfo->Variants[CDriverGL::EVSSkinWeightVariant], GLType[type], vb.VertexSize, vb.VertexObjectId, (ptrdiff_t) vb.ValuePtr[CVertexBuffer::Weight]); nglVariantArrayObjectATI(drvInfo->Variants[CDriverGL3::EVSSkinWeightVariant], GLType[type], vb.VertexSize, vb.VertexObjectId, (ptrdiff_t) vb.ValuePtr[CVertexBuffer::Weight]);
} }
break; break;
case CVertexBuffer::Normal: // normal case CVertexBuffer::Normal: // normal
@ -1457,21 +1457,21 @@ void CDriverGL::setupGlArraysForEXTVertexShader(CVertexBufferInfo &vb)
{ {
// implemented using a variant, as not available with EXTVertexShader // implemented using a variant, as not available with EXTVertexShader
nlassert(NumCoordinatesType[type] == 4); // variant, only 4 component supported nlassert(NumCoordinatesType[type] == 4); // variant, only 4 component supported
nglVariantArrayObjectATI(drvInfo->Variants[CDriverGL::EVSSecondaryColorVariant], GLType[type], vb.VertexSize, vb.VertexObjectId, (ptrdiff_t) vb.ValuePtr[CVertexBuffer::SecondaryColor]); nglVariantArrayObjectATI(drvInfo->Variants[CDriverGL3::EVSSecondaryColorVariant], GLType[type], vb.VertexSize, vb.VertexObjectId, (ptrdiff_t) vb.ValuePtr[CVertexBuffer::SecondaryColor]);
} }
break; break;
case CVertexBuffer::Fog: // fog coordinate case CVertexBuffer::Fog: // fog coordinate
{ {
// implemented using a variant // implemented using a variant
nlassert(NumCoordinatesType[type] == 4); // variant, only 4 component supported nlassert(NumCoordinatesType[type] == 4); // variant, only 4 component supported
nglVariantArrayObjectATI(drvInfo->Variants[CDriverGL::EVSFogCoordsVariant], GLType[type], vb.VertexSize, vb.VertexObjectId, (ptrdiff_t) vb.ValuePtr[CVertexBuffer::Fog]); nglVariantArrayObjectATI(drvInfo->Variants[CDriverGL3::EVSFogCoordsVariant], GLType[type], vb.VertexSize, vb.VertexObjectId, (ptrdiff_t) vb.ValuePtr[CVertexBuffer::Fog]);
} }
break; break;
case CVertexBuffer::PaletteSkin: // palette skin case CVertexBuffer::PaletteSkin: // palette skin
{ {
// implemented using a variant // implemented using a variant
nlassert(NumCoordinatesType[type] == 4); // variant, only 4 component supported nlassert(NumCoordinatesType[type] == 4); // variant, only 4 component supported
nglVariantArrayObjectATI(drvInfo->Variants[CDriverGL::EVSPaletteSkinVariant], GLType[type], vb.VertexSize, vb.VertexObjectId, (ptrdiff_t) vb.ValuePtr[CVertexBuffer::PaletteSkin]); nglVariantArrayObjectATI(drvInfo->Variants[CDriverGL3::EVSPaletteSkinVariant], GLType[type], vb.VertexSize, vb.VertexObjectId, (ptrdiff_t) vb.ValuePtr[CVertexBuffer::PaletteSkin]);
} }
break; break;
case CVertexBuffer::Empty: // empty case CVertexBuffer::Empty: // empty
@ -1510,7 +1510,7 @@ void CDriverGL::setupGlArraysForEXTVertexShader(CVertexBufferInfo &vb)
{ {
nlassert(NumCoordinatesType[type] == 4); // variant, only 4 component supported nlassert(NumCoordinatesType[type] == 4); // variant, only 4 component supported
#ifndef USE_OPENGLES #ifndef USE_OPENGLES
nglVariantPointerEXT(drvInfo->Variants[CDriverGL::EVSSkinWeightVariant], GLType[type], vb.VertexSize, vb.ValuePtr[value]); nglVariantPointerEXT(drvInfo->Variants[CDriverGL3::EVSSkinWeightVariant], GLType[type], vb.VertexSize, vb.ValuePtr[value]);
#endif #endif
} }
break; break;
@ -1531,7 +1531,7 @@ void CDriverGL::setupGlArraysForEXTVertexShader(CVertexBufferInfo &vb)
// implemented using a variant, as not available with EXTVertexShader // implemented using a variant, as not available with EXTVertexShader
nlassert(NumCoordinatesType[type] == 4); // variant, only 4 component supported nlassert(NumCoordinatesType[type] == 4); // variant, only 4 component supported
#ifndef USE_OPENGLES #ifndef USE_OPENGLES
nglVariantPointerEXT(drvInfo->Variants[CDriverGL::EVSSecondaryColorVariant], GLType[type], vb.VertexSize, vb.ValuePtr[value]); nglVariantPointerEXT(drvInfo->Variants[CDriverGL3::EVSSecondaryColorVariant], GLType[type], vb.VertexSize, vb.ValuePtr[value]);
#endif #endif
} }
break; break;
@ -1540,7 +1540,7 @@ void CDriverGL::setupGlArraysForEXTVertexShader(CVertexBufferInfo &vb)
// implemented using a variant // implemented using a variant
nlassert(NumCoordinatesType[type] == 4); // variant, only 4 component supported nlassert(NumCoordinatesType[type] == 4); // variant, only 4 component supported
#ifndef USE_OPENGLES #ifndef USE_OPENGLES
nglVariantPointerEXT(drvInfo->Variants[CDriverGL::EVSFogCoordsVariant], GLType[type], vb.VertexSize, vb.ValuePtr[value]); nglVariantPointerEXT(drvInfo->Variants[CDriverGL3::EVSFogCoordsVariant], GLType[type], vb.VertexSize, vb.ValuePtr[value]);
#endif #endif
} }
break; break;
@ -1549,7 +1549,7 @@ void CDriverGL::setupGlArraysForEXTVertexShader(CVertexBufferInfo &vb)
// implemented using a variant // implemented using a variant
nlassert(NumCoordinatesType[type] == 4); // variant, only 4 component supported nlassert(NumCoordinatesType[type] == 4); // variant, only 4 component supported
#ifndef USE_OPENGLES #ifndef USE_OPENGLES
nglVariantPointerEXT(drvInfo->Variants[CDriverGL::EVSPaletteSkinVariant], GLType[type], vb.VertexSize, vb.ValuePtr[value]); nglVariantPointerEXT(drvInfo->Variants[CDriverGL3::EVSPaletteSkinVariant], GLType[type], vb.VertexSize, vb.ValuePtr[value]);
#endif #endif
} }
break; break;
@ -1585,9 +1585,9 @@ void CDriverGL::setupGlArraysForEXTVertexShader(CVertexBufferInfo &vb)
// *************************************************************************** // ***************************************************************************
void CDriverGL::setupGlArrays(CVertexBufferInfo &vb) void CDriverGL3::setupGlArrays(CVertexBufferInfo &vb)
{ {
H_AUTO_OGL(CDriverGL_setupGlArrays) H_AUTO_OGL(CDriverGL3_setupGlArrays)
// Standard case (NVVertexProgram or no vertex program case) // Standard case (NVVertexProgram or no vertex program case)
if (_Extensions.NVVertexProgram) if (_Extensions.NVVertexProgram)
@ -1640,7 +1640,7 @@ void CDriverGL::setupGlArrays(CVertexBufferInfo &vb)
// *************************************************************************** // ***************************************************************************
void CVertexBufferInfo::setupVertexBuffer(CVertexBuffer &vb) void CVertexBufferInfo::setupVertexBuffer(CVertexBuffer &vb)
{ {
H_AUTO_OGL(CDriverGL_setupVertexBuffer) H_AUTO_OGL(CDriverGL3_setupVertexBuffer)
sint i; sint i;
VertexFormat= vb.getVertexFormat(); VertexFormat= vb.getVertexFormat();
VertexSize= vb.getVertexSize(); VertexSize= vb.getVertexSize();
@ -1649,7 +1649,7 @@ void CVertexBufferInfo::setupVertexBuffer(CVertexBuffer &vb)
// Lock the buffer // Lock the buffer
CVertexBufferReadWrite access; CVertexBufferReadWrite access;
uint8 *ptr; uint8 *ptr;
CVBDrvInfosGL *info= safe_cast<CVBDrvInfosGL*>((IVBDrvInfos*)vb.DrvInfos); CVBDrvInfosGL3 *info= safe_cast<CVBDrvInfosGL3*>((IVBDrvInfos*)vb.DrvInfos);
nlassert (info); nlassert (info);
if (info->_VBHard) if (info->_VBHard)
{ {
@ -1687,9 +1687,9 @@ void CVertexBufferInfo::setupVertexBuffer(CVertexBuffer &vb)
// *************************************************************************** // ***************************************************************************
void CDriverGL::resetVertexArrayRange() void CDriverGL3::resetVertexArrayRange()
{ {
H_AUTO_OGL(CDriverGL_resetVertexArrayRange) H_AUTO_OGL(CDriverGL3_resetVertexArrayRange)
if(_CurrentVertexBufferHard) if(_CurrentVertexBufferHard)
{ {
// Must ensure it has ended any drawing // Must ensure it has ended any drawing
@ -1710,9 +1710,9 @@ void CDriverGL::resetVertexArrayRange()
// *************************************************************************** // ***************************************************************************
bool CDriverGL::initVertexBufferHard(uint agpMem, uint vramMem) bool CDriverGL3::initVertexBufferHard(uint agpMem, uint vramMem)
{ {
H_AUTO_OGL(CDriverGL_initVertexBufferHard) H_AUTO_OGL(CDriverGL3_initVertexBufferHard)
if(!supportVertexBufferHard()) if(!supportVertexBufferHard())
return false; return false;
@ -1781,9 +1781,9 @@ bool CDriverGL::initVertexBufferHard(uint agpMem, uint vramMem)
// *************************************************************************** // ***************************************************************************
uint32 CDriverGL::getAvailableVertexAGPMemory () uint32 CDriverGL3::getAvailableVertexAGPMemory ()
{ {
H_AUTO_OGL(CDriverGL_getAvailableVertexAGPMemory ) H_AUTO_OGL(CDriverGL3_getAvailableVertexAGPMemory )
if (_AGPVertexArrayRange) if (_AGPVertexArrayRange)
return _AGPVertexArrayRange->sizeAllocated(); return _AGPVertexArrayRange->sizeAllocated();
else else
@ -1792,9 +1792,9 @@ uint32 CDriverGL::getAvailableVertexAGPMemory ()
// *************************************************************************** // ***************************************************************************
uint32 CDriverGL::getAvailableVertexVRAMMemory () uint32 CDriverGL3::getAvailableVertexVRAMMemory ()
{ {
H_AUTO_OGL(CDriverGL_getAvailableVertexVRAMMemory ) H_AUTO_OGL(CDriverGL3_getAvailableVertexVRAMMemory )
if (_VRAMVertexArrayRange) if (_VRAMVertexArrayRange)
return _VRAMVertexArrayRange->sizeAllocated(); return _VRAMVertexArrayRange->sizeAllocated();
else else
@ -1803,9 +1803,9 @@ uint32 CDriverGL::getAvailableVertexVRAMMemory ()
// *************************************************************************** // ***************************************************************************
void CDriverGL::fenceOnCurVBHardIfNeeded(IVertexBufferHardGL *newVBHard) void CDriverGL3::fenceOnCurVBHardIfNeeded(IVertexBufferHardGL *newVBHard)
{ {
H_AUTO_OGL(CDriverGL_fenceOnCurVBHardIfNeeded); H_AUTO_OGL(CDriverGL3_fenceOnCurVBHardIfNeeded);
#ifndef USE_OPENGLES #ifndef USE_OPENGLES
// If old is not a VBHard, or if not a NVidia VBHard, no-op. // If old is not a VBHard, or if not a NVidia VBHard, no-op.

@ -30,7 +30,7 @@ namespace NL3D {
#ifdef USE_OPENGLES #ifdef USE_OPENGLES
namespace NLDRIVERGLES { namespace NLDRIVERGLES {
#else #else
namespace NLDRIVERGL { namespace NLDRIVERGL3 {
#endif #endif
#endif #endif
@ -47,7 +47,7 @@ namespace NLDRIVERGL {
// *************************************************************************** // ***************************************************************************
IVertexArrayRange::IVertexArrayRange(CDriverGL *drv) IVertexArrayRange::IVertexArrayRange(CDriverGL3 *drv)
{ {
H_AUTO_OGL(IVertexArrayRange_IVertexArrayRange) H_AUTO_OGL(IVertexArrayRange_IVertexArrayRange)
_Driver= drv; _Driver= drv;
@ -59,7 +59,7 @@ IVertexArrayRange::~IVertexArrayRange()
} }
// *************************************************************************** // ***************************************************************************
IVertexBufferHardGL::IVertexBufferHardGL(CDriverGL *drv, CVertexBuffer *vb) : VB (vb) IVertexBufferHardGL::IVertexBufferHardGL(CDriverGL3 *drv, CVertexBuffer *vb) : VB (vb)
{ {
H_AUTO_OGL(IVertexBufferHardGL_IVertexBufferHardGL) H_AUTO_OGL(IVertexBufferHardGL_IVertexBufferHardGL)
_Driver= drv; _Driver= drv;
@ -93,7 +93,7 @@ IVertexBufferHardGL::~IVertexBufferHardGL()
// *************************************************************************** // ***************************************************************************
CVertexArrayRangeNVidia::CVertexArrayRangeNVidia(CDriverGL *drv) : IVertexArrayRange(drv) CVertexArrayRangeNVidia::CVertexArrayRangeNVidia(CDriverGL3 *drv) : IVertexArrayRange(drv)
{ {
H_AUTO_OGL(CVertexArrayRangeNVidia_CVertexArrayRangeNVidia) H_AUTO_OGL(CVertexArrayRangeNVidia_CVertexArrayRangeNVidia)
_VertexArrayPtr= NULL; _VertexArrayPtr= NULL;
@ -280,7 +280,7 @@ IVertexBufferHardGL *CVertexArrayRangeNVidia::createVBHardGL(uint size, CVertex
// *************************************************************************** // ***************************************************************************
CVertexBufferHardGLNVidia::CVertexBufferHardGLNVidia(CDriverGL *drv, CVertexBuffer *vb) : IVertexBufferHardGL(drv, vb) CVertexBufferHardGLNVidia::CVertexBufferHardGLNVidia(CDriverGL3 *drv, CVertexBuffer *vb) : IVertexBufferHardGL(drv, vb)
{ {
H_AUTO_OGL(CVertexBufferHardGLNVidia_CVertexBufferHardGLNVidia) H_AUTO_OGL(CVertexBufferHardGLNVidia_CVertexBufferHardGLNVidia)
_VertexArrayRange= NULL; _VertexArrayRange= NULL;
@ -483,7 +483,7 @@ void CVertexBufferHardGLNVidia::testFence()
// *************************************************************************** // ***************************************************************************
CVertexArrayRangeATI::CVertexArrayRangeATI(CDriverGL *drv) : IVertexArrayRange(drv) CVertexArrayRangeATI::CVertexArrayRangeATI(CDriverGL3 *drv) : IVertexArrayRange(drv)
{ {
H_AUTO_OGL(CVertexArrayRangeATI_CVertexArrayRangeATI) H_AUTO_OGL(CVertexArrayRangeATI_CVertexArrayRangeATI)
_Allocated= false; _Allocated= false;
@ -629,7 +629,7 @@ void CVertexArrayRangeATI::freeVB(void *ptr)
// *************************************************************************** // ***************************************************************************
CVertexBufferHardGLATI::CVertexBufferHardGLATI(CDriverGL *drv, CVertexBuffer *vb) : IVertexBufferHardGL(drv, vb) CVertexBufferHardGLATI::CVertexBufferHardGLATI(CDriverGL3 *drv, CVertexBuffer *vb) : IVertexBufferHardGL(drv, vb)
{ {
H_AUTO_OGL(CVertexBufferHardGLATI_CVertexBufferHardGLATI) H_AUTO_OGL(CVertexBufferHardGLATI_CVertexBufferHardGLATI)
_VertexArrayRange= NULL; _VertexArrayRange= NULL;
@ -808,7 +808,7 @@ void CVertexBufferHardGLATI::setupVBInfos(CVertexBufferInfo &vb)
// *************************************************************************** // ***************************************************************************
CVertexArrayRangeMapObjectATI::CVertexArrayRangeMapObjectATI(CDriverGL *drv) : IVertexArrayRange(drv), CVertexArrayRangeMapObjectATI::CVertexArrayRangeMapObjectATI(CDriverGL3 *drv) : IVertexArrayRange(drv),
_VBType(CVertexBuffer::AGPPreferred), _VBType(CVertexBuffer::AGPPreferred),
_SizeAllocated(0) _SizeAllocated(0)
{ {
@ -910,7 +910,7 @@ void CVertexArrayRangeMapObjectATI::disable()
// *************************************************************************** // ***************************************************************************
// *************************************************************************** // ***************************************************************************
CVertexBufferHardGLMapObjectATI::CVertexBufferHardGLMapObjectATI(CDriverGL *drv, CVertexBuffer *vb) : IVertexBufferHardGL(drv, vb), CVertexBufferHardGLMapObjectATI::CVertexBufferHardGLMapObjectATI(CDriverGL3 *drv, CVertexBuffer *vb) : IVertexBufferHardGL(drv, vb),
_VertexPtr(NULL), _VertexPtr(NULL),
_VertexArrayRange(NULL), _VertexArrayRange(NULL),
_VertexObjectId(0) _VertexObjectId(0)
@ -1153,7 +1153,7 @@ void CVertexArrayRangeMapObjectATI::updateLostBuffers()
// *************************************************************************** // ***************************************************************************
CVertexArrayRangeARB::CVertexArrayRangeARB(CDriverGL *drv) : IVertexArrayRange(drv), CVertexArrayRangeARB::CVertexArrayRangeARB(CDriverGL3 *drv) : IVertexArrayRange(drv),
_VBType(CVertexBuffer::AGPPreferred), _VBType(CVertexBuffer::AGPPreferred),
_SizeAllocated(0) _SizeAllocated(0)
{ {
@ -1318,7 +1318,7 @@ void CVertexArrayRangeARB::updateLostBuffers()
// *************************************************************************** // ***************************************************************************
CVertexBufferHardARB::CVertexBufferHardARB(CDriverGL *drv, CVertexBuffer *vb) : IVertexBufferHardGL(drv, vb), CVertexBufferHardARB::CVertexBufferHardARB(CDriverGL3 *drv, CVertexBuffer *vb) : IVertexBufferHardGL(drv, vb),
_VertexPtr(NULL), _VertexPtr(NULL),
_VertexObjectId(0) _VertexObjectId(0)

@ -26,7 +26,7 @@ namespace NL3D {
#ifdef USE_OPENGLES #ifdef USE_OPENGLES
namespace NLDRIVERGLES { namespace NLDRIVERGLES {
#else #else
namespace NLDRIVERGL { namespace NLDRIVERGL3 {
#endif #endif
#endif #endif
@ -51,7 +51,7 @@ class CVertexBufferHardARB;
class IVertexArrayRange class IVertexArrayRange
{ {
public: public:
IVertexArrayRange(CDriverGL *drv); IVertexArrayRange(CDriverGL3 *drv);
virtual ~IVertexArrayRange(); virtual ~IVertexArrayRange();
/// allocate a vertex array space. false if error. client must free before re-allocate. /// allocate a vertex array space. false if error. client must free before re-allocate.
@ -65,13 +65,13 @@ public:
// Check & invalidate lost buffers. Default assume they can't be lost // Check & invalidate lost buffers. Default assume they can't be lost
virtual void updateLostBuffers() {} virtual void updateLostBuffers() {}
// Get driver // Get driver
CDriverGL *getDriver() const { return _Driver; } CDriverGL3* getDriver() const { return _Driver; }
// tmp, for debug // tmp, for debug
#ifdef NL_DEBUG #ifdef NL_DEBUG
virtual void dumpMappedBuffers() {} virtual void dumpMappedBuffers() {}
#endif #endif
protected: protected:
CDriverGL *_Driver; CDriverGL3 *_Driver;
}; };
@ -84,7 +84,7 @@ class IVertexBufferHardGL
{ {
public: public:
IVertexBufferHardGL(CDriverGL *drv, CVertexBuffer *vb); IVertexBufferHardGL(CDriverGL3 *drv, CVertexBuffer *vb);
virtual ~IVertexBufferHardGL(); virtual ~IVertexBufferHardGL();
@ -113,7 +113,7 @@ public:
CVertexBuffer *VB; CVertexBuffer *VB;
protected: protected:
CDriverGL *_Driver; CDriverGL3 *_Driver;
bool _Invalid; bool _Invalid;
}; };
@ -133,7 +133,7 @@ protected:
class CVertexArrayRangeNVidia : public IVertexArrayRange class CVertexArrayRangeNVidia : public IVertexArrayRange
{ {
public: public:
CVertexArrayRangeNVidia(CDriverGL *drv); CVertexArrayRangeNVidia(CDriverGL3 *drv);
/// \name Implementation /// \name Implementation
@ -182,7 +182,7 @@ class CVertexBufferHardGLNVidia : public IVertexBufferHardGL
{ {
public: public:
CVertexBufferHardGLNVidia(CDriverGL *drv, CVertexBuffer *vb); CVertexBufferHardGLNVidia(CDriverGL3 *drv, CVertexBuffer *vb);
virtual ~CVertexBufferHardGLNVidia(); virtual ~CVertexBufferHardGLNVidia();
@ -250,7 +250,7 @@ private:
class CVertexArrayRangeATI : public IVertexArrayRange class CVertexArrayRangeATI : public IVertexArrayRange
{ {
public: public:
CVertexArrayRangeATI(CDriverGL *drv); CVertexArrayRangeATI(CDriverGL3 *drv);
/// \name Implementation /// \name Implementation
@ -306,7 +306,7 @@ class CVertexBufferHardGLATI : public IVertexBufferHardGL
{ {
public: public:
CVertexBufferHardGLATI(CDriverGL *drv, CVertexBuffer *vb); CVertexBufferHardGLATI(CDriverGL3 *drv, CVertexBuffer *vb);
virtual ~CVertexBufferHardGLATI(); virtual ~CVertexBufferHardGLATI();
@ -357,7 +357,7 @@ private:
class CVertexArrayRangeMapObjectATI : public IVertexArrayRange class CVertexArrayRangeMapObjectATI : public IVertexArrayRange
{ {
public: public:
CVertexArrayRangeMapObjectATI(CDriverGL *drv); CVertexArrayRangeMapObjectATI(CDriverGL3 *drv);
/// \name Implementation /// \name Implementation
@ -414,7 +414,7 @@ class CVertexBufferHardGLMapObjectATI : public IVertexBufferHardGL
{ {
public: public:
CVertexBufferHardGLMapObjectATI(CDriverGL *drv, CVertexBuffer *vb); CVertexBufferHardGLMapObjectATI(CDriverGL3 *drv, CVertexBuffer *vb);
virtual ~CVertexBufferHardGLMapObjectATI(); virtual ~CVertexBufferHardGLMapObjectATI();
@ -470,7 +470,7 @@ public:
class CVertexArrayRangeARB : public IVertexArrayRange class CVertexArrayRangeARB : public IVertexArrayRange
{ {
public: public:
CVertexArrayRangeARB(CDriverGL *drv); CVertexArrayRangeARB(CDriverGL3 *drv);
/// \name Implementation /// \name Implementation
@ -522,7 +522,7 @@ class CVertexBufferHardARB : public IVertexBufferHardGL
{ {
public: public:
CVertexBufferHardARB(CDriverGL *drv, CVertexBuffer *vb); CVertexBufferHardARB(CDriverGL3 *drv, CVertexBuffer *vb);
virtual ~CVertexBufferHardARB(); virtual ~CVertexBufferHardARB();

@ -36,12 +36,12 @@ namespace NL3D {
#ifdef USE_OPENGLES #ifdef USE_OPENGLES
namespace NLDRIVERGLES { namespace NLDRIVERGLES {
#else #else
namespace NLDRIVERGL { namespace NLDRIVERGL3 {
#endif #endif
#endif #endif
// *************************************************************************** // ***************************************************************************
CVertexProgamDrvInfosGL::CVertexProgamDrvInfosGL (CDriverGL *drv, ItVtxPrgDrvInfoPtrList it) : IVertexProgramDrvInfos (drv, it) CVertexProgamDrvInfosGL3::CVertexProgamDrvInfosGL3 (CDriverGL3 *drv, ItVtxPrgDrvInfoPtrList it) : IVertexProgramDrvInfos (drv, it)
{ {
H_AUTO_OGL(CVertexProgamDrvInfosGL_CVertexProgamDrvInfosGL); H_AUTO_OGL(CVertexProgamDrvInfosGL_CVertexProgamDrvInfosGL);
@ -70,14 +70,14 @@ CVertexProgamDrvInfosGL::CVertexProgamDrvInfosGL (CDriverGL *drv, ItVtxPrgDrvInf
// *************************************************************************** // ***************************************************************************
bool CDriverGL::isVertexProgramSupported () const bool CDriverGL3::isVertexProgramSupported () const
{ {
H_AUTO_OGL(CVertexProgamDrvInfosGL_isVertexProgramSupported) H_AUTO_OGL(CVertexProgamDrvInfosGL_isVertexProgramSupported)
return _Extensions.NVVertexProgram || _Extensions.EXTVertexShader || _Extensions.ARBVertexProgram; return _Extensions.NVVertexProgram || _Extensions.EXTVertexShader || _Extensions.ARBVertexProgram;
} }
// *************************************************************************** // ***************************************************************************
bool CDriverGL::isVertexProgramEmulated () const bool CDriverGL3::isVertexProgramEmulated () const
{ {
H_AUTO_OGL(CVertexProgamDrvInfosGL_isVertexProgramEmulated) H_AUTO_OGL(CVertexProgamDrvInfosGL_isVertexProgramEmulated)
return _Extensions.NVVertexProgramEmulated; return _Extensions.NVVertexProgramEmulated;
@ -86,7 +86,7 @@ bool CDriverGL::isVertexProgramEmulated () const
// *************************************************************************** // ***************************************************************************
bool CDriverGL::activeNVVertexProgram (CVertexProgram *program) bool CDriverGL3::activeNVVertexProgram (CVertexProgram *program)
{ {
H_AUTO_OGL(CVertexProgamDrvInfosGL_activeNVVertexProgram); H_AUTO_OGL(CVertexProgamDrvInfosGL_activeNVVertexProgram);
@ -100,7 +100,7 @@ bool CDriverGL::activeNVVertexProgram (CVertexProgram *program)
// Driver info // Driver info
CVertexProgamDrvInfosGL *drvInfo; CVertexProgamDrvInfosGL3 *drvInfo;
// Program setuped ? // Program setuped ?
if (program->_DrvInfo==NULL) if (program->_DrvInfo==NULL)
@ -126,7 +126,7 @@ bool CDriverGL::activeNVVertexProgram (CVertexProgram *program)
ItVtxPrgDrvInfoPtrList it= _VtxPrgDrvInfos.insert(_VtxPrgDrvInfos.end(), (NL3D::IVertexProgramDrvInfos*)NULL); ItVtxPrgDrvInfoPtrList it= _VtxPrgDrvInfos.insert(_VtxPrgDrvInfos.end(), (NL3D::IVertexProgramDrvInfos*)NULL);
// Create a driver info // Create a driver info
*it = drvInfo = new CVertexProgamDrvInfosGL (this, it); *it = drvInfo = new CVertexProgamDrvInfosGL3 (this, it);
// Set the pointer // Set the pointer
program->_DrvInfo=drvInfo; program->_DrvInfo=drvInfo;
@ -182,7 +182,7 @@ bool CDriverGL::activeNVVertexProgram (CVertexProgram *program)
else else
{ {
// Cast the driver info pointer // Cast the driver info pointer
drvInfo=safe_cast<CVertexProgamDrvInfosGL*>((IVertexProgramDrvInfos*)program->_DrvInfo); drvInfo=safe_cast<CVertexProgamDrvInfosGL3*>((IVertexProgramDrvInfos*)program->_DrvInfo);
} }
// Setup this program // Setup this program
@ -402,9 +402,9 @@ static void doWriteMask(GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum
// *************************************************************************** // ***************************************************************************
/** Setup a vertex shader from its parsed program /** Setup a vertex shader from its parsed program
*/ */
bool CDriverGL::setupEXTVertexShader(const CVPParser::TProgram &program, GLuint id, uint variants[EVSNumVariants], uint16 &usedInputRegisters) bool CDriverGL3::setupEXTVertexShader(const CVPParser::TProgram &program, GLuint id, uint variants[EVSNumVariants], uint16 &usedInputRegisters)
{ {
H_AUTO_OGL(CDriverGL_setupEXTVertexShader); H_AUTO_OGL(CDriverGL3_setupEXTVertexShader);
#ifndef USE_OPENGLES #ifndef USE_OPENGLES
// counter to see what is generated // counter to see what is generated
@ -1342,9 +1342,9 @@ static void ARBVertexProgramDumpInstr(const CVPInstruction &instr, std::string &
} }
// *************************************************************************** // ***************************************************************************
bool CDriverGL::setupARBVertexProgram (const CVPParser::TProgram &inParsedProgram, GLuint id, bool &specularWritten) bool CDriverGL3::setupARBVertexProgram (const CVPParser::TProgram &inParsedProgram, GLuint id, bool &specularWritten)
{ {
H_AUTO_OGL(CDriverGL_setupARBVertexProgram); H_AUTO_OGL(CDriverGL3_setupARBVertexProgram);
#ifndef USE_OPENGLES #ifndef USE_OPENGLES
// tmp // tmp
@ -1489,16 +1489,16 @@ bool CDriverGL::setupARBVertexProgram (const CVPParser::TProgram &inParsedProgra
// *************************************************************************** // ***************************************************************************
bool CDriverGL::activeARBVertexProgram (CVertexProgram *program) bool CDriverGL3::activeARBVertexProgram (CVertexProgram *program)
{ {
H_AUTO_OGL(CDriverGL_activeARBVertexProgram); H_AUTO_OGL(CDriverGL3_activeARBVertexProgram);
#ifndef USE_OPENGLES #ifndef USE_OPENGLES
// Setup or unsetup ? // Setup or unsetup ?
if (program) if (program)
{ {
// Driver info // Driver info
CVertexProgamDrvInfosGL *drvInfo; CVertexProgamDrvInfosGL3 *drvInfo;
// Program setuped ? // Program setuped ?
if (program->_DrvInfo==NULL) if (program->_DrvInfo==NULL)
@ -1520,7 +1520,7 @@ bool CDriverGL::activeARBVertexProgram (CVertexProgram *program)
ItVtxPrgDrvInfoPtrList it= _VtxPrgDrvInfos.insert(_VtxPrgDrvInfos.end(), (NL3D::IVertexProgramDrvInfos*)NULL); ItVtxPrgDrvInfoPtrList it= _VtxPrgDrvInfos.insert(_VtxPrgDrvInfos.end(), (NL3D::IVertexProgramDrvInfos*)NULL);
// Create a driver info // Create a driver info
*it = drvInfo = new CVertexProgamDrvInfosGL (this, it); *it = drvInfo = new CVertexProgamDrvInfosGL3 (this, it);
// Set the pointer // Set the pointer
program->_DrvInfo=drvInfo; program->_DrvInfo=drvInfo;
@ -1535,7 +1535,7 @@ bool CDriverGL::activeARBVertexProgram (CVertexProgram *program)
else else
{ {
// Cast the driver info pointer // Cast the driver info pointer
drvInfo=safe_cast<CVertexProgamDrvInfosGL*>((IVertexProgramDrvInfos*)program->_DrvInfo); drvInfo=safe_cast<CVertexProgamDrvInfosGL3*>((IVertexProgramDrvInfos*)program->_DrvInfo);
} }
glEnable( GL_VERTEX_PROGRAM_ARB ); glEnable( GL_VERTEX_PROGRAM_ARB );
_VertexProgramEnabled = true; _VertexProgramEnabled = true;
@ -1563,16 +1563,16 @@ bool CDriverGL::activeARBVertexProgram (CVertexProgram *program)
} }
// *************************************************************************** // ***************************************************************************
bool CDriverGL::activeEXTVertexShader (CVertexProgram *program) bool CDriverGL3::activeEXTVertexShader (CVertexProgram *program)
{ {
H_AUTO_OGL(CDriverGL_activeEXTVertexShader); H_AUTO_OGL(CDriverGL3_activeEXTVertexShader);
#ifndef USE_OPENGLES #ifndef USE_OPENGLES
// Setup or unsetup ? // Setup or unsetup ?
if (program) if (program)
{ {
// Driver info // Driver info
CVertexProgamDrvInfosGL *drvInfo; CVertexProgamDrvInfosGL3 *drvInfo;
// Program setuped ? // Program setuped ?
if (program->_DrvInfo==NULL) if (program->_DrvInfo==NULL)
@ -1606,7 +1606,7 @@ bool CDriverGL::activeEXTVertexShader (CVertexProgram *program)
ItVtxPrgDrvInfoPtrList it= _VtxPrgDrvInfos.insert(_VtxPrgDrvInfos.end(), (NL3D::IVertexProgramDrvInfos*)NULL); ItVtxPrgDrvInfoPtrList it= _VtxPrgDrvInfos.insert(_VtxPrgDrvInfos.end(), (NL3D::IVertexProgramDrvInfos*)NULL);
// Create a driver info // Create a driver info
*it = drvInfo = new CVertexProgamDrvInfosGL (this, it); *it = drvInfo = new CVertexProgamDrvInfosGL3 (this, it);
// Set the pointer // Set the pointer
program->_DrvInfo=drvInfo; program->_DrvInfo=drvInfo;
@ -1621,7 +1621,7 @@ bool CDriverGL::activeEXTVertexShader (CVertexProgram *program)
else else
{ {
// Cast the driver info pointer // Cast the driver info pointer
drvInfo=safe_cast<CVertexProgamDrvInfosGL*>((IVertexProgramDrvInfos*)program->_DrvInfo); drvInfo=safe_cast<CVertexProgamDrvInfosGL3*>((IVertexProgramDrvInfos*)program->_DrvInfo);
} }
glEnable( GL_VERTEX_SHADER_EXT); glEnable( GL_VERTEX_SHADER_EXT);
@ -1641,9 +1641,9 @@ bool CDriverGL::activeEXTVertexShader (CVertexProgram *program)
} }
// *************************************************************************** // ***************************************************************************
bool CDriverGL::activeVertexProgram (CVertexProgram *program) bool CDriverGL3::activeVertexProgram (CVertexProgram *program)
{ {
H_AUTO_OGL(CDriverGL_activeVertexProgram) H_AUTO_OGL(CDriverGL3_activeVertexProgram)
// Extension here ? // Extension here ?
if (_Extensions.NVVertexProgram) if (_Extensions.NVVertexProgram)
{ {
@ -1665,9 +1665,9 @@ bool CDriverGL::activeVertexProgram (CVertexProgram *program)
// *************************************************************************** // ***************************************************************************
void CDriverGL::setConstant (uint index, float f0, float f1, float f2, float f3) void CDriverGL3::setConstant (uint index, float f0, float f1, float f2, float f3)
{ {
H_AUTO_OGL(CDriverGL_setConstant); H_AUTO_OGL(CDriverGL3_setConstant);
#ifndef USE_OPENGLES #ifndef USE_OPENGLES
// Vertex program exist ? // Vertex program exist ?
@ -1691,9 +1691,9 @@ void CDriverGL::setConstant (uint index, float f0, float f1, float f2, float f3)
// *************************************************************************** // ***************************************************************************
void CDriverGL::setConstant (uint index, double d0, double d1, double d2, double d3) void CDriverGL3::setConstant (uint index, double d0, double d1, double d2, double d3)
{ {
H_AUTO_OGL(CDriverGL_setConstant); H_AUTO_OGL(CDriverGL3_setConstant);
#ifndef USE_OPENGLES #ifndef USE_OPENGLES
// Vertex program exist ? // Vertex program exist ?
@ -1717,9 +1717,9 @@ void CDriverGL::setConstant (uint index, double d0, double d1, double d2, double
// *************************************************************************** // ***************************************************************************
void CDriverGL::setConstant (uint index, const NLMISC::CVector& value) void CDriverGL3::setConstant (uint index, const NLMISC::CVector& value)
{ {
H_AUTO_OGL(CDriverGL_setConstant); H_AUTO_OGL(CDriverGL3_setConstant);
#ifndef USE_OPENGLES #ifndef USE_OPENGLES
// Vertex program exist ? // Vertex program exist ?
@ -1743,9 +1743,9 @@ void CDriverGL::setConstant (uint index, const NLMISC::CVector& value)
// *************************************************************************** // ***************************************************************************
void CDriverGL::setConstant (uint index, const NLMISC::CVectorD& value) void CDriverGL3::setConstant (uint index, const NLMISC::CVectorD& value)
{ {
H_AUTO_OGL(CDriverGL_setConstant); H_AUTO_OGL(CDriverGL3_setConstant);
#ifndef USE_OPENGLES #ifndef USE_OPENGLES
// Vertex program exist ? // Vertex program exist ?
@ -1768,9 +1768,9 @@ void CDriverGL::setConstant (uint index, const NLMISC::CVectorD& value)
// *************************************************************************** // ***************************************************************************
void CDriverGL::setConstant (uint index, uint num, const float *src) void CDriverGL3::setConstant (uint index, uint num, const float *src)
{ {
H_AUTO_OGL(CDriverGL_setConstant); H_AUTO_OGL(CDriverGL3_setConstant);
#ifndef USE_OPENGLES #ifndef USE_OPENGLES
// Vertex program exist ? // Vertex program exist ?
@ -1796,9 +1796,9 @@ void CDriverGL::setConstant (uint index, uint num, const float *src)
} }
// *************************************************************************** // ***************************************************************************
void CDriverGL::setConstant (uint index, uint num, const double *src) void CDriverGL3::setConstant (uint index, uint num, const double *src)
{ {
H_AUTO_OGL(CDriverGL_setConstant); H_AUTO_OGL(CDriverGL3_setConstant);
#ifndef USE_OPENGLES #ifndef USE_OPENGLES
// Vertex program exist ? // Vertex program exist ?
@ -1825,7 +1825,7 @@ void CDriverGL::setConstant (uint index, uint num, const double *src)
// *************************************************************************** // ***************************************************************************
const uint CDriverGL::GLMatrix[IDriver::NumMatrix]= const uint CDriverGL3::GLMatrix[IDriver::NumMatrix]=
{ {
GL_MODELVIEW, GL_MODELVIEW,
GL_PROJECTION, GL_PROJECTION,
@ -1839,7 +1839,7 @@ const uint CDriverGL::GLMatrix[IDriver::NumMatrix]=
// *************************************************************************** // ***************************************************************************
const uint CDriverGL::GLTransform[IDriver::NumTransform]= const uint CDriverGL3::GLTransform[IDriver::NumTransform]=
{ {
#ifdef USE_OPENGLES #ifdef USE_OPENGLES
0, 0,
@ -1857,9 +1857,9 @@ const uint CDriverGL::GLTransform[IDriver::NumTransform]=
// *************************************************************************** // ***************************************************************************
void CDriverGL::setConstantMatrix (uint index, IDriver::TMatrix matrix, IDriver::TTransform transform) void CDriverGL3::setConstantMatrix (uint index, IDriver::TMatrix matrix, IDriver::TTransform transform)
{ {
H_AUTO_OGL(CDriverGL_setConstantMatrix); H_AUTO_OGL(CDriverGL3_setConstantMatrix);
#ifndef USE_OPENGLES #ifndef USE_OPENGLES
// Vertex program exist ? // Vertex program exist ?
@ -1936,18 +1936,18 @@ void CDriverGL::setConstantMatrix (uint index, IDriver::TMatrix matrix, IDriver:
// *************************************************************************** // ***************************************************************************
void CDriverGL::setConstantFog (uint index) void CDriverGL3::setConstantFog (uint index)
{ {
H_AUTO_OGL(CDriverGL_setConstantFog) H_AUTO_OGL(CDriverGL3_setConstantFog)
const float *values = _ModelViewMatrix.get(); const float *values = _ModelViewMatrix.get();
setConstant (index, -values[2], -values[6], -values[10], -values[14]); setConstant (index, -values[2], -values[6], -values[10], -values[14]);
} }
// *************************************************************************** // ***************************************************************************
void CDriverGL::enableVertexProgramDoubleSidedColor(bool doubleSided) void CDriverGL3::enableVertexProgramDoubleSidedColor(bool doubleSided)
{ {
H_AUTO_OGL(CDriverGL_enableVertexProgramDoubleSidedColor); H_AUTO_OGL(CDriverGL3_enableVertexProgramDoubleSidedColor);
#ifndef USE_OPENGLES #ifndef USE_OPENGLES
// Vertex program exist ? // Vertex program exist ?
@ -1972,9 +1972,9 @@ void CDriverGL::enableVertexProgramDoubleSidedColor(bool doubleSided)
// *************************************************************************** // ***************************************************************************
bool CDriverGL::supportVertexProgramDoubleSidedColor() const bool CDriverGL3::supportVertexProgramDoubleSidedColor() const
{ {
H_AUTO_OGL(CDriverGL_supportVertexProgramDoubleSidedColor) H_AUTO_OGL(CDriverGL3_supportVertexProgramDoubleSidedColor)
// currently only supported by NV_VERTEX_PROGRAM && ARB_VERTEX_PROGRAM // currently only supported by NV_VERTEX_PROGRAM && ARB_VERTEX_PROGRAM
return _Extensions.NVVertexProgram || _Extensions.ARBVertexProgram; return _Extensions.NVVertexProgram || _Extensions.ARBVertexProgram;
} }

@ -52,13 +52,13 @@ namespace NL3D {
#ifdef USE_OPENGLES #ifdef USE_OPENGLES
namespace NLDRIVERGLES { namespace NLDRIVERGLES {
#else #else
namespace NLDRIVERGL { namespace NLDRIVERGL3 {
#endif #endif
#endif #endif
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
bool GlWndProc(CDriverGL *driver, HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) bool GlWndProc(CDriverGL3 *driver, HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{ {
H_AUTO_OGL(GlWndProc) H_AUTO_OGL(GlWndProc)
@ -116,7 +116,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l
H_AUTO_OGL(DriverGL_WndProc); H_AUTO_OGL(DriverGL_WndProc);
// Get the driver pointer.. // Get the driver pointer..
CDriverGL *pDriver=(CDriverGL*)GetWindowLongPtr (hWnd, GWLP_USERDATA); CDriverGL3 *pDriver=(CDriverGL3*)GetWindowLongPtr (hWnd, GWLP_USERDATA);
bool trapMessage = false; bool trapMessage = false;
if (pDriver != NULL) if (pDriver != NULL)
{ {
@ -174,7 +174,7 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l
#elif defined (NL_OS_MAC) #elif defined (NL_OS_MAC)
bool GlWndProc(CDriverGL *driver, const void* e) bool GlWndProc(CDriverGL3 *driver, const void* e)
{ {
H_AUTO_OGL(GlWndProc) H_AUTO_OGL(GlWndProc)
@ -204,7 +204,7 @@ sint nelXErrorsHandler(Display *dpy, XErrorEvent *e)
return 1; return 1;
} }
bool GlWndProc(CDriverGL *driver, XEvent &e) bool GlWndProc(CDriverGL3 *driver, XEvent &e)
{ {
H_AUTO_OGL(GlWndProc) H_AUTO_OGL(GlWndProc)
@ -296,9 +296,9 @@ bool GlWndProc(CDriverGL *driver, XEvent &e)
#endif // NL_OS_UNIX #endif // NL_OS_UNIX
// *************************************************************************** // ***************************************************************************
bool CDriverGL::init (uint windowIcon, emptyProc exitFunc) bool CDriverGL3::init (uint windowIcon, emptyProc exitFunc)
{ {
H_AUTO_OGL(CDriverGL_init) H_AUTO_OGL(CDriverGL3_init)
ExitFunc = exitFunc; ExitFunc = exitFunc;
@ -338,7 +338,7 @@ bool CDriverGL::init (uint windowIcon, emptyProc exitFunc)
} }
else else
{ {
nlwarning ("(CDriverGL::init): can't create DC"); nlwarning ("(CDriverGL3::init): can't create DC");
} }
// ati specific : try to retrieve driver version // ati specific : try to retrieve driver version
@ -437,9 +437,9 @@ bool CDriverGL::init (uint windowIcon, emptyProc exitFunc)
} }
// *************************************************************************** // ***************************************************************************
bool CDriverGL::unInit() bool CDriverGL3::unInit()
{ {
H_AUTO_OGL(CDriverGL_unInit) H_AUTO_OGL(CDriverGL3_unInit)
if (!_CurrentMode.Windowed) if (!_CurrentMode.Windowed)
{ {
@ -473,14 +473,14 @@ bool CDriverGL::unInit()
if (dc) if (dc)
{ {
if (!SetDeviceGammaRamp (dc, _GammaRampBackuped)) if (!SetDeviceGammaRamp (dc, _GammaRampBackuped))
nlwarning ("(CDriverGL::release): SetDeviceGammaRamp failed"); nlwarning ("(CDriverGL3::release): SetDeviceGammaRamp failed");
// Release the DC // Release the DC
ReleaseDC (NULL, dc); ReleaseDC (NULL, dc);
} }
else else
{ {
nlwarning ("(CDriverGL::release): can't create DC"); nlwarning ("(CDriverGL3::release): can't create DC");
} }
} }
@ -501,7 +501,7 @@ bool CDriverGL::unInit()
return true; return true;
} }
void CDriverGL::setWindowIcon(const std::vector<NLMISC::CBitmap> &bitmaps) void CDriverGL3::setWindowIcon(const std::vector<NLMISC::CBitmap> &bitmaps)
{ {
if (_win == EmptyWindow) if (_win == EmptyWindow)
return; return;
@ -600,9 +600,9 @@ void CDriverGL::setWindowIcon(const std::vector<NLMISC::CBitmap> &bitmaps)
} }
// -------------------------------------------------- // --------------------------------------------------
bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool resizeable) throw(EBadDisplay) bool CDriverGL3::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool resizeable) throw(EBadDisplay)
{ {
H_AUTO_OGL(CDriverGL_setDisplay) H_AUTO_OGL(CDriverGL3_setDisplay)
_win = EmptyWindow; _win = EmptyWindow;
@ -665,13 +665,13 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
int pf=ChoosePixelFormat(tempHDC,&_pfd); int pf=ChoosePixelFormat(tempHDC,&_pfd);
if (!pf) if (!pf)
{ {
nlwarning ("CDriverGL::setDisplay: ChoosePixelFormat failed"); nlwarning ("CDriverGL3::setDisplay: ChoosePixelFormat failed");
DestroyWindow (tmpHWND); DestroyWindow (tmpHWND);
return false; return false;
} }
if ( !SetPixelFormat(tempHDC,pf,&_pfd) ) if ( !SetPixelFormat(tempHDC,pf,&_pfd) )
{ {
nlwarning ("CDriverGL::setDisplay: SetPixelFormat failed"); nlwarning ("CDriverGL3::setDisplay: SetPixelFormat failed");
DestroyWindow (tmpHWND); DestroyWindow (tmpHWND);
return false; return false;
} }
@ -681,7 +681,7 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
if (tempGLRC == NULL) if (tempGLRC == NULL)
{ {
DWORD error = GetLastError (); DWORD error = GetLastError ();
nlwarning ("CDriverGL::setDisplay: wglCreateContext failed: 0x%x", error); nlwarning ("CDriverGL3::setDisplay: wglCreateContext failed: 0x%x", error);
DestroyWindow (tmpHWND); DestroyWindow (tmpHWND);
_PBuffer = NULL; _PBuffer = NULL;
_win = EmptyWindow; _win = EmptyWindow;
@ -694,7 +694,7 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
if (!wglMakeCurrent(tempHDC,tempGLRC)) if (!wglMakeCurrent(tempHDC,tempGLRC))
{ {
DWORD error = GetLastError (); DWORD error = GetLastError ();
nlwarning ("CDriverGL::setDisplay: wglMakeCurrent failed: 0x%x", error); nlwarning ("CDriverGL3::setDisplay: wglMakeCurrent failed: 0x%x", error);
wglDeleteContext (tempGLRC); wglDeleteContext (tempGLRC);
DestroyWindow (tmpHWND); DestroyWindow (tmpHWND);
_PBuffer = NULL; _PBuffer = NULL;
@ -716,7 +716,7 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
if (hdc == NULL) if (hdc == NULL)
{ {
DWORD error = GetLastError (); DWORD error = GetLastError ();
nlwarning ("CDriverGL::setDisplay: wglGetCurrentDC failed: 0x%x", error); nlwarning ("CDriverGL3::setDisplay: wglGetCurrentDC failed: 0x%x", error);
DestroyWindow (tmpHWND); DestroyWindow (tmpHWND);
_PBuffer = NULL; _PBuffer = NULL;
_win = EmptyWindow; _win = EmptyWindow;
@ -786,7 +786,7 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
if (_PBuffer == NULL) if (_PBuffer == NULL)
{ {
DWORD error = GetLastError (); DWORD error = GetLastError ();
nlwarning ("CDriverGL::setDisplay: wglCreatePbufferARB failed: 0x%x", error); nlwarning ("CDriverGL3::setDisplay: wglCreatePbufferARB failed: 0x%x", error);
wglDeleteContext (tempGLRC); wglDeleteContext (tempGLRC);
DestroyWindow (tmpHWND); DestroyWindow (tmpHWND);
@ -801,7 +801,7 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
if ( !nwglQueryPbufferARB( _PBuffer, WGL_PBUFFER_WIDTH_ARB, (int*)&width ) ) if ( !nwglQueryPbufferARB( _PBuffer, WGL_PBUFFER_WIDTH_ARB, (int*)&width ) )
{ {
DWORD error = GetLastError (); DWORD error = GetLastError ();
nlwarning ("CDriverGL::setDisplay: wglQueryPbufferARB failed: 0x%x", error); nlwarning ("CDriverGL3::setDisplay: wglQueryPbufferARB failed: 0x%x", error);
wglDeleteContext (tempGLRC); wglDeleteContext (tempGLRC);
DestroyWindow (tmpHWND); DestroyWindow (tmpHWND);
_PBuffer = NULL; _PBuffer = NULL;
@ -814,7 +814,7 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
if ( !nwglQueryPbufferARB( _PBuffer, WGL_PBUFFER_HEIGHT_ARB, (int*)&height ) ) if ( !nwglQueryPbufferARB( _PBuffer, WGL_PBUFFER_HEIGHT_ARB, (int*)&height ) )
{ {
DWORD error = GetLastError (); DWORD error = GetLastError ();
nlwarning ("CDriverGL::setDisplay: wglQueryPbufferARB failed: 0x%x", error); nlwarning ("CDriverGL3::setDisplay: wglQueryPbufferARB failed: 0x%x", error);
wglDeleteContext (tempGLRC); wglDeleteContext (tempGLRC);
DestroyWindow (tmpHWND); DestroyWindow (tmpHWND);
_PBuffer = NULL; _PBuffer = NULL;
@ -833,7 +833,7 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
if (_hDC == NULL) if (_hDC == NULL)
{ {
DWORD error = GetLastError (); DWORD error = GetLastError ();
nlwarning ("CDriverGL::setDisplay: wglGetPbufferDCARB failed: 0x%x", error); nlwarning ("CDriverGL3::setDisplay: wglGetPbufferDCARB failed: 0x%x", error);
nwglDestroyPbufferARB( _PBuffer ); nwglDestroyPbufferARB( _PBuffer );
wglDeleteContext (tempGLRC); wglDeleteContext (tempGLRC);
@ -852,7 +852,7 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
if (_hRC == NULL) if (_hRC == NULL)
{ {
DWORD error = GetLastError (); DWORD error = GetLastError ();
nlwarning ("CDriverGL::setDisplay: wglCreateContext failed: 0x%x", error); nlwarning ("CDriverGL3::setDisplay: wglCreateContext failed: 0x%x", error);
nwglReleasePbufferDCARB( _PBuffer, _hDC ); nwglReleasePbufferDCARB( _PBuffer, _hDC );
nwglDestroyPbufferARB( _PBuffer ); nwglDestroyPbufferARB( _PBuffer );
wglDeleteContext (tempGLRC); wglDeleteContext (tempGLRC);
@ -872,19 +872,19 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
if (!eglDestroyContext(_EglDisplay, _EglContext);) if (!eglDestroyContext(_EglDisplay, _EglContext);)
{ {
DWORD error = GetLastError (); DWORD error = GetLastError ();
nlwarning ("CDriverGL::setDisplay: wglDeleteContext failed: 0x%x", error); nlwarning ("CDriverGL3::setDisplay: wglDeleteContext failed: 0x%x", error);
} }
#else #else
if (!wglDeleteContext (tempGLRC)) if (!wglDeleteContext (tempGLRC))
{ {
DWORD error = GetLastError (); DWORD error = GetLastError ();
nlwarning ("CDriverGL::setDisplay: wglDeleteContext failed: 0x%x", error); nlwarning ("CDriverGL3::setDisplay: wglDeleteContext failed: 0x%x", error);
} }
#endif #endif
// Destroy the temp windows // Destroy the temp windows
if (!DestroyWindow (tmpHWND)) if (!DestroyWindow (tmpHWND))
nlwarning ("CDriverGL::setDisplay: DestroyWindow failed"); nlwarning ("CDriverGL3::setDisplay: DestroyWindow failed");
/* After a pbuffer has been successfully created you can use it for off-screen rendering. To do /* After a pbuffer has been successfully created you can use it for off-screen rendering. To do
so, you'll first need to bind the pbuffer, or more precisely, make its GL rendering context so, you'll first need to bind the pbuffer, or more precisely, make its GL rendering context
@ -892,7 +892,7 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
if (!wglMakeCurrent(_hDC,_hRC)) if (!wglMakeCurrent(_hDC,_hRC))
{ {
DWORD error = GetLastError (); DWORD error = GetLastError ();
nlwarning ("CDriverGL::setDisplay: wglMakeCurrent failed: 0x%x", error); nlwarning ("CDriverGL3::setDisplay: wglMakeCurrent failed: 0x%x", error);
#ifdef USE_OPENGLES #ifdef USE_OPENGLES
eglDestroyContext(_EglDisplay, _EglContext); eglDestroyContext(_EglDisplay, _EglContext);
@ -1135,9 +1135,9 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re
} }
// -------------------------------------------------- // --------------------------------------------------
bool CDriverGL::saveScreenMode() bool CDriverGL3::saveScreenMode()
{ {
H_AUTO_OGL(CDriverGL_saveScreenMode) H_AUTO_OGL(CDriverGL3_saveScreenMode)
bool res = true; bool res = true;
@ -1195,9 +1195,9 @@ bool CDriverGL::saveScreenMode()
} }
// -------------------------------------------------- // --------------------------------------------------
bool CDriverGL::restoreScreenMode() bool CDriverGL3::restoreScreenMode()
{ {
H_AUTO_OGL(CDriverGL_restoreScreenMode) H_AUTO_OGL(CDriverGL3_restoreScreenMode)
bool res = false; bool res = false;
@ -1287,9 +1287,9 @@ static sint modeInfoToFrequency(XF86VidModeModeInfo *info)
// *************************************************************************** // ***************************************************************************
bool CDriverGL::setScreenMode(const GfxMode &mode) bool CDriverGL3::setScreenMode(const GfxMode &mode)
{ {
H_AUTO_OGL(CDriverGL_setScreenMode) H_AUTO_OGL(CDriverGL3_setScreenMode)
if (mode.Windowed) if (mode.Windowed)
{ {
@ -1443,9 +1443,9 @@ bool CDriverGL::setScreenMode(const GfxMode &mode)
} }
// *************************************************************************** // ***************************************************************************
bool CDriverGL::createWindow(const GfxMode &mode) bool CDriverGL3::createWindow(const GfxMode &mode)
{ {
H_AUTO_OGL(CDriverGL_createWindow) H_AUTO_OGL(CDriverGL3_createWindow)
nlWindow window = EmptyWindow; nlWindow window = EmptyWindow;
@ -1597,9 +1597,9 @@ bool CDriverGL::createWindow(const GfxMode &mode)
// *************************************************************************** // ***************************************************************************
bool CDriverGL::destroyWindow() bool CDriverGL3::destroyWindow()
{ {
H_AUTO_OGL(CDriverGL_destroyWindow) H_AUTO_OGL(CDriverGL3_destroyWindow)
releaseCursors(); releaseCursors();
@ -1687,9 +1687,9 @@ bool CDriverGL::destroyWindow()
// *************************************************************************** // ***************************************************************************
CDriverGL::EWindowStyle CDriverGL::getWindowStyle() const CDriverGL3::EWindowStyle CDriverGL3::getWindowStyle() const
{ {
H_AUTO_OGL(CDriverGL_getWindowStyle) H_AUTO_OGL(CDriverGL3_getWindowStyle)
if (!_CurrentMode.Windowed) if (!_CurrentMode.Windowed)
return EWSFullscreen; return EWSFullscreen;
@ -1699,9 +1699,9 @@ CDriverGL::EWindowStyle CDriverGL::getWindowStyle() const
// *************************************************************************** // ***************************************************************************
bool CDriverGL::setWindowStyle(EWindowStyle windowStyle) bool CDriverGL3::setWindowStyle(EWindowStyle windowStyle)
{ {
H_AUTO_OGL(CDriverGL_setWindowStyle) H_AUTO_OGL(CDriverGL3_setWindowStyle)
// don't change window style, if we did not create the window // don't change window style, if we did not create the window
if (_win == EmptyWindow || !_DestroyWindow) if (_win == EmptyWindow || !_DestroyWindow)
@ -1856,9 +1856,9 @@ bool CDriverGL::setWindowStyle(EWindowStyle windowStyle)
} }
// -------------------------------------------------- // --------------------------------------------------
bool CDriverGL::setMode(const GfxMode& mode) bool CDriverGL3::setMode(const GfxMode& mode)
{ {
H_AUTO_OGL(CDriverGL_setMode); H_AUTO_OGL(CDriverGL3_setMode);
// don't modify window or screen if managed by a 3rd party library // don't modify window or screen if managed by a 3rd party library
if (!_DestroyWindow) if (!_DestroyWindow)
@ -1928,9 +1928,9 @@ long GetDictionaryLong(CFDictionaryRef theDict, const void* key)
#endif // defined(NL_OS_MAC) #endif // defined(NL_OS_MAC)
// -------------------------------------------------- // --------------------------------------------------
bool CDriverGL::getModes(std::vector<GfxMode> &modes) bool CDriverGL3::getModes(std::vector<GfxMode> &modes)
{ {
H_AUTO_OGL(CDriverGL_getModes) H_AUTO_OGL(CDriverGL3_getModes)
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
sint modeIndex = 0; sint modeIndex = 0;
@ -2109,9 +2109,9 @@ bool CDriverGL::getModes(std::vector<GfxMode> &modes)
} }
// -------------------------------------------------- // --------------------------------------------------
bool CDriverGL::getCurrentScreenMode(GfxMode &mode) bool CDriverGL3::getCurrentScreenMode(GfxMode &mode)
{ {
H_AUTO_OGL(CDriverGL_getCurrentScreenMode) H_AUTO_OGL(CDriverGL3_getCurrentScreenMode)
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
@ -2248,9 +2248,9 @@ bool CDriverGL::getCurrentScreenMode(GfxMode &mode)
} }
// -------------------------------------------------- // --------------------------------------------------
void CDriverGL::setWindowTitle(const ucstring &title) void CDriverGL3::setWindowTitle(const ucstring &title)
{ {
H_AUTO_OGL(CDriverGL_setWindowTitle) H_AUTO_OGL(CDriverGL3_setWindowTitle)
if (_win == EmptyWindow) if (_win == EmptyWindow)
return; return;
@ -2286,9 +2286,9 @@ void CDriverGL::setWindowTitle(const ucstring &title)
} }
// *************************************************************************** // ***************************************************************************
void CDriverGL::setWindowPos(sint32 x, sint32 y) void CDriverGL3::setWindowPos(sint32 x, sint32 y)
{ {
H_AUTO_OGL(CDriverGL_setWindowPos) H_AUTO_OGL(CDriverGL3_setWindowPos)
_WindowX = x; _WindowX = x;
_WindowY = y; _WindowY = y;
@ -2331,9 +2331,9 @@ void CDriverGL::setWindowPos(sint32 x, sint32 y)
} }
// *************************************************************************** // ***************************************************************************
void CDriverGL::showWindow(bool show) void CDriverGL3::showWindow(bool show)
{ {
H_AUTO_OGL(CDriverGL_showWindow) H_AUTO_OGL(CDriverGL3_showWindow)
// don't change window visibility, if we didn't create the window // don't change window visibility, if we didn't create the window
if (_win == EmptyWindow || !_DestroyWindow) if (_win == EmptyWindow || !_DestroyWindow)
@ -2367,15 +2367,15 @@ void CDriverGL::showWindow(bool show)
} }
// -------------------------------------------------- // --------------------------------------------------
emptyProc CDriverGL::getWindowProc() emptyProc CDriverGL3::getWindowProc()
{ {
H_AUTO_OGL(CDriverGL_getWindowProc) H_AUTO_OGL(CDriverGL3_getWindowProc)
return (emptyProc)GlWndProc; return (emptyProc)GlWndProc;
} }
// -------------------------------------------------- // --------------------------------------------------
bool CDriverGL::createContext() bool CDriverGL3::createContext()
{ {
#ifdef USE_OPENGLES #ifdef USE_OPENGLES
uint samples = 0; uint samples = 0;
@ -2519,9 +2519,9 @@ bool CDriverGL::createContext()
} }
// -------------------------------------------------- // --------------------------------------------------
bool CDriverGL::activate() bool CDriverGL3::activate()
{ {
H_AUTO_OGL(CDriverGL_activate); H_AUTO_OGL(CDriverGL3_activate);
if (_win == EmptyWindow) if (_win == EmptyWindow)
return false; return false;
@ -2564,9 +2564,9 @@ bool CDriverGL::activate()
} }
// -------------------------------------------------- // --------------------------------------------------
IDriver::TMessageBoxId CDriverGL::systemMessageBox (const char* message, const char* title, IDriver::TMessageBoxType type, TMessageBoxIcon icon) IDriver::TMessageBoxId CDriverGL3::systemMessageBox (const char* message, const char* title, IDriver::TMessageBoxType type, TMessageBoxIcon icon)
{ {
H_AUTO_OGL(CDriverGL_systemMessageBox) H_AUTO_OGL(CDriverGL3_systemMessageBox)
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
switch (::MessageBox (NULL, message, title, ((type==retryCancelType)?MB_RETRYCANCEL: switch (::MessageBox (NULL, message, title, ((type==retryCancelType)?MB_RETRYCANCEL:
(type==yesNoCancelType)?MB_YESNOCANCEL: (type==yesNoCancelType)?MB_YESNOCANCEL:
@ -2606,9 +2606,9 @@ IDriver::TMessageBoxId CDriverGL::systemMessageBox (const char* message, const c
return okId; return okId;
} }
void CDriverGL::getWindowSize(uint32 &width, uint32 &height) void CDriverGL3::getWindowSize(uint32 &width, uint32 &height)
{ {
H_AUTO_OGL(CDriverGL_getWindowSize) H_AUTO_OGL(CDriverGL3_getWindowSize)
if (_CurrentMode.OffScreen) if (_CurrentMode.OffScreen)
{ {
@ -2639,9 +2639,9 @@ void CDriverGL::getWindowSize(uint32 &width, uint32 &height)
} }
} }
void CDriverGL::setWindowSize(uint32 width, uint32 height) void CDriverGL3::setWindowSize(uint32 width, uint32 height)
{ {
H_AUTO_OGL(CDriverGL_setWindowSize) H_AUTO_OGL(CDriverGL3_setWindowSize)
if (_win == EmptyWindow) if (_win == EmptyWindow)
return; return;
@ -2740,9 +2740,9 @@ void CDriverGL::setWindowSize(uint32 width, uint32 height)
#endif // NL_OS_WINDOWS #endif // NL_OS_WINDOWS
} }
void CDriverGL::getWindowPos(sint32 &x, sint32 &y) void CDriverGL3::getWindowPos(sint32 &x, sint32 &y)
{ {
H_AUTO_OGL(CDriverGL_getWindowPos) H_AUTO_OGL(CDriverGL3_getWindowPos)
// Off-screen rendering ? // Off-screen rendering ?
if (_CurrentMode.OffScreen) if (_CurrentMode.OffScreen)
@ -2757,9 +2757,9 @@ void CDriverGL::getWindowPos(sint32 &x, sint32 &y)
} }
// -------------------------------------------------- // --------------------------------------------------
bool CDriverGL::isActive() bool CDriverGL3::isActive()
{ {
H_AUTO_OGL(CDriverGL_isActive) H_AUTO_OGL(CDriverGL3_isActive)
if (_win == EmptyWindow) if (_win == EmptyWindow)
return false; return false;
@ -2786,9 +2786,9 @@ bool CDriverGL::isActive()
} }
// *************************************************************************** // ***************************************************************************
bool CDriverGL::setMonitorColorProperties (const CMonitorColorProperties &properties) bool CDriverGL3::setMonitorColorProperties (const CMonitorColorProperties &properties)
{ {
H_AUTO_OGL(CDriverGL_setMonitorColorProperties ) H_AUTO_OGL(CDriverGL3_setMonitorColorProperties )
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
@ -2832,16 +2832,16 @@ bool CDriverGL::setMonitorColorProperties (const CMonitorColorProperties &proper
} }
else else
{ {
nlwarning ("(CDriverGL::setMonitorColorProperties): can't create DC"); nlwarning ("(CDriverGL3::setMonitorColorProperties): can't create DC");
} }
#elif defined(NL_OS_MAC) #elif defined(NL_OS_MAC)
// TODO for Mac: implement CDriverGL::setMonitorColorProperties // TODO for Mac: implement CDriverGL3::setMonitorColorProperties
nlwarning ("CDriverGL::setMonitorColorProperties not implemented"); nlwarning ("CDriverGL3::setMonitorColorProperties not implemented");
#elif defined (NL_OS_UNIX) #elif defined (NL_OS_UNIX)
// TODO for Linux: implement CDriverGL::setMonitorColorProperties // TODO for Linux: implement CDriverGL3::setMonitorColorProperties
nlwarning ("CDriverGL::setMonitorColorProperties not implemented"); nlwarning ("CDriverGL3::setMonitorColorProperties not implemented");
#endif #endif
@ -2849,7 +2849,7 @@ bool CDriverGL::setMonitorColorProperties (const CMonitorColorProperties &proper
} }
#ifdef NL_OS_MAC #ifdef NL_OS_MAC
void CDriverGL::setupApplicationMenu() void CDriverGL3::setupApplicationMenu()
{ {
NSMenu* menu; NSMenu* menu;
NSMenuItem* menuItem; NSMenuItem* menuItem;
@ -2908,19 +2908,19 @@ void CDriverGL::setupApplicationMenu()
} }
#endif #endif
bool CDriverGL::copyTextToClipboard(const ucstring &text) bool CDriverGL3::copyTextToClipboard(const ucstring &text)
{ {
return _EventEmitter.copyTextToClipboard(text); return _EventEmitter.copyTextToClipboard(text);
} }
bool CDriverGL::pasteTextFromClipboard(ucstring &text) bool CDriverGL3::pasteTextFromClipboard(ucstring &text)
{ {
return _EventEmitter.pasteTextFromClipboard(text); return _EventEmitter.pasteTextFromClipboard(text);
} }
#ifdef NL_OS_WINDOWS #ifdef NL_OS_WINDOWS
bool CDriverGL::convertBitmapToIcon(const NLMISC::CBitmap &bitmap, HICON &icon, uint iconWidth, uint iconHeight, uint iconDepth, const NLMISC::CRGBA &col, sint hotSpotX, sint hotSpotY, bool cursor) bool CDriverGL3::convertBitmapToIcon(const NLMISC::CBitmap &bitmap, HICON &icon, uint iconWidth, uint iconHeight, uint iconDepth, const NLMISC::CRGBA &col, sint hotSpotX, sint hotSpotY, bool cursor)
{ {
CBitmap src = bitmap; CBitmap src = bitmap;
@ -2999,7 +2999,7 @@ bool CDriverGL::convertBitmapToIcon(const NLMISC::CBitmap &bitmap, HICON &icon,
#elif defined(NL_OS_UNIX) #elif defined(NL_OS_UNIX)
bool CDriverGL::convertBitmapToIcon(const NLMISC::CBitmap &bitmap, std::vector<long> &icon) bool CDriverGL3::convertBitmapToIcon(const NLMISC::CBitmap &bitmap, std::vector<long> &icon)
{ {
// get bitmap width and height // get bitmap width and height
uint width = bitmap.getWidth(); uint width = bitmap.getWidth();

Loading…
Cancel
Save