27#ifndef EASY3D_RENDERER_OPENGL_ERROR_H
28#define EASY3D_RENDERER_OPENGL_ERROR_H
32#include <easy3d/util/logging.h>
38#define easy3d_gl_error { \
39 opengl::check_gl_error(__FILE__, __FUNCTION__, __LINE__) ; \
43#define easy3d_frame_buffer_error { \
44 opengl::check_frame_buffer_error(__FILE__, __FUNCTION__, __LINE__) ; \
48#define easy3d_log_gl_error { \
50 LOG_IF(!opengl::gl_error(msg), ERROR) << "GL error: \n" \
51 << "\tfile: " << __FILE__ << "\n" \
52 << "\tline: " << __LINE__ << "\n" \
53 << "\tfunction: " << __FUNCTION__ << "\n" \
54 << "\tinfo: " << msg; \
58#define easy3d_log_frame_buffer_error { \
60 LOG_IF(!opengl::frame_buffer_error(msg), ERROR) << "GL error: \n" \
61 << "\tfile: " << __FILE__ << "\n" \
62 << "\tline: " << __LINE__ << "\n" \
63 << "\tfunction: " << __FUNCTION__ << "\n" \
64 << "\tinfo: " << msg; \
69#define easy3d_debug_gl_error easy3d_gl_error
70#define easy3d_debug_frame_buffer_error easy3d_frame_buffer_error
71#define easy3d_debug_log_gl_error easy3d_log_gl_error
72#define easy3d_debug_log_frame_buffer_error easy3d_log_frame_buffer_error
74#define easy3d_debug_gl_error
75#define easy3d_debug_frame_buffer_error
76#define easy3d_debug_log_gl_error
77#define easy3d_debug_log_frame_buffer_error
92 bool check_gl_error(
const std::string& file,
const std::string& function,
int line, std::ostream& os = std::cerr);
OpenGL-related functionalities for reading pixel/depth data from the framebuffer.
Definition opengl_error.cpp:35
bool gl_error(std::string &msg)
Checks if there was an OpenGL error. If there was an error, the error message will be stored in "msg"...
bool check_frame_buffer_error(const std::string &file, const std::string &function, int line, std::ostream &os=std::cerr)
Checks the last framebuffer error.
bool check_gl_error(const std::string &file, const std::string &function, int line, std::ostream &os=std::cerr)
Checks the last OpenGL error.
bool frame_buffer_error(std::string &msg)
Checks if there was a framebuffer error. If there was an error, the error message will be stored in "...
void setup_gl_debug_callback()
Set up a debug callback for OpenGL.
Definition collider.cpp:182