static void opengl_debug_callback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* msg, const void *data)
{
// Don't print out gl Errors we generated.
static void opengl_debug_callback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* msg, const void *data)
{
// Don't print out gl Errors we generated.
// Spams this message on fglrx, disabling for now because it's damn annoying.
// ERROR: opengl_debug_callback (screen.cpp:21) - OpenGL Error (1011): glObjectLabel failed because (depending on the operation) a referenced binding point is empty; a referenced name is not the name of an object; or the given name is otherwise not valid to this operation (GL_INVALID_VALUE)
}
// Spams this message on fglrx, disabling for now because it's damn annoying.
// ERROR: opengl_debug_callback (screen.cpp:21) - OpenGL Error (1011): glObjectLabel failed because (depending on the operation) a referenced binding point is empty; a referenced name is not the name of an object; or the given name is otherwise not valid to this operation (GL_INVALID_VALUE)
}
m_window = SDL_CreateWindow("IPDF", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
m_window = SDL_CreateWindow("IPDF", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
// Why is this so horribly broken?
if (ogl_IsVersionGEQ(3,0))
{
// Why is this so horribly broken?
if (ogl_IsVersionGEQ(3,0))
{
- Fatal("We require OpenGL 3.1, but you have version %d.%d!",ogl_GetMajorVersion(), ogl_GetMinorVersion());
+ Error("We require OpenGL 3.1, but you have version %d.%d!",ogl_GetMajorVersion(), ogl_GetMinorVersion());
glGenQueries(1, &m_frame_gpu_timer);
glBeginQuery(GL_TIME_ELAPSED, m_frame_gpu_timer);
glGenQueries(1, &m_frame_gpu_timer);
glBeginQuery(GL_TIME_ELAPSED, m_frame_gpu_timer);
void Screen::Clear(float r, float g, float b, float a)
{
void Screen::Clear(float r, float g, float b, float a)
{
if (access(filename, R_OK) == -1)
{
Error("No such file \"%s\" - Nothing to render - You might have done this deliberately?", filename);
if (access(filename, R_OK) == -1)
{
Error("No such file \"%s\" - Nothing to render - You might have done this deliberately?", filename);
unsigned char font_atlas_data[1024*1024];
FILE *font_file = fopen(name, "rb");
fseek(font_file, 0, SEEK_END);
unsigned char font_atlas_data[1024*1024];
FILE *font_file = fopen(name, "rb");
fseek(font_file, 0, SEEK_END);
glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 40, -1, "Screen::DebugFontFlush()");
glEnable(GL_BLEND);
glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 40, -1, "Screen::DebugFontFlush()");
glEnable(GL_BLEND);
if (!m_debug_font_atlas || !m_show_debug_font) return;
glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 41, -1, "Screen::DebugFontPrint()");
if (!m_debug_font_atlas || !m_show_debug_font) return;
glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 41, -1, "Screen::DebugFontPrint()");