1#ifndef NNGN_GRAPHICS_OPENGL_UTILS_H
2#define NNGN_GRAPHICS_OPENGL_UTILS_H
24#define LOG_RESULT(f, ...) (f(__VA_ARGS__), nngn::gl_check_result(#f))
25#define CHECK_RESULT(f, ...) \
26 do { f(__VA_ARGS__); if(!nngn::gl_check_result(#f)) return false; } while(0)
39#ifdef GL_EXT_debug_marker
41 static_cast<GLsizei
>(
s.size()),
s.data());
48#ifdef GL_EXT_debug_marker
49 glPopGroupMarkerEXT();
62 const auto err = glGetError();
63 if(err == GL_NO_ERROR)
70 [[maybe_unused]] GLenum type, [[maybe_unused]] GLuint obj,
71 [[maybe_unused]] std::string_view
name
75 type, obj,
static_cast<GLsizei
>(
name.size()),
name.data());
name
Definition cathedral.lua:11
static std::ostream & l()
Definition log.cpp:56
bool gl_set_obj_name(GLenum type, GLuint obj, std::string_view name)
Definition utils.h:69
const char * gl_enum_str(GLenum e)
const char * gl_strerror(GLenum error)
Definition utils.cpp:8
bool gl_check_result(const char *func_name)
Definition utils.h:54
#define LOG_RESULT(f,...)
Definition opencl.cpp:264
#define CHECK_RESULT(f,...)
Definition opencl.cpp:265
constexpr GLenum NNGN_GL_BUFFER
Definition utils.h:18
constexpr GLenum NNGN_GL_VERTEX_ARRAY
Definition utils.h:21
constexpr GLenum NNGN_GL_SHADER
Definition utils.h:20
constexpr GLenum NNGN_GL_PROGRAM
Definition utils.h:19
#define NNGN_MOVE_ONLY(x)
Definition utils.h:39
local error
Definition strict.lua:2
RAII-based debug group manager.
Definition utils.h:36
~GLDebugGroup(void)
Definition utils.h:47
local e
Definition math.lua:4
std::chrono::seconds s
Definition timing.cpp:6