Always use namespace for driver

--HG--
branch : opengl3
hg/feature/opengl3
kaetemi 10 years ago
parent 018417437e
commit 916683ed2a

@ -14,6 +14,8 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#if 0
#include "stdopengl.h"
#include "driver_glsl_shader_generator.h"
@ -613,4 +615,4 @@ namespace NL3D
}
}
#endif

@ -92,7 +92,7 @@ extern "C"
__declspec(dllexport) IDriver* NL3D_createIDriverInstance ()
{
return new CDriverGL3;
return new NLDRIVERGL3::CDriverGL3;
}
__declspec(dllexport) uint32 NL3D_interfaceVersion ()
@ -123,9 +123,7 @@ extern "C"
#endif // NL_STATIC
#ifdef NL_STATIC
namespace NLDRIVERGL3 {
#endif
CMaterial::CTexEnv CDriverGL3::_TexEnvReplace;
@ -1854,8 +1852,6 @@ void displayGLError(GLenum error)
}
}
#ifdef NL_STATIC
} // NLDRIVERGL3
#endif
} // NL3D

@ -83,10 +83,7 @@ using NLMISC::CMatrix;
using NLMISC::CVector;
namespace NL3D {
#ifdef NL_STATIC
namespace NLDRIVERGL3 {
#endif
class CDriverGL3;
class IVertexBufferGL3;
@ -384,7 +381,7 @@ public:
static inline void setupCausticsSecondTex(uint stage);*/
virtual bool setupMaterial(CMaterial& mat);
void generateShaderDesc(CShaderDesc &desc, CMaterial &mat);
// void generateShaderDesc(CShaderDesc &desc, CMaterial &mat);
bool setupBuiltinPrograms();
bool setupBuiltinVertexProgram();
bool setupBuiltinPixelProgram();
@ -1410,10 +1407,7 @@ private:
};
*/
#ifdef NL_STATIC
} // NLDRIVERGL3
#endif
} // NL3D
#endif // NL_DRIVER_OPENGL_H

@ -281,10 +281,7 @@ NEL_PFNGLXGETSWAPINTERVALMESAPROC nglXGetSwapIntervalMESA;
namespace NL3D {
#ifdef NL_STATIC
namespace NLDRIVERGL3 {
#endif
#define CHECK_EXT(ext_str) \
if (strstr(glext, ext_str)==NULL) { nlwarning("3D: OpengGL extension '%s' was not found", ext_str); return false; } else { nldebug("3D: OpengGL Extension '%s' found", ext_str); }
@ -790,8 +787,5 @@ bool registerGlXExtensions(CGlExtensions &ext, Display *dpy, sint screen)
}
#endif
#ifdef NL_STATIC
} // NLDRIVERGL3
#endif
} // NL3D

@ -24,10 +24,7 @@
#include "driver_opengl_extension_def.h"
namespace NL3D {
#ifdef NL_STATIC
namespace NLDRIVERGL3 {
#endif
// ***************************************************************************
/// The extensions used by NL3D.
@ -140,10 +137,7 @@ bool registerGlXExtensions(CGlExtensions &ext, Display *dpy, sint screen);
/// This function test and register the extensions for the current GL context.
bool registerGlExtensions(CGlExtensions &ext);
#ifdef NL_STATIC
} // NLDRIVERGL3
#endif
} // NL3D
// ***************************************************************************

@ -34,10 +34,7 @@ using namespace std;
using namespace NLMISC;
namespace NL3D {
#ifdef NL_STATIC
namespace NLDRIVERGL3 {
#endif
// *************************************************************************************
CDriverGL3::CCursor::CCursor() : ColorDepth(CDriverGL3::ColorDepth32),
@ -862,8 +859,5 @@ bool CDriverGL3::convertBitmapToCursor(const NLMISC::CBitmap &bitmap, nlCursor &
#endif
}
#ifdef NL_STATIC
} // NLDRIVERGL3
#endif
} // NL3D

@ -20,10 +20,7 @@
#include "nel/3d/light.h"
namespace NL3D {
#ifdef NL_STATIC
namespace NLDRIVERGL3 {
#endif
// ***************************************************************************
uint CDriverGL3::getMaxLight () const
@ -201,8 +198,5 @@ void CDriverGL3::setupLightMapDynamicLighting(bool enable)
}
}
#ifdef NL_STATIC
} // NLDRIVERGL3
#endif
} // NL3D

@ -23,10 +23,7 @@
#include "driver_opengl_vertex_buffer.h"
namespace NL3D {
#ifdef NL_STATIC
namespace NLDRIVERGL3 {
#endif
static void convBlend(CMaterial::TBlend blend, GLenum& glenum)
{
@ -1216,8 +1213,5 @@ void CDriverGL3::endWaterMultiPass()
nlassert(_CurrentMaterial->getShader() == CMaterial::Water);
}
#ifdef NL_STATIC
} // NLDRIVERGL3
#endif
} // NL3D

@ -18,10 +18,7 @@
#include "driver_opengl.h"
namespace NL3D {
#ifdef NL_STATIC
namespace NLDRIVERGL3 {
#endif
// ***************************************************************************
void CDriverGL3::setFrustum(float left, float right, float bottom, float top, float znear, float zfar, bool perspective)
@ -127,8 +124,5 @@ void CDriverGL3::setupModelMatrix(const CMatrix& mtx)
_ModelViewMatrix= _ViewMtx*mat;
}
#ifdef NL_STATIC
} // NLDRIVERGL3
#endif
} // NL3D

@ -28,10 +28,7 @@
#include "driver_opengl_vertex_buffer.h"
namespace NL3D {
#ifdef NL_STATIC
namespace NLDRIVERGL3 {
#endif
namespace /* anonymous */ {
@ -123,15 +120,12 @@ bool operator==(const CPPBuiltin &left, const CPPBuiltin &right)
return true;
}
#ifdef NL_STATIC
} // NLDRIVERGL3
#endif
} // NL3D
namespace std {
size_t hash<NL3D::CPPBuiltin>::operator()(const NL3D::CPPBuiltin & v) const
size_t hash<NL3D::NLDRIVERGL3::CPPBuiltin>::operator()(const NL3D::NLDRIVERGL3::CPPBuiltin & v) const
{
#if (HAVE_X86_64)
uint32 h32;
@ -141,8 +135,8 @@ size_t hash<NL3D::CPPBuiltin>::operator()(const NL3D::CPPBuiltin & v) const
h32 = NLMISC::wangHash((uint32)v.Shader);
h64 = NLMISC::wangHash64(((uint64)v.Flags) | ((uint64)v.TextureActive << 32));
h64 = NLMISC::wangHash64(h64 ^ (uint64)v.TexSamplerMode);
uint maxTex = NL3D::maxTextures(v.Shader);
if (NL3D::useTexEnv(v.Shader))
uint maxTex = NL3D::NLDRIVERGL3::maxTextures(v.Shader);
if (NL3D::NLDRIVERGL3::useTexEnv(v.Shader))
for (uint stage = 0; stage < maxTex; ++stage)
h32 = NLMISC::wangHash(h32 ^ (uint32)v.TexEnvMode[stage]);
@ -177,10 +171,7 @@ size_t hash<NL3D::CPPBuiltin>::operator()(const NL3D::CPPBuiltin & v) const
}
namespace NL3D {
#ifdef NL_STATIC
namespace NLDRIVERGL3 {
#endif
namespace /* anonymous */ {
@ -810,9 +801,6 @@ void CPPBuiltin::checkMaterialStateTouched(CMaterial &mat) // MUST NOT depend on
mat.clearTouched(0xFFFFFFFF);
}
#ifdef NL_STATIC
} // NLDRIVERGL3
#endif
} // NL3D

@ -20,10 +20,7 @@
#include "driver_opengl_vertex_buffer.h"
namespace NL3D {
#ifdef NL_STATIC
namespace NLDRIVERGL3 {
#endif
const uint16 g_VertexFlags[CVertexBuffer::NumValue] =
{
@ -573,6 +570,7 @@ void CDriverGL3::setUniformFog(TProgram program, uint index)
nglProgramUniform4f(id, index, -v[ 2 ], -v[ 6 ], -v[ 10 ], -v[ 4 ]);
}
/*
void CDriverGL3::generateShaderDesc(CShaderDesc &desc, CMaterial &mat)
{
desc.setShaderType(mat.getShader());
@ -626,7 +624,7 @@ void CDriverGL3::generateShaderDesc(CShaderDesc &desc, CMaterial &mat)
{
/*nldebug("stage fail %i, tex %s, tc0 %s, tci, %s", i, mat.getTexture(i) ? "VALID" : "NO",
desc.hasVBFlags(g_VertexFlags[TexCoord0]) ? "YES" : "NO",
desc.hasVBFlags(g_VertexFlags[TexCoord0 + i]) ? "YES" : "NO");*/
desc.hasVBFlags(g_VertexFlags[TexCoord0 + i]) ? "YES" : "NO");* /
}
}
@ -678,8 +676,8 @@ void CDriverGL3::generateShaderDesc(CShaderDesc &desc, CMaterial &mat)
}
desc.setLighting(/*enableLights && mat.isLighted() &&*/ m_VPBuiltinCurrent.Lighting);
}
desc.setLighting(/*enableLights && mat.isLighted() &&* / m_VPBuiltinCurrent.Lighting);
}*/
bool CDriverGL3::setupBuiltinPrograms()
{
@ -937,10 +935,7 @@ bool CDriverGL3::initProgramPipeline()
return true;
}
#ifdef NL_STATIC
} // NLDRIVERGL3
#endif
} // NL3D
/* end of file */

@ -20,10 +20,7 @@
#include "nel/misc/types_nl.h"
namespace NL3D {
#ifdef NL_STATIC
namespace NLDRIVERGL3 {
#endif
class CDriverGL3;
@ -119,24 +116,21 @@ inline bool hasFlag(uint32 data, uint32 flag)
} /* anonymous namespace */
#ifdef NL_STATIC
} // NLDRIVERGL3
#endif
} // NL3D
namespace std {
template <>
struct hash<NL3D::CVPBuiltin>
struct hash<NL3D::NLDRIVERGL3::CVPBuiltin>
{
size_t operator()(const NL3D::CVPBuiltin & v) const;
size_t operator()(const NL3D::NLDRIVERGL3::CVPBuiltin & v) const;
};
template <>
struct hash<NL3D::CPPBuiltin>
struct hash<NL3D::NLDRIVERGL3::CPPBuiltin>
{
size_t operator()(const NL3D::CPPBuiltin & v) const;
size_t operator()(const NL3D::NLDRIVERGL3::CPPBuiltin & v) const;
};
}

@ -21,10 +21,7 @@
#include "driver_opengl_vertex_buffer.h"
namespace NL3D {
#ifdef NL_STATIC
namespace NLDRIVERGL3 {
#endif
// ***************************************************************************
@ -393,9 +390,6 @@ bool CDriverGL3::renderRawQuads(CMaterial& mat, uint32 startIndex, uint32 numQua
return true;
}
#ifdef NL_STATIC
}
#endif
}

@ -14,6 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#if 0
#include "driver_opengl_shader_cache.h"
@ -60,3 +61,4 @@ namespace NL3D
}
}
#endif

@ -14,6 +14,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#if 0
#ifndef OPENGL_SHADER_CACHE
#define OPENGL_SHADER_CACHE
@ -48,3 +49,4 @@ namespace NL3D
#endif
#endif

@ -14,6 +14,8 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#if 0
#ifndef SHADER_DESC
#define SHADER_DESC
@ -286,3 +288,4 @@ namespace NL3D
#endif
#endif

@ -23,10 +23,7 @@
//#define NL3D_GLSTATE_DISABLE_CACHE
namespace NL3D {
#ifdef NL_STATIC
namespace NLDRIVERGL3 {
#endif
// ***************************************************************************
CDriverGLStates3::CDriverGLStates3()
@ -423,8 +420,5 @@ CDriverGLStates3::TCullMode CDriverGLStates3::getCullMode() const
return _CullMode;
}
#ifdef NL_STATIC
} // NLDRIVERGL3
#endif
} // NL3D

@ -21,10 +21,7 @@
#include "nel/3d/vertex_buffer.h"
namespace NL3D {
#ifdef NL_STATIC
namespace NLDRIVERGL3 {
#endif
// ***************************************************************************
/**
@ -170,10 +167,7 @@ private:
void updateDepthRange();
};
#ifdef NL_STATIC
} // NLDRIVERGL3
#endif
} // NL3D

@ -42,10 +42,7 @@ using namespace std;
#endif
namespace NL3D {
#ifdef NL_STATIC
namespace NLDRIVERGL3 {
#endif
// ***************************************************************************
CTextureDrvInfosGL3::CTextureDrvInfosGL3(IDriver *drv, ItTexDrvInfoPtrMap it, CDriverGL3 *drvGl, bool isRectangleTexture) : ITextureDrvInfos(drv, it)
@ -1686,8 +1683,5 @@ bool CDriverGL3::getRenderTargetSize (uint32 &width, uint32 &height)
// ***************************************************************************
#ifdef NL_STATIC
} // NLDRIVERGL3
#endif
} // NL3D

@ -47,10 +47,7 @@ using namespace NLMISC;
namespace NL3D {
#ifdef NL_STATIC
namespace NLDRIVERGL3 {
#endif
// ***************************************************************************
@ -541,8 +538,5 @@ void CIndexBufferInfo::setupIndexBuffer(CIndexBuffer &ib)
// ***************************************************************************
#ifdef NL_STATIC
} // NLDRIVERGL3
#endif
} // NL3D

@ -25,10 +25,7 @@ using namespace std;
using namespace NLMISC;
namespace NL3D {
#ifdef NL_STATIC
namespace NLDRIVERGL3 {
#endif
// ***************************************************************************
// ***************************************************************************
@ -510,9 +507,6 @@ void CVertexBufferAMDPinned::setupVBInfos(CVertexBufferInfo &vb)
// ***************************************************************************
// ***************************************************************************
#ifdef NL_STATIC
} // NLDRIVERGL3
#endif
} // NL3D

@ -20,10 +20,7 @@
#include "nel/misc/types_nl.h"
namespace NL3D {
#ifdef NL_STATIC
namespace NLDRIVERGL3 {
#endif
class CDriverGL3;
class IVertexBufferGL3;
@ -118,10 +115,7 @@ private:
uint m_VertexObjectId;
};
#ifdef NL_STATIC
} // NLDRIVERGL3
#endif
} // NL3D
#endif // NL_DRIVER_OPENGL_VERTEX_BUFFER_H

@ -28,10 +28,7 @@
#include "driver_opengl_vertex_buffer.h"
namespace NL3D {
#ifdef NL_STATIC
namespace NLDRIVERGL3 {
#endif
bool operator<(const CVPBuiltin &left, const CVPBuiltin &right)
{
@ -79,15 +76,12 @@ bool operator==(const CVPBuiltin &left, const CVPBuiltin &right)
return true;
}
#ifdef NL_STATIC
} // NLDRIVERGL3
#endif
} // NL3D
namespace std {
size_t hash<NL3D::CVPBuiltin>::operator()(const NL3D::CVPBuiltin & v) const
size_t hash<NL3D::NLDRIVERGL3::CVPBuiltin>::operator()(const NL3D::NLDRIVERGL3::CVPBuiltin & v) const
{
uint32 h;
@ -105,10 +99,7 @@ size_t hash<NL3D::CVPBuiltin>::operator()(const NL3D::CVPBuiltin & v) const
}
namespace NL3D {
#ifdef NL_STATIC
namespace NLDRIVERGL3 {
#endif
namespace NLDRIVERGL3 {
namespace /* anonymous */ {
@ -455,9 +446,6 @@ void CDriverGL3::setTexGenModeVP(uint stage, sint mode)
}
}
#ifdef NL_STATIC
} // NLDRIVERGL3
#endif
} // NL3D

@ -45,10 +45,7 @@ using namespace std;
using namespace NLMISC;
namespace NL3D {
#ifdef NL_STATIC
namespace NLDRIVERGL3 {
#endif
#ifdef NL_OS_WINDOWS
@ -2942,8 +2939,5 @@ bool CDriverGL3::convertBitmapToIcon(const NLMISC::CBitmap &bitmap, std::vector<
#endif
#ifdef NL_STATIC
} // NLDRIVERGL3
#endif
} // NL3D

Loading…
Cancel
Save