Commit f9b76a8b by Nicolas Capens Committed by Nicolas Capens

Rename the GLES2 namespace to gl2.

BUG=18110152 Change-Id: Ia1ec422b26b7f8d5edf856d3b625a0e9ebd5d31b Reviewed-on: https://swiftshader-review.googlesource.com/1250Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Tested-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent 16ea3c87
......@@ -16,7 +16,7 @@
#include <stdio.h>
#include <stdarg.h>
namespace gl
namespace gl2
{
static void output(const char *format, va_list vararg)
{
......
......@@ -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 @@ namespace gl
#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
......
......@@ -99,7 +99,7 @@ namespace sh
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 @@ namespace sh
{
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 @@ namespace sh
}
}
activeVaryings.push_back(gl::Varying(glVariableType(type), name, varying->getArraySize(), reg, 0));
activeVaryings.push_back(gl2::Varying(glVariableType(type), name, varying->getArraySize(), reg, 0));
}
}
......
......@@ -24,7 +24,7 @@
#include <set>
#include <map>
namespace gl
namespace gl2
{
class Shader;
}
......@@ -81,7 +81,7 @@ namespace sh
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 @@ namespace sh
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;
......
......@@ -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)
{
}
......
......@@ -17,7 +17,7 @@
#include "Shader/PixelShader.hpp"
#include "Shader/VertexShader.hpp"
namespace gl
namespace gl2
{
class Shader;
}
......@@ -25,13 +25,13 @@ namespace gl
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_
......@@ -387,7 +387,7 @@ EGLContext Display::createContext(EGLConfig configHandle, const egl::Context *sh
{
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;
......
......@@ -131,7 +131,7 @@ bool Surface::reset(int backBufferWidth, int backBufferHeight)
if(mWindow)
{
frameBuffer = gl::createFrameBuffer(mDisplay->getNativeDisplay(), mWindow, backBufferWidth, backBufferHeight);
frameBuffer = gl2::createFrameBuffer(mDisplay->getNativeDisplay(), mWindow, backBufferWidth, backBufferHeight);
if(!frameBuffer)
{
......@@ -141,7 +141,7 @@ bool Surface::reset(int backBufferWidth, int backBufferHeight)
}
}
backBuffer = gl::createBackBuffer(backBufferWidth, backBufferHeight, mConfig);
backBuffer = gl2::createBackBuffer(backBufferWidth, backBufferHeight, mConfig);
if(!backBuffer)
{
......@@ -152,7 +152,7 @@ bool Surface::reset(int backBufferWidth, int backBufferHeight)
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 @@ bool Surface::checkForResize()
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;
......
......@@ -868,7 +868,7 @@ EGLBoolean EGLAPIENTRY eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurfac
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 @@ __eglMustCastToProperFunctionPointerType EGLAPIENTRY eglGetProcAddress(const cha
}
}
return gl::getProcAddress(procname);
return gl2::getProcAddress(procname);
}
catch(std::bad_alloc&)
{
......
......@@ -89,12 +89,12 @@ CONSTRUCTOR static bool eglAttachProcess()
#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 @@ void error(EGLint errorCode)
}
}
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;
......
......@@ -83,7 +83,7 @@ namespace sw
}
// 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);
......
......@@ -19,7 +19,7 @@
#include "VertexDataManager.h"
#include "IndexDataManager.h"
namespace gl
namespace gl2
{
Buffer::Buffer(GLuint id) : RefCountObject(id)
......
......@@ -25,7 +25,7 @@
#include <cstddef>
#include <vector>
namespace gl
namespace gl2
{
class Buffer : public RefCountObject
{
......
......@@ -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 @@ Context::~Context()
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::blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1
void Context::bindTexImage(egl::Surface *surface)
{
gl::Texture2D *textureObject = getTexture2D();
gl2::Texture2D *textureObject = getTexture2D();
if(textureObject)
{
......@@ -3053,14 +3053,14 @@ EGLenum Context::validateSharedImage(EGLenum target, GLuint name, GLuint texture
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 @@ EGLenum Context::validateSharedImage(EGLenum target, GLuint name, GLuint texture
}
else if(target == EGL_GL_RENDERBUFFER_KHR)
{
gl::Renderbuffer *renderbuffer = getRenderbuffer(name);
gl2::Renderbuffer *renderbuffer = getRenderbuffer(name);
if(!renderbuffer)
{
......@@ -3118,13 +3118,13 @@ egl::Image *Context::createSharedImage(EGLenum target, GLuint name, GLuint textu
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 @@ Device *Context::getDevice()
if(!device)
{
sw::Context *context = new sw::Context();
device = new gl::Device(context);
device = new gl2::Device(context);
}
return device;
......@@ -3149,13 +3149,13 @@ Device *Context::getDevice()
// 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);
}
}
......@@ -38,7 +38,7 @@ class Surface;
class Config;
}
namespace gl
namespace gl2
{
struct TranslatedAttribute;
struct TranslatedIndexData;
......
......@@ -27,7 +27,7 @@
bool localShaderConstants = false;
namespace gl
namespace gl2
{
using namespace sw;
......
......@@ -19,7 +19,7 @@ namespace egl
class Image;
}
namespace gl
namespace gl2
{
class Texture;
class Image;
......
......@@ -16,7 +16,7 @@
#include "main.h"
#include "Common/Thread.hpp"
namespace gl
namespace gl2
{
Fence::Fence()
......
......@@ -17,7 +17,7 @@
#define GL_APICALL
#include <GLES2/gl2.h>
namespace gl
namespace gl2
{
class Fence
......
......@@ -19,7 +19,7 @@
#include "Texture.h"
#include "utilities.h"
namespace gl
namespace gl2
{
Framebuffer::Framebuffer()
......@@ -245,7 +245,7 @@ GLenum Framebuffer::completeness(int &width, int &height, int &samples)
if(mColorbufferType == GL_RENDERBUFFER)
{
if(!gl::IsColorRenderable(colorbuffer->getFormat()))
if(!gl2::IsColorRenderable(colorbuffer->getFormat()))
{
return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
}
......@@ -262,7 +262,7 @@ GLenum Framebuffer::completeness(int &width, int &height, int &samples)
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 @@ GLenum Framebuffer::completeness(int &width, int &height, int &samples)
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 @@ GLenum Framebuffer::completeness(int &width, int &height, int &samples)
if(mStencilbufferType == GL_RENDERBUFFER)
{
if(!gl::IsStencilRenderable(stencilbuffer->getFormat()))
if(!gl2::IsStencilRenderable(stencilbuffer->getFormat()))
{
return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
}
......@@ -356,7 +356,7 @@ GLenum Framebuffer::completeness(int &width, int &height, int &samples)
{
GLenum internalformat = stencilbuffer->getFormat();
if(!gl::IsStencilTexture(internalformat))
if(!gl2::IsStencilTexture(internalformat))
{
return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
}
......
......@@ -21,7 +21,7 @@
#define GL_APICALL
#include <GLES2/gl2.h>
namespace gl
namespace gl2
{
class Renderbuffer;
class Colorbuffer;
......
......@@ -16,7 +16,7 @@
#include "main.h"
namespace gl
namespace gl2
{
HandleAllocator::HandleAllocator() : mBaseValue(1), mNextValue(1)
......
......@@ -20,7 +20,7 @@
#include <vector>
namespace gl
namespace gl2
{
class HandleAllocator
......
......@@ -18,7 +18,7 @@
#include <GLES2/gl2ext.h>
namespace gl
namespace gl2
{
static sw::Resource *getParentResource(Texture *texture)
{
......
......@@ -18,7 +18,7 @@
#define GL_APICALL
#include <GLES2/gl2.h>
namespace gl
namespace gl2
{
class Texture;
......
......@@ -25,7 +25,7 @@ namespace
enum { INITIAL_INDEX_BUFFER_SIZE = 4096 * sizeof(GLuint) };
}
namespace gl
namespace gl2
{
IndexDataManager::IndexDataManager()
......
......@@ -20,7 +20,7 @@
#define GL_APICALL
#include <GLES2/gl2.h>
namespace gl
namespace gl2
{
struct TranslatedIndexData
......
......@@ -24,7 +24,7 @@
#include <string>
#include <stdlib.h>
namespace gl
namespace gl2
{
unsigned int Program::currentSerial = 1;
......
......@@ -24,7 +24,7 @@
#include <vector>
#include <set>
namespace gl
namespace gl2
{
class Device;
class ResourceManager;
......@@ -163,7 +163,7 @@ namespace gl
static unsigned int issueSerial();
private:
gl::Device *device;
gl2::Device *device;
FragmentShader *fragmentShader;
VertexShader *vertexShader;
......
......@@ -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)
......
......@@ -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
......
......@@ -18,7 +18,7 @@
#include "Common/Thread.hpp"
namespace gl
namespace gl2
{
RefCountObject::RefCountObject(GLuint id)
......
......@@ -24,7 +24,7 @@
#include <cstddef>
namespace gl
namespace gl2
{
class RefCountObject
......
......@@ -19,7 +19,7 @@
#include "Texture.h"
#include "utilities.h"
namespace gl
namespace gl2
{
RenderbufferInterface::RenderbufferInterface()
{
......
......@@ -23,7 +23,7 @@
#define GL_APICALL
#include <GLES2/gl2.h>
namespace gl
namespace gl2
{
class Texture2D;
class TextureCubeMap;
......
......@@ -20,7 +20,7 @@
#include "Shader.h"
#include "Texture.h"
namespace gl
namespace gl2
{
ResourceManager::ResourceManager()
{
......
......@@ -22,7 +22,7 @@
#include <map>
namespace gl
namespace gl2
{
class Buffer;
class Shader;
......
......@@ -22,7 +22,7 @@
#include <string>
namespace gl
namespace gl2
{
Shader::Shader(ResourceManager *manager, GLuint handle) : mHandle(handle), mResourceManager(manager)
{
......
......@@ -32,7 +32,7 @@ namespace sh
class OutputASM;
}
namespace gl
namespace gl2
{
struct Varying
{
......@@ -46,7 +46,7 @@ struct Varying
return arraySize >= 1;
}
int size() const // Unify with gl::Uniform?
int size() const // Unify with gl2::Uniform?
{
return arraySize > 0 ? arraySize : 1;
}
......
......@@ -25,7 +25,7 @@
#include <algorithm>
namespace gl
namespace gl2
{
Texture::Texture(GLuint id) : RefCountObject(id)
......@@ -1156,17 +1156,17 @@ void TextureExternal::setImage(Image *sharedImage)
// 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 @@ extern "C"
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)
{
......
......@@ -33,7 +33,7 @@ class Surface;
class Config;
}
namespace gl
namespace gl2
{
class Framebuffer;
......
......@@ -24,7 +24,7 @@ namespace
enum {INITIAL_STREAM_BUFFER_SIZE = 1024 * 1024};
}
namespace gl
namespace gl2
{
VertexDataManager::VertexDataManager(Context *context) : mContext(context)
......
......@@ -21,7 +21,7 @@
#define GL_APICALL
#include <GLES2/gl2.h>
namespace gl
namespace gl2
{
struct TranslatedAttribute
......
......@@ -32,7 +32,7 @@ static void glAttachThread()
{
TRACE("()");
gl::Current *current = new gl::Current;
gl2::Current *current = new gl2::Current;
if(current)
{
......@@ -47,7 +47,7 @@ static void glDetachThread()
{
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 @@ extern "C" BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved
}
#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 @@ Device *getDevice()
// Records an error code
void error(GLenum errorCode)
{
gl::Context *context = gl::getContext();
gl2::Context *context = gl2::getContext();
if(context)
{
......
......@@ -23,7 +23,7 @@
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
namespace gl
namespace gl2
{
struct Current
{
......
......@@ -18,7 +18,7 @@
#include <math.h>
namespace gl
namespace gl2
{
inline bool isPow2(int x)
{
......
......@@ -20,7 +20,7 @@
#include <limits>
#include <stdio.h>
namespace gl
namespace gl2
{
int UniformComponentCount(GLenum type)
{
......@@ -478,7 +478,7 @@ namespace es2sw
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 @@ namespace es2sw
}
}
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:
......
......@@ -24,7 +24,7 @@
#include <string>
namespace gl
namespace gl2
{
struct Color;
......@@ -57,7 +57,7 @@ namespace es2sw
{
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 @@ namespace es2sw
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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment