You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
726 B
30 lines
726 B
//
|
|
// basic.cpp
|
|
// J
|
|
//
|
|
// Created by Joshua Moerman on 8/28/11.
|
|
// Copyright 2011 Vadovas. All rights reserved.
|
|
//
|
|
|
|
#include "basic.h"
|
|
|
|
namespace J {
|
|
void check_error(){
|
|
#if defined(DEBUG)
|
|
GLenum status = glGetError();
|
|
switch (status) {
|
|
case GL_NO_ERROR:
|
|
return;
|
|
#define c(x) case x: throw std::runtime_error("GL Error: "#x);
|
|
c(GL_INVALID_ENUM)
|
|
c(GL_INVALID_VALUE)
|
|
c(GL_INVALID_OPERATION)
|
|
c(GL_INVALID_FRAMEBUFFER_OPERATION)
|
|
c(GL_OUT_OF_MEMORY)
|
|
#undef c
|
|
default:
|
|
throw std::runtime_error("GL Error: UNKNOWN");
|
|
}
|
|
#endif
|
|
}
|
|
}
|