Rename the GLES2 namespace to gl2.
BUG=18110152
Change-Id: Ia1ec422b26b7f8d5edf856d3b625a0e9ebd5d31b
Reviewed-on: https://swiftshader-review.googlesource.com/1250
Reviewed-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
diff --git a/src/GLES2/common/debug.cpp b/src/GLES2/common/debug.cpp
index 7381129..82139a5 100644
--- a/src/GLES2/common/debug.cpp
+++ b/src/GLES2/common/debug.cpp
@@ -16,7 +16,7 @@
#include <stdio.h>
#include <stdarg.h>
-namespace gl
+namespace gl2
{
static void output(const char *format, va_list vararg)
{
diff --git a/src/GLES2/common/debug.h b/src/GLES2/common/debug.h
index 2f5302c..8907df4 100644
--- a/src/GLES2/common/debug.h
+++ b/src/GLES2/common/debug.h
@@ -21,7 +21,7 @@
#define TRACE_OUTPUT_FILE "debug.txt"
#endif
-namespace gl
+namespace gl2
{
// Outputs text to the debugging log
void trace(const char *format, ...);
@@ -31,21 +31,21 @@
#if defined(ANGLE_DISABLE_TRACE)
#define TRACE(message, ...) (void(0))
#else
-#define TRACE(message, ...) gl::trace("trace: %s(%d): "message"\n", __FUNCTION__, __LINE__, ##__VA_ARGS__)
+#define TRACE(message, ...) gl2::trace("trace: %s(%d): "message"\n", __FUNCTION__, __LINE__, ##__VA_ARGS__)
#endif
// A macro to output a function call and its arguments to the debugging log, to denote an item in need of fixing.
#if defined(ANGLE_DISABLE_TRACE)
#define FIXME(message, ...) (void(0))
#else
-#define FIXME(message, ...) do {gl::trace("fixme: %s(%d): "message"\n", __FUNCTION__, __LINE__, ##__VA_ARGS__); assert(false);} while(false)
+#define FIXME(message, ...) do {gl2::trace("fixme: %s(%d): "message"\n", __FUNCTION__, __LINE__, ##__VA_ARGS__); assert(false);} while(false)
#endif
// A macro to output a function call and its arguments to the debugging log, in case of error.
#if defined(ANGLE_DISABLE_TRACE)
#define ERR(message, ...) (void(0))
#else
-#define ERR(message, ...) do {gl::trace("err: %s(%d): "message"\n", __FUNCTION__, __LINE__, ##__VA_ARGS__); assert(false);} while(false)
+#define ERR(message, ...) do {gl2::trace("err: %s(%d): "message"\n", __FUNCTION__, __LINE__, ##__VA_ARGS__); assert(false);} while(false)
#endif
// A macro asserting a condition and outputting failures to the debug log
diff --git a/src/GLES2/compiler/OutputASM.cpp b/src/GLES2/compiler/OutputASM.cpp
index 5ddaec4..c01b473 100644
--- a/src/GLES2/compiler/OutputASM.cpp
+++ b/src/GLES2/compiler/OutputASM.cpp
@@ -99,7 +99,7 @@
this->registerIndex = registerIndex;
}
- OutputASM::OutputASM(TParseContext &context, gl::Shader *shaderObject) : TIntermTraverser(true, true, true), mContext(context), shaderObject(shaderObject)
+ OutputASM::OutputASM(TParseContext &context, gl2::Shader *shaderObject) : TIntermTraverser(true, true, true), mContext(context), shaderObject(shaderObject)
{
shader = 0;
pixelShader = 0;
@@ -2003,10 +2003,10 @@
{
const TType &type = varying->getType();
const char *name = varying->getAsSymbolNode()->getSymbol().c_str();
- gl::VaryingList &activeVaryings = shaderObject->varyings;
+ gl2::VaryingList &activeVaryings = shaderObject->varyings;
// Check if this varying has been declared before without having a register assigned
- for(gl::VaryingList::iterator v = activeVaryings.begin(); v != activeVaryings.end(); v++)
+ for(gl2::VaryingList::iterator v = activeVaryings.begin(); v != activeVaryings.end(); v++)
{
if(v->name == name)
{
@@ -2020,7 +2020,7 @@
}
}
- activeVaryings.push_back(gl::Varying(glVariableType(type), name, varying->getArraySize(), reg, 0));
+ activeVaryings.push_back(gl2::Varying(glVariableType(type), name, varying->getArraySize(), reg, 0));
}
}
diff --git a/src/GLES2/compiler/OutputASM.h b/src/GLES2/compiler/OutputASM.h
index 082816f..2af4a10 100644
--- a/src/GLES2/compiler/OutputASM.h
+++ b/src/GLES2/compiler/OutputASM.h
@@ -24,7 +24,7 @@
#include <set>
#include <map>
-namespace gl
+namespace gl2
{
class Shader;
}
@@ -81,7 +81,7 @@
class OutputASM : public TIntermTraverser
{
public:
- explicit OutputASM(TParseContext &context, gl::Shader *shaderObject);
+ explicit OutputASM(TParseContext &context, gl2::Shader *shaderObject);
~OutputASM();
void output();
@@ -144,7 +144,7 @@
static int dim2(TIntermNode *m);
static unsigned int loopCount(TIntermLoop *node);
- gl::Shader *const shaderObject;
+ gl2::Shader *const shaderObject;
sw::Shader *shader;
sw::PixelShader *pixelShader;
sw::VertexShader *vertexShader;
diff --git a/src/GLES2/compiler/TranslatorASM.cpp b/src/GLES2/compiler/TranslatorASM.cpp
index 8750e0d..371b072 100644
--- a/src/GLES2/compiler/TranslatorASM.cpp
+++ b/src/GLES2/compiler/TranslatorASM.cpp
@@ -13,7 +13,7 @@
#include "InitializeParseContext.h"
-TranslatorASM::TranslatorASM(gl::Shader *shaderObject, ShShaderType type, ShShaderSpec spec) : TCompiler(type, spec), shaderObject(shaderObject)
+TranslatorASM::TranslatorASM(gl2::Shader *shaderObject, ShShaderType type, ShShaderSpec spec) : TCompiler(type, spec), shaderObject(shaderObject)
{
}
diff --git a/src/GLES2/compiler/TranslatorASM.h b/src/GLES2/compiler/TranslatorASM.h
index 26ca89c..3eb1715 100644
--- a/src/GLES2/compiler/TranslatorASM.h
+++ b/src/GLES2/compiler/TranslatorASM.h
@@ -17,7 +17,7 @@
#include "Shader/PixelShader.hpp"
#include "Shader/VertexShader.hpp"
-namespace gl
+namespace gl2
{
class Shader;
}
@@ -25,13 +25,13 @@
class TranslatorASM : public TCompiler
{
public:
- TranslatorASM(gl::Shader *shaderObject, ShShaderType type, ShShaderSpec spec);
+ TranslatorASM(gl2::Shader *shaderObject, ShShaderType type, ShShaderSpec spec);
protected:
virtual bool translate(TIntermNode* root);
private:
- gl::Shader *const shaderObject;
+ gl2::Shader *const shaderObject;
};
#endif // COMPILER_TRANSLATORASM_H_
diff --git a/src/GLES2/libEGL/Display.cpp b/src/GLES2/libEGL/Display.cpp
index e904c0c..f066d07 100644
--- a/src/GLES2/libEGL/Display.cpp
+++ b/src/GLES2/libEGL/Display.cpp
@@ -387,7 +387,7 @@
{
const egl::Config *config = mConfigSet.get(configHandle);
- egl::Context *context = gl::createContext(config, shareContext);
+ egl::Context *context = gl2::createContext(config, shareContext);
mContextSet.insert(context);
return context;
diff --git a/src/GLES2/libEGL/Surface.cpp b/src/GLES2/libEGL/Surface.cpp
index 41abff7..f1ad266 100644
--- a/src/GLES2/libEGL/Surface.cpp
+++ b/src/GLES2/libEGL/Surface.cpp
@@ -131,7 +131,7 @@
if(mWindow)
{
- frameBuffer = gl::createFrameBuffer(mDisplay->getNativeDisplay(), mWindow, backBufferWidth, backBufferHeight);
+ frameBuffer = gl2::createFrameBuffer(mDisplay->getNativeDisplay(), mWindow, backBufferWidth, backBufferHeight);
if(!frameBuffer)
{
@@ -141,7 +141,7 @@
}
}
- backBuffer = gl::createBackBuffer(backBufferWidth, backBufferHeight, mConfig);
+ backBuffer = gl2::createBackBuffer(backBufferWidth, backBufferHeight, mConfig);
if(!backBuffer)
{
@@ -152,7 +152,7 @@
if(mConfig->mDepthStencilFormat != sw::FORMAT_NULL)
{
- mDepthStencil = gl::createDepthStencil(backBufferWidth, backBufferHeight, mConfig->mDepthStencilFormat, 1, false);
+ mDepthStencil = gl2::createDepthStencil(backBufferWidth, backBufferHeight, mConfig->mDepthStencilFormat, 1, false);
if(!mDepthStencil)
{
@@ -304,7 +304,7 @@
if(static_cast<egl::Surface*>(getCurrentDrawSurface()) == this)
{
- gl::makeCurrent(static_cast<egl::Context*>(getCurrentContext()), static_cast<egl::Display*>(getCurrentDisplay()), this);
+ gl2::makeCurrent(static_cast<egl::Context*>(getCurrentContext()), static_cast<egl::Display*>(getCurrentDisplay()), this);
}
return true;
diff --git a/src/GLES2/libEGL/libEGL.cpp b/src/GLES2/libEGL/libEGL.cpp
index 2b70f52..f30d181 100644
--- a/src/GLES2/libEGL/libEGL.cpp
+++ b/src/GLES2/libEGL/libEGL.cpp
@@ -868,7 +868,7 @@
egl::setCurrentReadSurface(read);
egl::setCurrentContext(ctx);
- gl::makeCurrent(context, display, static_cast<egl::Surface*>(draw));
+ gl2::makeCurrent(context, display, static_cast<egl::Surface*>(draw));
return success(EGL_TRUE);
}
@@ -1194,7 +1194,7 @@
}
}
- return gl::getProcAddress(procname);
+ return gl2::getProcAddress(procname);
}
catch(std::bad_alloc&)
{
diff --git a/src/GLES2/libEGL/main.cpp b/src/GLES2/libEGL/main.cpp
index 7db8559..8d8224a 100644
--- a/src/GLES2/libEGL/main.cpp
+++ b/src/GLES2/libEGL/main.cpp
@@ -89,12 +89,12 @@
#endif
libGLESv2 = loadLibrary(libGLESv2_lib);
- gl::createContext = (egl::Context *(*)(const egl::Config*, const egl::Context*))getProcAddress(libGLESv2, "glCreateContext");
- gl::makeCurrent = (void (*)(egl::Context*, egl::Display*, egl::Surface*))getProcAddress(libGLESv2, "glMakeCurrent");
- gl::getProcAddress = (__eglMustCastToProperFunctionPointerType (*)(const char*))getProcAddress(libGLESv2, "glGetProcAddress");
- gl::createBackBuffer = (egl::Image *(*)(int, int, const egl::Config*))getProcAddress(libGLESv2, "createBackBuffer");
- gl::createDepthStencil = (egl::Image *(*)(unsigned int, unsigned int, sw::Format, int, bool))getProcAddress(libGLESv2, "createDepthStencil");
- gl::createFrameBuffer = (sw::FrameBuffer *(*)(EGLNativeDisplayType, EGLNativeWindowType, int, int))getProcAddress(libGLESv2, "createFrameBuffer");
+ gl2::createContext = (egl::Context *(*)(const egl::Config*, const egl::Context*))getProcAddress(libGLESv2, "glCreateContext");
+ gl2::makeCurrent = (void (*)(egl::Context*, egl::Display*, egl::Surface*))getProcAddress(libGLESv2, "glMakeCurrent");
+ gl2::getProcAddress = (__eglMustCastToProperFunctionPointerType (*)(const char*))getProcAddress(libGLESv2, "glGetProcAddress");
+ gl2::createBackBuffer = (egl::Image *(*)(int, int, const egl::Config*))getProcAddress(libGLESv2, "createBackBuffer");
+ gl2::createDepthStencil = (egl::Image *(*)(unsigned int, unsigned int, sw::Format, int, bool))getProcAddress(libGLESv2, "createDepthStencil");
+ gl2::createFrameBuffer = (sw::FrameBuffer *(*)(EGLNativeDisplayType, EGLNativeWindowType, int, int))getProcAddress(libGLESv2, "createFrameBuffer");
return libGLESv2 != 0;
}
@@ -258,7 +258,7 @@
}
}
-namespace gl
+namespace gl2
{
egl::Context *(*createContext)(const egl::Config *config, const egl::Context *shareContext) = 0;
void (*makeCurrent)(egl::Context *context, egl::Display *display, egl::Surface *surface) = 0;
diff --git a/src/GLES2/libEGL/main.h b/src/GLES2/libEGL/main.h
index 2fa3647..9f54007 100644
--- a/src/GLES2/libEGL/main.h
+++ b/src/GLES2/libEGL/main.h
@@ -83,7 +83,7 @@
}
// libGLESv2 dependencies
-namespace gl
+namespace gl2
{
extern egl::Context *(*createContext)(const egl::Config *config, const egl::Context *shareContext);
extern void (*makeCurrent)(egl::Context *context, egl::Display *display, egl::Surface *surface);
diff --git a/src/GLES2/libGLESv2/Buffer.cpp b/src/GLES2/libGLESv2/Buffer.cpp
index fc535ac..b198c85 100644
--- a/src/GLES2/libGLESv2/Buffer.cpp
+++ b/src/GLES2/libGLESv2/Buffer.cpp
@@ -19,7 +19,7 @@
#include "VertexDataManager.h"
#include "IndexDataManager.h"
-namespace gl
+namespace gl2
{
Buffer::Buffer(GLuint id) : RefCountObject(id)
diff --git a/src/GLES2/libGLESv2/Buffer.h b/src/GLES2/libGLESv2/Buffer.h
index 91580e6..7fe913c 100644
--- a/src/GLES2/libGLESv2/Buffer.h
+++ b/src/GLES2/libGLESv2/Buffer.h
@@ -25,7 +25,7 @@
#include <cstddef>
#include <vector>
-namespace gl
+namespace gl2
{
class Buffer : public RefCountObject
{
diff --git a/src/GLES2/libGLESv2/Context.cpp b/src/GLES2/libGLESv2/Context.cpp
index f48a57f..b265d19 100644
--- a/src/GLES2/libGLESv2/Context.cpp
+++ b/src/GLES2/libGLESv2/Context.cpp
@@ -9,7 +9,7 @@
// or implied, including but not limited to any patent rights, are granted to you.
//
-// Context.cpp: Implements the gl::Context class, managing all GL state and performing
+// Context.cpp: Implements the gl2::Context class, managing all GL state and performing
// rendering operations. It is the GLES2 specific implementation of EGLContext.
#include "Context.h"
@@ -37,7 +37,7 @@
#undef near
#undef far
-namespace gl
+namespace gl2
{
Device *Context::device = 0;
@@ -224,9 +224,9 @@
void Context::destroy()
{
- if(this == gl::getContext())
+ if(this == gl2::getContext())
{
- gl::makeCurrent(NULL, NULL, NULL);
+ gl2::makeCurrent(NULL, NULL, NULL);
}
delete this;
@@ -3022,7 +3022,7 @@
void Context::bindTexImage(egl::Surface *surface)
{
- gl::Texture2D *textureObject = getTexture2D();
+ gl2::Texture2D *textureObject = getTexture2D();
if(textureObject)
{
@@ -3053,14 +3053,14 @@
return EGL_BAD_PARAMETER;
}
- if(textureLevel >= gl::IMPLEMENTATION_MAX_TEXTURE_LEVELS)
+ if(textureLevel >= gl2::IMPLEMENTATION_MAX_TEXTURE_LEVELS)
{
return EGL_BAD_MATCH;
}
if(textureTarget != GL_NONE)
{
- gl::Texture *texture = getTexture(name);
+ gl2::Texture *texture = getTexture(name);
if(!texture || texture->getTarget() != textureTarget)
{
@@ -3084,7 +3084,7 @@
}
else if(target == EGL_GL_RENDERBUFFER_KHR)
{
- gl::Renderbuffer *renderbuffer = getRenderbuffer(name);
+ gl2::Renderbuffer *renderbuffer = getRenderbuffer(name);
if(!renderbuffer)
{
@@ -3118,13 +3118,13 @@
if(textureTarget != GL_NONE)
{
- gl::Texture *texture = getTexture(name);
+ gl2::Texture *texture = getTexture(name);
return texture->createSharedImage(textureTarget, textureLevel);
}
else if(target == EGL_GL_RENDERBUFFER_KHR)
{
- gl::Renderbuffer *renderbuffer = getRenderbuffer(name);
+ gl2::Renderbuffer *renderbuffer = getRenderbuffer(name);
return renderbuffer->createSharedImage();
}
@@ -3138,7 +3138,7 @@
if(!device)
{
sw::Context *context = new sw::Context();
- device = new gl::Device(context);
+ device = new gl2::Device(context);
}
return device;
@@ -3149,13 +3149,13 @@
// Exported functions for use by EGL
extern "C"
{
- gl::Context *glCreateContext(const egl::Config *config, const gl::Context *shareContext)
+ gl2::Context *glCreateContext(const egl::Config *config, const gl2::Context *shareContext)
{
- return new gl::Context(config, shareContext);
+ return new gl2::Context(config, shareContext);
}
- void glMakeCurrent(gl::Context *context, egl::Display *display, egl::Surface *surface)
+ void glMakeCurrent(gl2::Context *context, egl::Display *display, egl::Surface *surface)
{
- gl::makeCurrent(context, display, surface);
+ gl2::makeCurrent(context, display, surface);
}
}
diff --git a/src/GLES2/libGLESv2/Context.h b/src/GLES2/libGLESv2/Context.h
index cc0e636..fd18df3 100644
--- a/src/GLES2/libGLESv2/Context.h
+++ b/src/GLES2/libGLESv2/Context.h
@@ -38,7 +38,7 @@
class Config;
}
-namespace gl
+namespace gl2
{
struct TranslatedAttribute;
struct TranslatedIndexData;
diff --git a/src/GLES2/libGLESv2/Device.cpp b/src/GLES2/libGLESv2/Device.cpp
index dbd2bf5..da271cf 100644
--- a/src/GLES2/libGLESv2/Device.cpp
+++ b/src/GLES2/libGLESv2/Device.cpp
@@ -27,7 +27,7 @@
bool localShaderConstants = false;
-namespace gl
+namespace gl2
{
using namespace sw;
diff --git a/src/GLES2/libGLESv2/Device.hpp b/src/GLES2/libGLESv2/Device.hpp
index 973afc8..e5d2b98 100644
--- a/src/GLES2/libGLESv2/Device.hpp
+++ b/src/GLES2/libGLESv2/Device.hpp
@@ -19,7 +19,7 @@
class Image;
}
-namespace gl
+namespace gl2
{
class Texture;
class Image;
diff --git a/src/GLES2/libGLESv2/Fence.cpp b/src/GLES2/libGLESv2/Fence.cpp
index 8221075..a54a2f1 100644
--- a/src/GLES2/libGLESv2/Fence.cpp
+++ b/src/GLES2/libGLESv2/Fence.cpp
@@ -16,7 +16,7 @@
#include "main.h"
#include "Common/Thread.hpp"
-namespace gl
+namespace gl2
{
Fence::Fence()
diff --git a/src/GLES2/libGLESv2/Fence.h b/src/GLES2/libGLESv2/Fence.h
index bd6d9ac..bd438da 100644
--- a/src/GLES2/libGLESv2/Fence.h
+++ b/src/GLES2/libGLESv2/Fence.h
@@ -17,7 +17,7 @@
#define GL_APICALL
#include <GLES2/gl2.h>
-namespace gl
+namespace gl2
{
class Fence
diff --git a/src/GLES2/libGLESv2/Framebuffer.cpp b/src/GLES2/libGLESv2/Framebuffer.cpp
index dd16a20..ead9a8d 100644
--- a/src/GLES2/libGLESv2/Framebuffer.cpp
+++ b/src/GLES2/libGLESv2/Framebuffer.cpp
@@ -19,7 +19,7 @@
#include "Texture.h"
#include "utilities.h"
-namespace gl
+namespace gl2
{
Framebuffer::Framebuffer()
@@ -245,7 +245,7 @@
if(mColorbufferType == GL_RENDERBUFFER)
{
- if(!gl::IsColorRenderable(colorbuffer->getFormat()))
+ if(!gl2::IsColorRenderable(colorbuffer->getFormat()))
{
return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
}
@@ -262,7 +262,7 @@
return GL_FRAMEBUFFER_UNSUPPORTED;
}
- if(gl::IsDepthTexture(format) || gl::IsStencilTexture(format))
+ if(gl2::IsDepthTexture(format) || gl2::IsStencilTexture(format))
{
return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
}
@@ -297,14 +297,14 @@
if(mDepthbufferType == GL_RENDERBUFFER)
{
- if(!gl::IsDepthRenderable(depthbuffer->getFormat()))
+ if(!gl2::IsDepthRenderable(depthbuffer->getFormat()))
{
return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
}
}
else if(IsTextureTarget(mDepthbufferType))
{
- if(!gl::IsDepthTexture(depthbuffer->getFormat()))
+ if(!gl2::IsDepthTexture(depthbuffer->getFormat()))
{
return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
}
@@ -347,7 +347,7 @@
if(mStencilbufferType == GL_RENDERBUFFER)
{
- if(!gl::IsStencilRenderable(stencilbuffer->getFormat()))
+ if(!gl2::IsStencilRenderable(stencilbuffer->getFormat()))
{
return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
}
@@ -356,7 +356,7 @@
{
GLenum internalformat = stencilbuffer->getFormat();
- if(!gl::IsStencilTexture(internalformat))
+ if(!gl2::IsStencilTexture(internalformat))
{
return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
}
diff --git a/src/GLES2/libGLESv2/Framebuffer.h b/src/GLES2/libGLESv2/Framebuffer.h
index 2406dad..2b0a839 100644
--- a/src/GLES2/libGLESv2/Framebuffer.h
+++ b/src/GLES2/libGLESv2/Framebuffer.h
@@ -21,7 +21,7 @@
#define GL_APICALL
#include <GLES2/gl2.h>
-namespace gl
+namespace gl2
{
class Renderbuffer;
class Colorbuffer;
diff --git a/src/GLES2/libGLESv2/HandleAllocator.cpp b/src/GLES2/libGLESv2/HandleAllocator.cpp
index 7db672a..38aeb92 100644
--- a/src/GLES2/libGLESv2/HandleAllocator.cpp
+++ b/src/GLES2/libGLESv2/HandleAllocator.cpp
@@ -16,7 +16,7 @@
#include "main.h"
-namespace gl
+namespace gl2
{
HandleAllocator::HandleAllocator() : mBaseValue(1), mNextValue(1)
diff --git a/src/GLES2/libGLESv2/HandleAllocator.h b/src/GLES2/libGLESv2/HandleAllocator.h
index 3dc5a34..1259246 100644
--- a/src/GLES2/libGLESv2/HandleAllocator.h
+++ b/src/GLES2/libGLESv2/HandleAllocator.h
@@ -20,7 +20,7 @@
#include <vector>
-namespace gl
+namespace gl2
{
class HandleAllocator
diff --git a/src/GLES2/libGLESv2/Image.cpp b/src/GLES2/libGLESv2/Image.cpp
index fb9976c..138253b 100644
--- a/src/GLES2/libGLESv2/Image.cpp
+++ b/src/GLES2/libGLESv2/Image.cpp
@@ -18,7 +18,7 @@
#include <GLES2/gl2ext.h>
-namespace gl
+namespace gl2
{
static sw::Resource *getParentResource(Texture *texture)
{
diff --git a/src/GLES2/libGLESv2/Image.hpp b/src/GLES2/libGLESv2/Image.hpp
index feea102..c07ba10 100644
--- a/src/GLES2/libGLESv2/Image.hpp
+++ b/src/GLES2/libGLESv2/Image.hpp
@@ -18,7 +18,7 @@
#define GL_APICALL
#include <GLES2/gl2.h>
-namespace gl
+namespace gl2
{
class Texture;
diff --git a/src/GLES2/libGLESv2/IndexDataManager.cpp b/src/GLES2/libGLESv2/IndexDataManager.cpp
index 3dbfe44..1493d70 100644
--- a/src/GLES2/libGLESv2/IndexDataManager.cpp
+++ b/src/GLES2/libGLESv2/IndexDataManager.cpp
@@ -25,7 +25,7 @@
enum { INITIAL_INDEX_BUFFER_SIZE = 4096 * sizeof(GLuint) };
}
-namespace gl
+namespace gl2
{
IndexDataManager::IndexDataManager()
diff --git a/src/GLES2/libGLESv2/IndexDataManager.h b/src/GLES2/libGLESv2/IndexDataManager.h
index 059e9fc..3feb36b 100644
--- a/src/GLES2/libGLESv2/IndexDataManager.h
+++ b/src/GLES2/libGLESv2/IndexDataManager.h
@@ -20,7 +20,7 @@
#define GL_APICALL
#include <GLES2/gl2.h>
-namespace gl
+namespace gl2
{
struct TranslatedIndexData
diff --git a/src/GLES2/libGLESv2/Program.cpp b/src/GLES2/libGLESv2/Program.cpp
index ca0ddd6..c1378d5 100644
--- a/src/GLES2/libGLESv2/Program.cpp
+++ b/src/GLES2/libGLESv2/Program.cpp
@@ -24,7 +24,7 @@
#include <string>
#include <stdlib.h>
-namespace gl
+namespace gl2
{
unsigned int Program::currentSerial = 1;
diff --git a/src/GLES2/libGLESv2/Program.h b/src/GLES2/libGLESv2/Program.h
index 33e358c..ac2d2cf 100644
--- a/src/GLES2/libGLESv2/Program.h
+++ b/src/GLES2/libGLESv2/Program.h
@@ -24,7 +24,7 @@
#include <vector>
#include <set>
-namespace gl
+namespace gl2
{
class Device;
class ResourceManager;
@@ -163,7 +163,7 @@
static unsigned int issueSerial();
private:
- gl::Device *device;
+ gl2::Device *device;
FragmentShader *fragmentShader;
VertexShader *vertexShader;
diff --git a/src/GLES2/libGLESv2/Query.cpp b/src/GLES2/libGLESv2/Query.cpp
index 8e69d70..a1ee93e 100644
--- a/src/GLES2/libGLESv2/Query.cpp
+++ b/src/GLES2/libGLESv2/Query.cpp
@@ -9,14 +9,14 @@
// or implied, including but not limited to any patent rights, are granted to you.
//
-// Query.cpp: Implements the gl::Query class
+// Query.cpp: Implements the gl2::Query class
#include "Query.h"
#include "main.h"
#include "Common/Thread.hpp"
-namespace gl
+namespace gl2
{
Query::Query(GLuint id, GLenum type) : RefCountObject(id)
diff --git a/src/GLES2/libGLESv2/Query.h b/src/GLES2/libGLESv2/Query.h
index a80456e..5b674c0 100644
--- a/src/GLES2/libGLESv2/Query.h
+++ b/src/GLES2/libGLESv2/Query.h
@@ -9,7 +9,7 @@
// or implied, including but not limited to any patent rights, are granted to you.
//
-// Query.h: Defines the gl::Query class
+// Query.h: Defines the gl2::Query class
#ifndef LIBGLESV2_QUERY_H_
#define LIBGLESV2_QUERY_H_
@@ -20,7 +20,7 @@
#define GL_APICALL
#include <GLES2/gl2.h>
-namespace gl
+namespace gl2
{
class Query : public RefCountObject
diff --git a/src/GLES2/libGLESv2/RefCountObject.cpp b/src/GLES2/libGLESv2/RefCountObject.cpp
index b470ab2..e386c3e 100644
--- a/src/GLES2/libGLESv2/RefCountObject.cpp
+++ b/src/GLES2/libGLESv2/RefCountObject.cpp
@@ -18,7 +18,7 @@
#include "Common/Thread.hpp"
-namespace gl
+namespace gl2
{
RefCountObject::RefCountObject(GLuint id)
diff --git a/src/GLES2/libGLESv2/RefCountObject.h b/src/GLES2/libGLESv2/RefCountObject.h
index a9a11e0..e064a56 100644
--- a/src/GLES2/libGLESv2/RefCountObject.h
+++ b/src/GLES2/libGLESv2/RefCountObject.h
@@ -24,7 +24,7 @@
#include <cstddef>
-namespace gl
+namespace gl2
{
class RefCountObject
diff --git a/src/GLES2/libGLESv2/Renderbuffer.cpp b/src/GLES2/libGLESv2/Renderbuffer.cpp
index 81fcd45..e7e96cd 100644
--- a/src/GLES2/libGLESv2/Renderbuffer.cpp
+++ b/src/GLES2/libGLESv2/Renderbuffer.cpp
@@ -19,7 +19,7 @@
#include "Texture.h"
#include "utilities.h"
-namespace gl
+namespace gl2
{
RenderbufferInterface::RenderbufferInterface()
{
diff --git a/src/GLES2/libGLESv2/Renderbuffer.h b/src/GLES2/libGLESv2/Renderbuffer.h
index b947ace..1a70a82 100644
--- a/src/GLES2/libGLESv2/Renderbuffer.h
+++ b/src/GLES2/libGLESv2/Renderbuffer.h
@@ -23,7 +23,7 @@
#define GL_APICALL
#include <GLES2/gl2.h>
-namespace gl
+namespace gl2
{
class Texture2D;
class TextureCubeMap;
diff --git a/src/GLES2/libGLESv2/ResourceManager.cpp b/src/GLES2/libGLESv2/ResourceManager.cpp
index 8bddcc8..9fab537 100644
--- a/src/GLES2/libGLESv2/ResourceManager.cpp
+++ b/src/GLES2/libGLESv2/ResourceManager.cpp
@@ -20,7 +20,7 @@
#include "Shader.h"
#include "Texture.h"
-namespace gl
+namespace gl2
{
ResourceManager::ResourceManager()
{
diff --git a/src/GLES2/libGLESv2/ResourceManager.h b/src/GLES2/libGLESv2/ResourceManager.h
index cd4ae12..40cd8b3 100644
--- a/src/GLES2/libGLESv2/ResourceManager.h
+++ b/src/GLES2/libGLESv2/ResourceManager.h
@@ -22,7 +22,7 @@
#include <map>
-namespace gl
+namespace gl2
{
class Buffer;
class Shader;
diff --git a/src/GLES2/libGLESv2/Shader.cpp b/src/GLES2/libGLESv2/Shader.cpp
index a3129c0..59d240e 100644
--- a/src/GLES2/libGLESv2/Shader.cpp
+++ b/src/GLES2/libGLESv2/Shader.cpp
@@ -22,7 +22,7 @@
#include <string>
-namespace gl
+namespace gl2
{
Shader::Shader(ResourceManager *manager, GLuint handle) : mHandle(handle), mResourceManager(manager)
{
diff --git a/src/GLES2/libGLESv2/Shader.h b/src/GLES2/libGLESv2/Shader.h
index df2bab6..914e222 100644
--- a/src/GLES2/libGLESv2/Shader.h
+++ b/src/GLES2/libGLESv2/Shader.h
@@ -32,7 +32,7 @@
class OutputASM;
}
-namespace gl
+namespace gl2
{
struct Varying
{
@@ -46,7 +46,7 @@
return arraySize >= 1;
}
- int size() const // Unify with gl::Uniform?
+ int size() const // Unify with gl2::Uniform?
{
return arraySize > 0 ? arraySize : 1;
}
diff --git a/src/GLES2/libGLESv2/Texture.cpp b/src/GLES2/libGLESv2/Texture.cpp
index 09998ce..dd7a6c5 100644
--- a/src/GLES2/libGLESv2/Texture.cpp
+++ b/src/GLES2/libGLESv2/Texture.cpp
@@ -25,7 +25,7 @@
#include <algorithm>
-namespace gl
+namespace gl2
{
Texture::Texture(GLuint id) : RefCountObject(id)
@@ -1156,17 +1156,17 @@
// Exported functions for use by EGL
extern "C"
{
- gl::Image *createBackBuffer(int width, int height, const egl::Config *config)
+ gl2::Image *createBackBuffer(int width, int height, const egl::Config *config)
{
if(config)
{
- return new gl::Image(0, width, height, config->mAlphaSize ? GL_RGBA : GL_RGB, GL_UNSIGNED_BYTE);
+ return new gl2::Image(0, width, height, config->mAlphaSize ? GL_RGBA : GL_RGB, GL_UNSIGNED_BYTE);
}
return 0;
}
- gl::Image *createDepthStencil(unsigned int width, unsigned int height, sw::Format format, int multiSampleDepth, bool discard)
+ gl2::Image *createDepthStencil(unsigned int width, unsigned int height, sw::Format format, int multiSampleDepth, bool discard)
{
if(width == 0 || height == 0 || height > OUTLINE_RESOLUTION)
{
@@ -1199,7 +1199,7 @@
UNREACHABLE();
}
- gl::Image *surface = new gl::Image(0, width, height, format, multiSampleDepth, lockable, true);
+ gl2::Image *surface = new gl2::Image(0, width, height, format, multiSampleDepth, lockable, true);
if(!surface)
{
diff --git a/src/GLES2/libGLESv2/Texture.h b/src/GLES2/libGLESv2/Texture.h
index ff3b392..3157fb5 100644
--- a/src/GLES2/libGLESv2/Texture.h
+++ b/src/GLES2/libGLESv2/Texture.h
@@ -33,7 +33,7 @@
class Config;
}
-namespace gl
+namespace gl2
{
class Framebuffer;
diff --git a/src/GLES2/libGLESv2/VertexDataManager.cpp b/src/GLES2/libGLESv2/VertexDataManager.cpp
index ff88a6d..d60e72b 100644
--- a/src/GLES2/libGLESv2/VertexDataManager.cpp
+++ b/src/GLES2/libGLESv2/VertexDataManager.cpp
@@ -24,7 +24,7 @@
enum {INITIAL_STREAM_BUFFER_SIZE = 1024 * 1024};
}
-namespace gl
+namespace gl2
{
VertexDataManager::VertexDataManager(Context *context) : mContext(context)
diff --git a/src/GLES2/libGLESv2/VertexDataManager.h b/src/GLES2/libGLESv2/VertexDataManager.h
index 8800219..50a2e9c 100644
--- a/src/GLES2/libGLESv2/VertexDataManager.h
+++ b/src/GLES2/libGLESv2/VertexDataManager.h
@@ -21,7 +21,7 @@
#define GL_APICALL
#include <GLES2/gl2.h>
-namespace gl
+namespace gl2
{
struct TranslatedAttribute
diff --git a/src/GLES2/libGLESv2/libGLESv2.cpp b/src/GLES2/libGLESv2/libGLESv2.cpp
index 30046ff..e60e5d3 100644
--- a/src/GLES2/libGLESv2/libGLESv2.cpp
+++ b/src/GLES2/libGLESv2/libGLESv2.cpp
@@ -35,7 +35,7 @@
static bool validImageSize(GLint level, GLsizei width, GLsizei height)
{
- if(level < 0 || level >= gl::IMPLEMENTATION_MAX_TEXTURE_LEVELS || width < 0 || height < 0)
+ if(level < 0 || level >= gl2::IMPLEMENTATION_MAX_TEXTURE_LEVELS || width < 0 || height < 0)
{
return false;
}
@@ -43,7 +43,7 @@
return true;
}
-static bool validateSubImageParams(bool compressed, GLsizei width, GLsizei height, GLint xoffset, GLint yoffset, GLenum target, GLint level, GLenum format, gl::Texture *texture)
+static bool validateSubImageParams(bool compressed, GLsizei width, GLsizei height, GLint xoffset, GLint yoffset, GLenum target, GLint level, GLenum format, gl2::Texture *texture)
{
if(!texture)
{
@@ -103,10 +103,10 @@
return false;
}
break;
- case gl::IMPLEMENTATION_COLOR_READ_FORMAT:
+ case gl2::IMPLEMENTATION_COLOR_READ_FORMAT:
switch (type)
{
- case gl::IMPLEMENTATION_COLOR_READ_TYPE:
+ case gl2::IMPLEMENTATION_COLOR_READ_TYPE:
break;
default:
return false;
@@ -128,11 +128,11 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- if(texture < GL_TEXTURE0 || texture > GL_TEXTURE0 + gl::MAX_COMBINED_TEXTURE_IMAGE_UNITS - 1)
+ if(texture < GL_TEXTURE0 || texture > GL_TEXTURE0 + gl2::MAX_COMBINED_TEXTURE_IMAGE_UNITS - 1)
{
return error(GL_INVALID_ENUM);
}
@@ -152,12 +152,12 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::Program *programObject = context->getProgram(program);
- gl::Shader *shaderObject = context->getShader(shader);
+ gl2::Program *programObject = context->getProgram(program);
+ gl2::Shader *shaderObject = context->getShader(shader);
if(!programObject)
{
@@ -215,7 +215,7 @@
return error(GL_INVALID_OPERATION);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -234,16 +234,16 @@
try
{
- if(index >= gl::MAX_VERTEX_ATTRIBS)
+ if(index >= gl2::MAX_VERTEX_ATTRIBS)
{
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::Program *programObject = context->getProgram(program);
+ gl2::Program *programObject = context->getProgram(program);
if(!programObject)
{
@@ -277,7 +277,7 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -311,7 +311,7 @@
return error(GL_INVALID_ENUM);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -343,7 +343,7 @@
return error(GL_INVALID_ENUM);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -362,11 +362,11 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::Texture *textureObject = context->getTexture(texture);
+ gl2::Texture *textureObject = context->getTexture(texture);
if(textureObject && textureObject->getTarget() != target && texture != 0)
{
@@ -402,11 +402,11 @@
try
{
- gl::Context* context = gl::getContext();
+ gl2::Context* context = gl2::getContext();
if(context)
{
- context->setBlendColor(gl::clamp01(red), gl::clamp01(green), gl::clamp01(blue), gl::clamp01(alpha));
+ context->setBlendColor(gl2::clamp01(red), gl2::clamp01(green), gl2::clamp01(blue), gl2::clamp01(alpha));
}
}
catch(std::bad_alloc&)
@@ -450,7 +450,7 @@
return error(GL_INVALID_ENUM);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -561,7 +561,7 @@
return error(GL_INVALID_ENUM);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -596,11 +596,11 @@
return error(GL_INVALID_ENUM);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::Buffer *buffer;
+ gl2::Buffer *buffer;
switch(target)
{
@@ -645,11 +645,11 @@
return;
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::Buffer *buffer;
+ gl2::Buffer *buffer;
switch(target)
{
@@ -693,11 +693,11 @@
return error(GL_INVALID_ENUM, 0);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::Framebuffer *framebuffer = NULL;
+ gl2::Framebuffer *framebuffer = NULL;
if(target == GL_READ_FRAMEBUFFER_ANGLE)
{
framebuffer = context->getReadFramebuffer();
@@ -729,7 +729,7 @@
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -749,7 +749,7 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -768,7 +768,7 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -787,7 +787,7 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -807,7 +807,7 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -826,11 +826,11 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::Shader *shaderObject = context->getShader(shader);
+ gl2::Shader *shaderObject = context->getShader(shader);
if(!shaderObject)
{
@@ -893,11 +893,11 @@
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- if(level > gl::IMPLEMENTATION_MAX_TEXTURE_LEVELS)
+ if(level > gl2::IMPLEMENTATION_MAX_TEXTURE_LEVELS)
{
return error(GL_INVALID_VALUE);
}
@@ -905,8 +905,8 @@
switch(target)
{
case GL_TEXTURE_2D:
- if(width > (gl::IMPLEMENTATION_MAX_TEXTURE_SIZE >> level) ||
- height > (gl::IMPLEMENTATION_MAX_TEXTURE_SIZE >> level))
+ if(width > (gl2::IMPLEMENTATION_MAX_TEXTURE_SIZE >> level) ||
+ height > (gl2::IMPLEMENTATION_MAX_TEXTURE_SIZE >> level))
{
return error(GL_INVALID_VALUE);
}
@@ -922,8 +922,8 @@
return error(GL_INVALID_VALUE);
}
- if(width > (gl::IMPLEMENTATION_MAX_CUBE_MAP_TEXTURE_SIZE >> level) ||
- height > (gl::IMPLEMENTATION_MAX_CUBE_MAP_TEXTURE_SIZE >> level))
+ if(width > (gl2::IMPLEMENTATION_MAX_CUBE_MAP_TEXTURE_SIZE >> level) ||
+ height > (gl2::IMPLEMENTATION_MAX_CUBE_MAP_TEXTURE_SIZE >> level))
{
return error(GL_INVALID_VALUE);
}
@@ -932,14 +932,14 @@
return error(GL_INVALID_ENUM);
}
- if(imageSize != gl::ComputeCompressedSize(width, height, internalformat))
+ if(imageSize != gl2::ComputeCompressedSize(width, height, internalformat))
{
return error(GL_INVALID_VALUE);
}
if(target == GL_TEXTURE_2D)
{
- gl::Texture2D *texture = context->getTexture2D();
+ gl2::Texture2D *texture = context->getTexture2D();
if(!texture)
{
@@ -950,7 +950,7 @@
}
else
{
- gl::TextureCubeMap *texture = context->getTextureCubeMap();
+ gl2::TextureCubeMap *texture = context->getTextureCubeMap();
if(!texture)
{
@@ -988,7 +988,7 @@
try
{
- if(!gl::IsTextureTarget(target))
+ if(!gl2::IsTextureTarget(target))
{
return error(GL_INVALID_ENUM);
}
@@ -1018,16 +1018,16 @@
return;
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- if(level > gl::IMPLEMENTATION_MAX_TEXTURE_LEVELS)
+ if(level > gl2::IMPLEMENTATION_MAX_TEXTURE_LEVELS)
{
return error(GL_INVALID_VALUE);
}
- if(imageSize != gl::ComputeCompressedSize(width, height, format))
+ if(imageSize != gl2::ComputeCompressedSize(width, height, format))
{
return error(GL_INVALID_VALUE);
}
@@ -1040,16 +1040,16 @@
if(target == GL_TEXTURE_2D)
{
- gl::Texture2D *texture = context->getTexture2D();
+ gl2::Texture2D *texture = context->getTexture2D();
if(validateSubImageParams(true, width, height, xoffset, yoffset, target, level, format, texture))
{
texture->subImageCompressed(level, xoffset, yoffset, width, height, format, imageSize, data);
}
}
- else if(gl::IsCubemapTextureTarget(target))
+ else if(gl2::IsCubemapTextureTarget(target))
{
- gl::TextureCubeMap *texture = context->getTextureCubeMap();
+ gl2::TextureCubeMap *texture = context->getTextureCubeMap();
if(validateSubImageParams(true, width, height, xoffset, yoffset, target, level, format, texture))
{
@@ -1086,15 +1086,15 @@
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
switch(target)
{
case GL_TEXTURE_2D:
- if(width > (gl::IMPLEMENTATION_MAX_TEXTURE_SIZE >> level) ||
- height > (gl::IMPLEMENTATION_MAX_TEXTURE_SIZE >> level))
+ if(width > (gl2::IMPLEMENTATION_MAX_TEXTURE_SIZE >> level) ||
+ height > (gl2::IMPLEMENTATION_MAX_TEXTURE_SIZE >> level))
{
return error(GL_INVALID_VALUE);
}
@@ -1110,8 +1110,8 @@
return error(GL_INVALID_VALUE);
}
- if(width > (gl::IMPLEMENTATION_MAX_CUBE_MAP_TEXTURE_SIZE >> level) ||
- height > (gl::IMPLEMENTATION_MAX_CUBE_MAP_TEXTURE_SIZE >> level))
+ if(width > (gl2::IMPLEMENTATION_MAX_CUBE_MAP_TEXTURE_SIZE >> level) ||
+ height > (gl2::IMPLEMENTATION_MAX_CUBE_MAP_TEXTURE_SIZE >> level))
{
return error(GL_INVALID_VALUE);
}
@@ -1120,7 +1120,7 @@
return error(GL_INVALID_ENUM);
}
- gl::Framebuffer *framebuffer = context->getReadFramebuffer();
+ gl2::Framebuffer *framebuffer = context->getReadFramebuffer();
if(framebuffer->completeness() != GL_FRAMEBUFFER_COMPLETE)
{
@@ -1132,7 +1132,7 @@
return error(GL_INVALID_OPERATION);
}
- gl::Renderbuffer *source = framebuffer->getColorbuffer();
+ gl2::Renderbuffer *source = framebuffer->getColorbuffer();
GLenum colorbufferFormat = source->getFormat();
// [OpenGL ES 2.0.24] table 3.9
@@ -1190,7 +1190,7 @@
if(target == GL_TEXTURE_2D)
{
- gl::Texture2D *texture = context->getTexture2D();
+ gl2::Texture2D *texture = context->getTexture2D();
if(!texture)
{
@@ -1199,9 +1199,9 @@
texture->copyImage(level, internalformat, x, y, width, height, framebuffer);
}
- else if(gl::IsCubemapTextureTarget(target))
+ else if(gl2::IsCubemapTextureTarget(target))
{
- gl::TextureCubeMap *texture = context->getTextureCubeMap();
+ gl2::TextureCubeMap *texture = context->getTextureCubeMap();
if(!texture)
{
@@ -1227,7 +1227,7 @@
try
{
- if(!gl::IsTextureTarget(target))
+ if(!gl2::IsTextureTarget(target))
{
return error(GL_INVALID_ENUM);
}
@@ -1247,16 +1247,16 @@
return;
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- if(level > gl::IMPLEMENTATION_MAX_TEXTURE_LEVELS)
+ if(level > gl2::IMPLEMENTATION_MAX_TEXTURE_LEVELS)
{
return error(GL_INVALID_VALUE);
}
- gl::Framebuffer *framebuffer = context->getReadFramebuffer();
+ gl2::Framebuffer *framebuffer = context->getReadFramebuffer();
if(framebuffer->completeness() != GL_FRAMEBUFFER_COMPLETE)
{
@@ -1268,15 +1268,15 @@
return error(GL_INVALID_OPERATION);
}
- gl::Renderbuffer *source = framebuffer->getColorbuffer();
+ gl2::Renderbuffer *source = framebuffer->getColorbuffer();
GLenum colorbufferFormat = source->getFormat();
- gl::Texture *texture = NULL;
+ gl2::Texture *texture = NULL;
if(target == GL_TEXTURE_2D)
{
texture = context->getTexture2D();
}
- else if(gl::IsCubemapTextureTarget(target))
+ else if(gl2::IsCubemapTextureTarget(target))
{
texture = context->getTextureCubeMap();
}
@@ -1353,7 +1353,7 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -1374,7 +1374,7 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -1408,7 +1408,7 @@
case GL_BACK:
case GL_FRONT_AND_BACK:
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -1437,7 +1437,7 @@
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -1464,7 +1464,7 @@
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -1491,7 +1491,7 @@
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -1521,7 +1521,7 @@
return;
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -1557,7 +1557,7 @@
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -1584,7 +1584,7 @@
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -1611,7 +1611,7 @@
return;
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -1647,7 +1647,7 @@
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -1687,7 +1687,7 @@
return error(GL_INVALID_ENUM);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -1706,7 +1706,7 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -1725,7 +1725,7 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -1744,17 +1744,17 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::Program *programObject = context->getProgram(program);
- gl::Shader *shaderObject = context->getShader(shader);
+ gl2::Program *programObject = context->getProgram(program);
+ gl2::Shader *shaderObject = context->getShader(shader);
if(!programObject)
{
- gl::Shader *shaderByProgramHandle;
+ gl2::Shader *shaderByProgramHandle;
shaderByProgramHandle = context->getShader(program);
if(!shaderByProgramHandle)
{
@@ -1768,7 +1768,7 @@
if(!shaderObject)
{
- gl::Program *programByShaderHandle = context->getProgram(shader);
+ gl2::Program *programByShaderHandle = context->getProgram(shader);
if(!programByShaderHandle)
{
return error(GL_INVALID_VALUE);
@@ -1797,7 +1797,7 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -1829,12 +1829,12 @@
try
{
- if(index >= gl::MAX_VERTEX_ATTRIBS)
+ if(index >= gl2::MAX_VERTEX_ATTRIBS)
{
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -1858,7 +1858,7 @@
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -1883,7 +1883,7 @@
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -1912,7 +1912,7 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -1944,12 +1944,12 @@
try
{
- if(index >= gl::MAX_VERTEX_ATTRIBS)
+ if(index >= gl2::MAX_VERTEX_ATTRIBS)
{
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -1977,7 +1977,7 @@
return error(GL_INVALID_ENUM);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -1996,11 +1996,11 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::Fence* fenceObject = context->getFence(fence);
+ gl2::Fence* fenceObject = context->getFence(fence);
if(fenceObject == NULL)
{
@@ -2022,7 +2022,7 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -2041,7 +2041,7 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -2067,11 +2067,11 @@
return error(GL_INVALID_ENUM);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::Framebuffer *framebuffer = NULL;
+ gl2::Framebuffer *framebuffer = NULL;
GLuint framebufferHandle = 0;
if(target == GL_READ_FRAMEBUFFER_ANGLE)
{
@@ -2133,7 +2133,7 @@
return error(GL_INVALID_ENUM);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -2143,7 +2143,7 @@
}
else
{
- gl::Texture *tex = context->getTexture(texture);
+ gl2::Texture *tex = context->getTexture(texture);
if(tex == NULL)
{
@@ -2186,7 +2186,7 @@
}
}
- gl::Framebuffer *framebuffer = NULL;
+ gl2::Framebuffer *framebuffer = NULL;
GLuint framebufferHandle = 0;
if(target == GL_READ_FRAMEBUFFER_ANGLE)
{
@@ -2229,7 +2229,7 @@
case GL_CW:
case GL_CCW:
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -2258,7 +2258,7 @@
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -2280,11 +2280,11 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::Texture *texture;
+ gl2::Texture *texture;
switch(target)
{
@@ -2323,7 +2323,7 @@
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -2350,7 +2350,7 @@
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -2377,7 +2377,7 @@
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -2404,7 +2404,7 @@
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -2431,7 +2431,7 @@
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -2460,11 +2460,11 @@
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::Program *programObject = context->getProgram(program);
+ gl2::Program *programObject = context->getProgram(program);
if(!programObject)
{
@@ -2505,11 +2505,11 @@
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::Program *programObject = context->getProgram(program);
+ gl2::Program *programObject = context->getProgram(program);
if(!programObject)
{
@@ -2549,11 +2549,11 @@
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::Program *programObject = context->getProgram(program);
+ gl2::Program *programObject = context->getProgram(program);
if(!programObject)
{
@@ -2582,12 +2582,12 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::Program *programObject = context->getProgram(program);
+ gl2::Program *programObject = context->getProgram(program);
if(!programObject)
{
@@ -2623,7 +2623,7 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -2686,11 +2686,11 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::Buffer *buffer;
+ gl2::Buffer *buffer;
switch(target)
{
@@ -2731,7 +2731,7 @@
{
TRACE("()");
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -2747,11 +2747,11 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::Fence *fenceObject = context->getFence(fence);
+ gl2::Fence *fenceObject = context->getFence(fence);
if(fenceObject == NULL)
{
@@ -2773,7 +2773,7 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -2834,7 +2834,7 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -2843,7 +2843,7 @@
return error(GL_INVALID_ENUM);
}
- gl::Framebuffer *framebuffer = NULL;
+ gl2::Framebuffer *framebuffer = NULL;
if(target == GL_READ_FRAMEBUFFER_ANGLE)
{
if(context->getReadFramebufferHandle() == 0)
@@ -2887,7 +2887,7 @@
{
attachmentObjectType = attachmentType;
}
- else if(gl::IsTextureTarget(attachmentType))
+ else if(gl2::IsTextureTarget(attachmentType))
{
attachmentObjectType = GL_TEXTURE;
}
@@ -2921,7 +2921,7 @@
case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:
if(attachmentObjectType == GL_TEXTURE)
{
- if(gl::IsCubemapTextureTarget(attachmentType))
+ if(gl2::IsCubemapTextureTarget(attachmentType))
{
*params = attachmentType;
}
@@ -2959,7 +2959,7 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -3024,11 +3024,11 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::Program *programObject = context->getProgram(program);
+ gl2::Program *programObject = context->getProgram(program);
if(!programObject)
{
@@ -3087,11 +3087,11 @@
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::Program *programObject = context->getProgram(program);
+ gl2::Program *programObject = context->getProgram(program);
if(!programObject)
{
@@ -3121,7 +3121,7 @@
return error(GL_INVALID_ENUM);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -3149,11 +3149,11 @@
return error(GL_INVALID_ENUM);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::Query *queryObject = context->getQuery(id, false, GL_NONE);
+ gl2::Query *queryObject = context->getQuery(id, false, GL_NONE);
if(!queryObject)
{
@@ -3190,7 +3190,7 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -3204,7 +3204,7 @@
return error(GL_INVALID_OPERATION);
}
- gl::Renderbuffer *renderbuffer = context->getRenderbuffer(context->getRenderbufferHandle());
+ gl2::Renderbuffer *renderbuffer = context->getRenderbuffer(context->getRenderbufferHandle());
switch(pname)
{
@@ -3235,11 +3235,11 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::Shader *shaderObject = context->getShader(shader);
+ gl2::Shader *shaderObject = context->getShader(shader);
if(!shaderObject)
{
@@ -3286,11 +3286,11 @@
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::Shader *shaderObject = context->getShader(shader);
+ gl2::Shader *shaderObject = context->getShader(shader);
if(!shaderObject)
{
@@ -3362,11 +3362,11 @@
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::Shader *shaderObject = context->getShader(shader);
+ gl2::Shader *shaderObject = context->getShader(shader);
if(!shaderObject)
{
@@ -3388,7 +3388,7 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
switch(name)
{
@@ -3450,11 +3450,11 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::Texture *texture;
+ gl2::Texture *texture;
switch(target)
{
@@ -3508,11 +3508,11 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::Texture *texture;
+ gl2::Texture *texture;
switch(target)
{
@@ -3572,7 +3572,7 @@
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -3581,7 +3581,7 @@
return error(GL_INVALID_VALUE);
}
- gl::Program *programObject = context->getProgram(program);
+ gl2::Program *programObject = context->getProgram(program);
if(!programObject || !programObject->isLinked())
{
@@ -3606,7 +3606,7 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -3615,7 +3615,7 @@
return error(GL_INVALID_VALUE);
}
- gl::Program *programObject = context->getProgram(program);
+ gl2::Program *programObject = context->getProgram(program);
if(!programObject || !programObject->isLinked())
{
@@ -3646,7 +3646,7 @@
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -3655,7 +3655,7 @@
return error(GL_INVALID_VALUE);
}
- gl::Program *programObject = context->getProgram(program);
+ gl2::Program *programObject = context->getProgram(program);
if(!programObject || !programObject->isLinked())
{
@@ -3685,7 +3685,7 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -3694,7 +3694,7 @@
return error(GL_INVALID_VALUE);
}
- gl::Program *programObject = context->getProgram(program);
+ gl2::Program *programObject = context->getProgram(program);
if(!programObject || !programObject->isLinked())
{
@@ -3724,7 +3724,7 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(strstr(name, "gl_") == name)
{
@@ -3733,7 +3733,7 @@
if(context)
{
- gl::Program *programObject = context->getProgram(program);
+ gl2::Program *programObject = context->getProgram(program);
if(!programObject)
{
@@ -3769,16 +3769,16 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- if(index >= gl::MAX_VERTEX_ATTRIBS)
+ if(index >= gl2::MAX_VERTEX_ATTRIBS)
{
return error(GL_INVALID_VALUE);
}
- const gl::VertexAttribute &attribState = context->getVertexAttribState(index);
+ const gl2::VertexAttribute &attribState = context->getVertexAttribState(index);
switch(pname)
{
@@ -3822,16 +3822,16 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- if(index >= gl::MAX_VERTEX_ATTRIBS)
+ if(index >= gl2::MAX_VERTEX_ATTRIBS)
{
return error(GL_INVALID_VALUE);
}
- const gl::VertexAttribute &attribState = context->getVertexAttribState(index);
+ const gl2::VertexAttribute &attribState = context->getVertexAttribState(index);
switch(pname)
{
@@ -3876,11 +3876,11 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- if(index >= gl::MAX_VERTEX_ATTRIBS)
+ if(index >= gl2::MAX_VERTEX_ATTRIBS)
{
return error(GL_INVALID_VALUE);
}
@@ -3915,7 +3915,7 @@
return error(GL_INVALID_ENUM);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
switch(target)
{
case GL_GENERATE_MIPMAP_HINT:
@@ -3940,11 +3940,11 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context && buffer)
{
- gl::Buffer *bufferObject = context->getBuffer(buffer);
+ gl2::Buffer *bufferObject = context->getBuffer(buffer);
if(bufferObject)
{
@@ -3966,7 +3966,7 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -4000,11 +4000,11 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::Fence *fenceObject = context->getFence(fence);
+ gl2::Fence *fenceObject = context->getFence(fence);
if(fenceObject == NULL)
{
@@ -4028,11 +4028,11 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context && framebuffer)
{
- gl::Framebuffer *framebufferObject = context->getFramebuffer(framebuffer);
+ gl2::Framebuffer *framebufferObject = context->getFramebuffer(framebuffer);
if(framebufferObject)
{
@@ -4054,11 +4054,11 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context && program)
{
- gl::Program *programObject = context->getProgram(program);
+ gl2::Program *programObject = context->getProgram(program);
if(programObject)
{
@@ -4085,11 +4085,11 @@
return GL_FALSE;
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::Query *queryObject = context->getQuery(id, false, GL_NONE);
+ gl2::Query *queryObject = context->getQuery(id, false, GL_NONE);
if(queryObject)
{
@@ -4111,11 +4111,11 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context && renderbuffer)
{
- gl::Renderbuffer *renderbufferObject = context->getRenderbuffer(renderbuffer);
+ gl2::Renderbuffer *renderbufferObject = context->getRenderbuffer(renderbuffer);
if(renderbufferObject)
{
@@ -4137,11 +4137,11 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context && shader)
{
- gl::Shader *shaderObject = context->getShader(shader);
+ gl2::Shader *shaderObject = context->getShader(shader);
if(shaderObject)
{
@@ -4163,11 +4163,11 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context && texture)
{
- gl::Texture *textureObject = context->getTexture(texture);
+ gl2::Texture *textureObject = context->getTexture(texture);
if(textureObject)
{
@@ -4194,7 +4194,7 @@
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -4213,11 +4213,11 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::Program *programObject = context->getProgram(program);
+ gl2::Program *programObject = context->getProgram(program);
if(!programObject)
{
@@ -4246,7 +4246,7 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -4287,7 +4287,7 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -4320,7 +4320,7 @@
return error(GL_INVALID_OPERATION);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -4351,7 +4351,7 @@
return error(GL_INVALID_OPERATION);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -4370,7 +4370,7 @@
try
{
- gl::Shader::releaseCompiler();
+ gl2::Shader::releaseCompiler();
}
catch(std::bad_alloc&)
{
@@ -4393,7 +4393,7 @@
return error(GL_INVALID_ENUM);
}
- if(!gl::IsColorRenderable(internalformat) && !gl::IsDepthRenderable(internalformat) && !gl::IsStencilRenderable(internalformat))
+ if(!gl2::IsColorRenderable(internalformat) && !gl2::IsDepthRenderable(internalformat) && !gl2::IsStencilRenderable(internalformat))
{
return error(GL_INVALID_ENUM);
}
@@ -4403,13 +4403,13 @@
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- if(width > gl::IMPLEMENTATION_MAX_RENDERBUFFER_SIZE ||
- height > gl::IMPLEMENTATION_MAX_RENDERBUFFER_SIZE ||
- samples > gl::IMPLEMENTATION_MAX_SAMPLES)
+ if(width > gl2::IMPLEMENTATION_MAX_RENDERBUFFER_SIZE ||
+ height > gl2::IMPLEMENTATION_MAX_RENDERBUFFER_SIZE ||
+ samples > gl2::IMPLEMENTATION_MAX_SAMPLES)
{
return error(GL_INVALID_VALUE);
}
@@ -4423,20 +4423,20 @@
switch(internalformat)
{
case GL_DEPTH_COMPONENT16:
- context->setRenderbufferStorage(new gl::Depthbuffer(width, height, samples));
+ context->setRenderbufferStorage(new gl2::Depthbuffer(width, height, samples));
break;
case GL_RGBA4:
case GL_RGB5_A1:
case GL_RGB565:
case GL_RGB8_OES:
case GL_RGBA8_OES:
- context->setRenderbufferStorage(new gl::Colorbuffer(width, height, internalformat, samples));
+ context->setRenderbufferStorage(new gl2::Colorbuffer(width, height, internalformat, samples));
break;
case GL_STENCIL_INDEX8:
- context->setRenderbufferStorage(new gl::Stencilbuffer(width, height, samples));
+ context->setRenderbufferStorage(new gl2::Stencilbuffer(width, height, samples));
break;
case GL_DEPTH24_STENCIL8_OES:
- context->setRenderbufferStorage(new gl::DepthStencilbuffer(width, height, samples));
+ context->setRenderbufferStorage(new gl2::DepthStencilbuffer(width, height, samples));
break;
default:
return error(GL_INVALID_ENUM);
@@ -4460,11 +4460,11 @@
try
{
- gl::Context* context = gl::getContext();
+ gl2::Context* context = gl2::getContext();
if(context)
{
- context->setSampleCoverageParams(gl::clamp01(value), invert == GL_TRUE);
+ context->setSampleCoverageParams(gl2::clamp01(value), invert == GL_TRUE);
}
}
catch(std::bad_alloc&)
@@ -4484,11 +4484,11 @@
return error(GL_INVALID_ENUM);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::Fence *fenceObject = context->getFence(fence);
+ gl2::Fence *fenceObject = context->getFence(fence);
if(fenceObject == NULL)
{
@@ -4515,7 +4515,7 @@
return error(GL_INVALID_VALUE);
}
- gl::Context* context = gl::getContext();
+ gl2::Context* context = gl2::getContext();
if(context)
{
@@ -4557,11 +4557,11 @@
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::Shader *shaderObject = context->getShader(shader);
+ gl2::Shader *shaderObject = context->getShader(shader);
if(!shaderObject)
{
@@ -4620,7 +4620,7 @@
return error(GL_INVALID_ENUM);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -4662,7 +4662,7 @@
return error(GL_INVALID_ENUM);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -4750,7 +4750,7 @@
return error(GL_INVALID_ENUM);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -4777,11 +4777,11 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::Fence *fenceObject = context->getFence(fence);
+ gl2::Fence *fenceObject = context->getFence(fence);
if(fenceObject == NULL)
{
@@ -4900,15 +4900,15 @@
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
switch(target)
{
case GL_TEXTURE_2D:
- if(width > (gl::IMPLEMENTATION_MAX_TEXTURE_SIZE >> level) ||
- height > (gl::IMPLEMENTATION_MAX_TEXTURE_SIZE >> level))
+ if(width > (gl2::IMPLEMENTATION_MAX_TEXTURE_SIZE >> level) ||
+ height > (gl2::IMPLEMENTATION_MAX_TEXTURE_SIZE >> level))
{
return error(GL_INVALID_VALUE);
}
@@ -4924,8 +4924,8 @@
return error(GL_INVALID_VALUE);
}
- if(width > (gl::IMPLEMENTATION_MAX_CUBE_MAP_TEXTURE_SIZE >> level) ||
- height > (gl::IMPLEMENTATION_MAX_CUBE_MAP_TEXTURE_SIZE >> level))
+ if(width > (gl2::IMPLEMENTATION_MAX_CUBE_MAP_TEXTURE_SIZE >> level) ||
+ height > (gl2::IMPLEMENTATION_MAX_CUBE_MAP_TEXTURE_SIZE >> level))
{
return error(GL_INVALID_VALUE);
}
@@ -4951,7 +4951,7 @@
if(target == GL_TEXTURE_2D)
{
- gl::Texture2D *texture = context->getTexture2D();
+ gl2::Texture2D *texture = context->getTexture2D();
if(!texture)
{
@@ -4962,7 +4962,7 @@
}
else
{
- gl::TextureCubeMap *texture = context->getTextureCubeMap();
+ gl2::TextureCubeMap *texture = context->getTextureCubeMap();
if(!texture)
{
@@ -4985,11 +4985,11 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::Texture *texture;
+ gl2::Texture *texture;
switch(target)
{
@@ -5060,11 +5060,11 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::Texture *texture;
+ gl2::Texture *texture;
switch(target)
{
@@ -5139,7 +5139,7 @@
try
{
- if(!gl::IsTextureTarget(target))
+ if(!gl2::IsTextureTarget(target))
{
return error(GL_INVALID_ENUM);
}
@@ -5154,7 +5154,7 @@
return error(GL_INVALID_VALUE);
}
- if(!gl::CheckTextureFormatType(format, type))
+ if(!gl2::CheckTextureFormatType(format, type))
{
return error(GL_INVALID_ENUM);
}
@@ -5164,27 +5164,27 @@
return;
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- if(level > gl::IMPLEMENTATION_MAX_TEXTURE_LEVELS)
+ if(level > gl2::IMPLEMENTATION_MAX_TEXTURE_LEVELS)
{
return error(GL_INVALID_VALUE);
}
if(target == GL_TEXTURE_2D)
{
- gl::Texture2D *texture = context->getTexture2D();
+ gl2::Texture2D *texture = context->getTexture2D();
if(validateSubImageParams(false, width, height, xoffset, yoffset, target, level, format, texture))
{
texture->subImage(level, xoffset, yoffset, width, height, format, type, context->getUnpackAlignment(), pixels);
}
}
- else if(gl::IsCubemapTextureTarget(target))
+ else if(gl2::IsCubemapTextureTarget(target))
{
- gl::TextureCubeMap *texture = context->getTextureCubeMap();
+ gl2::TextureCubeMap *texture = context->getTextureCubeMap();
if(validateSubImageParams(false, width, height, xoffset, yoffset, target, level, format, texture))
{
@@ -5224,11 +5224,11 @@
return;
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::Program *program = context->getCurrentProgram();
+ gl2::Program *program = context->getCurrentProgram();
if(!program)
{
@@ -5268,11 +5268,11 @@
return;
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::Program *program = context->getCurrentProgram();
+ gl2::Program *program = context->getCurrentProgram();
if(!program)
{
@@ -5314,11 +5314,11 @@
return;
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::Program *program = context->getCurrentProgram();
+ gl2::Program *program = context->getCurrentProgram();
if(!program)
{
@@ -5360,11 +5360,11 @@
return;
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::Program *program = context->getCurrentProgram();
+ gl2::Program *program = context->getCurrentProgram();
if(!program)
{
@@ -5406,11 +5406,11 @@
return;
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::Program *program = context->getCurrentProgram();
+ gl2::Program *program = context->getCurrentProgram();
if(!program)
{
@@ -5452,11 +5452,11 @@
return;
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::Program *program = context->getCurrentProgram();
+ gl2::Program *program = context->getCurrentProgram();
if(!program)
{
@@ -5498,11 +5498,11 @@
return;
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::Program *program = context->getCurrentProgram();
+ gl2::Program *program = context->getCurrentProgram();
if(!program)
{
@@ -5544,11 +5544,11 @@
return;
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::Program *program = context->getCurrentProgram();
+ gl2::Program *program = context->getCurrentProgram();
if(!program)
{
@@ -5584,11 +5584,11 @@
return;
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::Program *program = context->getCurrentProgram();
+ gl2::Program *program = context->getCurrentProgram();
if(!program)
{
@@ -5624,11 +5624,11 @@
return;
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::Program *program = context->getCurrentProgram();
+ gl2::Program *program = context->getCurrentProgram();
if(!program)
{
@@ -5664,11 +5664,11 @@
return;
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::Program *program = context->getCurrentProgram();
+ gl2::Program *program = context->getCurrentProgram();
if(!program)
{
@@ -5693,11 +5693,11 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::Program *programObject = context->getProgram(program);
+ gl2::Program *programObject = context->getProgram(program);
if(!programObject && program != 0)
{
@@ -5731,11 +5731,11 @@
try
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::Program *programObject = context->getProgram(program);
+ gl2::Program *programObject = context->getProgram(program);
if(!programObject)
{
@@ -5764,12 +5764,12 @@
try
{
- if(index >= gl::MAX_VERTEX_ATTRIBS)
+ if(index >= gl2::MAX_VERTEX_ATTRIBS)
{
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -5789,12 +5789,12 @@
try
{
- if(index >= gl::MAX_VERTEX_ATTRIBS)
+ if(index >= gl2::MAX_VERTEX_ATTRIBS)
{
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -5814,12 +5814,12 @@
try
{
- if(index >= gl::MAX_VERTEX_ATTRIBS)
+ if(index >= gl2::MAX_VERTEX_ATTRIBS)
{
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -5839,12 +5839,12 @@
try
{
- if(index >= gl::MAX_VERTEX_ATTRIBS)
+ if(index >= gl2::MAX_VERTEX_ATTRIBS)
{
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -5864,12 +5864,12 @@
try
{
- if(index >= gl::MAX_VERTEX_ATTRIBS)
+ if(index >= gl2::MAX_VERTEX_ATTRIBS)
{
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -5889,12 +5889,12 @@
try
{
- if(index >= gl::MAX_VERTEX_ATTRIBS)
+ if(index >= gl2::MAX_VERTEX_ATTRIBS)
{
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -5914,12 +5914,12 @@
try
{
- if(index >= gl::MAX_VERTEX_ATTRIBS)
+ if(index >= gl2::MAX_VERTEX_ATTRIBS)
{
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -5939,12 +5939,12 @@
try
{
- if(index >= gl::MAX_VERTEX_ATTRIBS)
+ if(index >= gl2::MAX_VERTEX_ATTRIBS)
{
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -5965,7 +5965,7 @@
try
{
- if(index >= gl::MAX_VERTEX_ATTRIBS)
+ if(index >= gl2::MAX_VERTEX_ATTRIBS)
{
return error(GL_INVALID_VALUE);
}
@@ -5993,7 +5993,7 @@
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -6017,7 +6017,7 @@
return error(GL_INVALID_VALUE);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -6059,7 +6059,7 @@
return error(GL_INVALID_OPERATION);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
@@ -6115,18 +6115,18 @@
return error(GL_INVALID_OPERATION);
}
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
- gl::TextureExternal *texture = context->getTextureExternal();
+ gl2::TextureExternal *texture = context->getTextureExternal();
if(!texture)
{
return error(GL_INVALID_OPERATION);
}
- gl::Image *glImage = static_cast<gl::Image*>(image);
+ gl2::Image *glImage = static_cast<gl2::Image*>(image);
texture->setImage(glImage);
}
diff --git a/src/GLES2/libGLESv2/main.cpp b/src/GLES2/libGLESv2/main.cpp
index dfca30a..43f8e38 100644
--- a/src/GLES2/libGLESv2/main.cpp
+++ b/src/GLES2/libGLESv2/main.cpp
@@ -32,7 +32,7 @@
{
TRACE("()");
- gl::Current *current = new gl::Current;
+ gl2::Current *current = new gl2::Current;
if(current)
{
@@ -47,7 +47,7 @@
{
TRACE("()");
- gl::Current *current = (gl::Current*)sw::Thread::getLocalStorage(currentTLS);
+ gl2::Current *current = (gl2::Current*)sw::Thread::getLocalStorage(currentTLS);
if(current)
{
@@ -105,9 +105,9 @@
}
#endif
-namespace gl
+namespace gl2
{
-static gl::Current *getCurrent(void)
+static gl2::Current *getCurrent(void)
{
Current *current = (Current*)sw::Thread::getLocalStorage(currentTLS);
@@ -157,7 +157,7 @@
// Records an error code
void error(GLenum errorCode)
{
- gl::Context *context = gl::getContext();
+ gl2::Context *context = gl2::getContext();
if(context)
{
diff --git a/src/GLES2/libGLESv2/main.h b/src/GLES2/libGLESv2/main.h
index fdb0dc0..ca7672a 100644
--- a/src/GLES2/libGLESv2/main.h
+++ b/src/GLES2/libGLESv2/main.h
@@ -23,7 +23,7 @@
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
-namespace gl
+namespace gl2
{
struct Current
{
diff --git a/src/GLES2/libGLESv2/mathutil.h b/src/GLES2/libGLESv2/mathutil.h
index 9955fb2..1359a1a 100644
--- a/src/GLES2/libGLESv2/mathutil.h
+++ b/src/GLES2/libGLESv2/mathutil.h
@@ -18,7 +18,7 @@
#include <math.h>
-namespace gl
+namespace gl2
{
inline bool isPow2(int x)
{
diff --git a/src/GLES2/libGLESv2/utilities.cpp b/src/GLES2/libGLESv2/utilities.cpp
index ca3b880..98a5518 100644
--- a/src/GLES2/libGLESv2/utilities.cpp
+++ b/src/GLES2/libGLESv2/utilities.cpp
@@ -20,7 +20,7 @@
#include <limits>
#include <stdio.h>
-namespace gl
+namespace gl2
{
int UniformComponentCount(GLenum type)
{
@@ -478,7 +478,7 @@
return sw::STENCIL_ALWAYS;
}
- sw::Color<float> ConvertColor(gl::Color color)
+ sw::Color<float> ConvertColor(gl2::Color color)
{
return sw::Color<float>(color.red, color.green, color.blue, color.alpha);
}
@@ -630,36 +630,36 @@
}
}
- bool ConvertPrimitiveType(GLenum primitiveType, GLsizei elementCount, gl::PrimitiveType &swPrimitiveType, int &primitiveCount)
+ bool ConvertPrimitiveType(GLenum primitiveType, GLsizei elementCount, gl2::PrimitiveType &swPrimitiveType, int &primitiveCount)
{
switch(primitiveType)
{
case GL_POINTS:
- swPrimitiveType = gl::DRAW_POINTLIST;
+ swPrimitiveType = gl2::DRAW_POINTLIST;
primitiveCount = elementCount;
break;
case GL_LINES:
- swPrimitiveType = gl::DRAW_LINELIST;
+ swPrimitiveType = gl2::DRAW_LINELIST;
primitiveCount = elementCount / 2;
break;
case GL_LINE_LOOP:
- swPrimitiveType = gl::DRAW_LINELOOP;
+ swPrimitiveType = gl2::DRAW_LINELOOP;
primitiveCount = elementCount;
break;
case GL_LINE_STRIP:
- swPrimitiveType = gl::DRAW_LINESTRIP;
+ swPrimitiveType = gl2::DRAW_LINESTRIP;
primitiveCount = elementCount - 1;
break;
case GL_TRIANGLES:
- swPrimitiveType = gl::DRAW_TRIANGLELIST;
+ swPrimitiveType = gl2::DRAW_TRIANGLELIST;
primitiveCount = elementCount / 3;
break;
case GL_TRIANGLE_STRIP:
- swPrimitiveType = gl::DRAW_TRIANGLESTRIP;
+ swPrimitiveType = gl2::DRAW_TRIANGLESTRIP;
primitiveCount = elementCount - 2;
break;
case GL_TRIANGLE_FAN:
- swPrimitiveType = gl::DRAW_TRIANGLEFAN;
+ swPrimitiveType = gl2::DRAW_TRIANGLEFAN;
primitiveCount = elementCount - 2;
break;
default:
diff --git a/src/GLES2/libGLESv2/utilities.h b/src/GLES2/libGLESv2/utilities.h
index 8475050..51b0378 100644
--- a/src/GLES2/libGLESv2/utilities.h
+++ b/src/GLES2/libGLESv2/utilities.h
@@ -24,7 +24,7 @@
#include <string>
-namespace gl
+namespace gl2
{
struct Color;
@@ -57,7 +57,7 @@
{
sw::DepthCompareMode ConvertDepthComparison(GLenum comparison);
sw::StencilCompareMode ConvertStencilComparison(GLenum comparison);
- sw::Color<float> ConvertColor(gl::Color color);
+ sw::Color<float> ConvertColor(gl2::Color color);
sw::BlendFactor ConvertBlendFunc(GLenum blend);
sw::BlendOperation ConvertBlendOp(GLenum blendOp);
sw::StencilOperation ConvertStencilOp(GLenum stencilOp);
@@ -66,7 +66,7 @@
unsigned int ConvertColorMask(bool red, bool green, bool blue, bool alpha);
sw::FilterType ConvertMagFilter(GLenum magFilter);
void ConvertMinFilter(GLenum texFilter, sw::FilterType *minFilter, sw::MipmapType *mipFilter, float maxAnisotropy);
- bool ConvertPrimitiveType(GLenum primitiveType, GLsizei elementCount, gl::PrimitiveType &swPrimitiveType, int &primitiveCount);
+ bool ConvertPrimitiveType(GLenum primitiveType, GLsizei elementCount, gl2::PrimitiveType &swPrimitiveType, int &primitiveCount);
sw::Format ConvertRenderbufferFormat(GLenum format);
}