Very small OpenGL wrapper (before moggle was there)
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.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

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
}
}