mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 21:56:26 +02:00
Removing a 'using namespace' from a header and tweaking error checking code
This commit is contained in:
parent
db56e15410
commit
dfea571e62
5 changed files with 20 additions and 9 deletions
|
@ -12,6 +12,8 @@
|
||||||
#include "GLBackendShared.h"
|
#include "GLBackendShared.h"
|
||||||
#include <glm/gtc/type_ptr.hpp>
|
#include <glm/gtc/type_ptr.hpp>
|
||||||
|
|
||||||
|
using namespace gpu;
|
||||||
|
|
||||||
GLBackend::CommandCall GLBackend::_commandCalls[Batch::NUM_COMMANDS] =
|
GLBackend::CommandCall GLBackend::_commandCalls[Batch::NUM_COMMANDS] =
|
||||||
{
|
{
|
||||||
(&::gpu::GLBackend::do_draw),
|
(&::gpu::GLBackend::do_draw),
|
||||||
|
@ -141,6 +143,14 @@ bool GLBackend::checkGLError(const char* name) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool GLBackend::checkGLErrorDebug(const char* name) {
|
||||||
|
#ifdef DEBUG
|
||||||
|
checkGLError(name);
|
||||||
|
#else
|
||||||
|
Q_UNUSED(name);
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void GLBackend::syncCache() {
|
void GLBackend::syncCache() {
|
||||||
syncTransformStateCache();
|
syncTransformStateCache();
|
||||||
|
|
|
@ -47,6 +47,9 @@ public:
|
||||||
|
|
||||||
static bool checkGLError(const char* name = nullptr);
|
static bool checkGLError(const char* name = nullptr);
|
||||||
|
|
||||||
|
// Only checks in debug builds
|
||||||
|
static bool checkGLErrorDebug(const char* name = nullptr);
|
||||||
|
|
||||||
static bool makeProgram(Shader& shader, const Shader::BindingSet& bindings = Shader::BindingSet());
|
static bool makeProgram(Shader& shader, const Shader::BindingSet& bindings = Shader::BindingSet());
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#include "GPULogging.h"
|
#include "GPULogging.h"
|
||||||
#include "GLBackendShared.h"
|
#include "GLBackendShared.h"
|
||||||
|
|
||||||
|
using namespace gpu;
|
||||||
|
|
||||||
GLBackend::GLFramebuffer::GLFramebuffer() {}
|
GLBackend::GLFramebuffer::GLFramebuffer() {}
|
||||||
|
|
||||||
|
|
|
@ -17,9 +17,7 @@
|
||||||
|
|
||||||
#include "Batch.h"
|
#include "Batch.h"
|
||||||
|
|
||||||
using namespace gpu;
|
static const GLenum _primitiveToGLmode[gpu::NUM_PRIMITIVES] = {
|
||||||
|
|
||||||
static const GLenum _primitiveToGLmode[NUM_PRIMITIVES] = {
|
|
||||||
GL_POINTS,
|
GL_POINTS,
|
||||||
GL_LINES,
|
GL_LINES,
|
||||||
GL_LINE_STRIP,
|
GL_LINE_STRIP,
|
||||||
|
@ -30,7 +28,7 @@ static const GLenum _primitiveToGLmode[NUM_PRIMITIVES] = {
|
||||||
GL_QUAD_STRIP,
|
GL_QUAD_STRIP,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const GLenum _elementTypeToGLType[NUM_TYPES]= {
|
static const GLenum _elementTypeToGLType[gpu::NUM_TYPES] = {
|
||||||
GL_FLOAT,
|
GL_FLOAT,
|
||||||
GL_INT,
|
GL_INT,
|
||||||
GL_UNSIGNED_INT,
|
GL_UNSIGNED_INT,
|
||||||
|
@ -49,10 +47,8 @@ static const GLenum _elementTypeToGLType[NUM_TYPES]= {
|
||||||
GL_UNSIGNED_BYTE
|
GL_UNSIGNED_BYTE
|
||||||
};
|
};
|
||||||
|
|
||||||
#if _DEBUG
|
// Stupid preprocessor trick to turn the line macro into a string
|
||||||
#define CHECK_GL_ERROR() ::gpu::GLBackend::checkGLError(__FUNCTION__)
|
#define CHECK_GL_ERROR_HELPER(x) #x
|
||||||
#else
|
#define CHECK_GL_ERROR() gpu::GLBackend::checkGLErrorDebug(__FUNCTION__ ":" CHECK_GL_ERROR_HELPER(__LINE__))
|
||||||
#define CHECK_GL_ERROR() false
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#include "GPULogging.h"
|
#include "GPULogging.h"
|
||||||
#include "GLBackendShared.h"
|
#include "GLBackendShared.h"
|
||||||
|
|
||||||
|
using namespace gpu;
|
||||||
|
|
||||||
GLBackend::GLTexture::GLTexture() :
|
GLBackend::GLTexture::GLTexture() :
|
||||||
_storageStamp(0),
|
_storageStamp(0),
|
||||||
|
|
Loading…
Reference in a new issue