ErrorsGles.h#
↰ Parent directory (OpenGLES
)
Convenience functions for automatically logging OpenGL ES errors. Some functions NOP on release builds.
Includes#
PVRUtils/OpenGLES/BindingsGles.h
Included By#
Namespaces#
Classes#
Functions#
Defines#
Source Code#
#pragma once
#if SC_ENABLED
#include "PVRUtils/OpenGLSC/BindingsGlsc.h"
#else
#include "PVRUtils/OpenGLES/BindingsGles.h"
#endif
namespace pvr {
namespace utils {
const char* getGlErrorString(GLuint apiError);
} // namespace utils
class GlError : public PvrError
{
public:
GlError(GLuint errorCode) : PvrError(std::string("OpenGL ES Error occured: [") + utils::getGlErrorString(errorCode) + "]") {}
GlError(GLuint errorCode, const std::string& message) : PvrError(std::string("OpenGL ES Error occured: [") + utils::getGlErrorString(errorCode) + "] -- " + message) {}
GlError(GLuint errorCode, const char* message)
: PvrError(message ? std::string("OpenGL ES Error occured: [") + utils::getGlErrorString(errorCode) + "] -- " + message
: std::string("OpenGL ES Error occured: [") + utils::getGlErrorString(errorCode) + "]")
{}
};
class GlExtensionNotSupportedError : public PvrError
{
public:
GlExtensionNotSupportedError(const std::string& extensionString) : PvrError("Error: Required extension not supported [" + extensionString + "]") {}
GlExtensionNotSupportedError(const std::string& extensionString, const std::string& message)
: PvrError("Error: Required extension not supported [" + extensionString + "] -- " + message)
{}
};
namespace utils {
int checkApiError(std::string* errOutStr = NULL);
void throwOnGlError(const char* note);
} // namespace utils
} // namespace pvr
#ifdef DEBUG
#define debugThrowOnApiError(note) ::pvr::utils::throwOnGlError(note)
#else
#define debugThrowOnApiError(dummy)
#endif