do not call GL functions if GL not initialized

This commit is contained in:
Zeno Rogue committed 2026-09-17 09:36:43 +02:00
1 parent 7e2255844a
commit 71f31f1072
4 files changed
+21 -8

No files matched your search

+2
View File
@@ -55,6 +55,7 @@ EX }
// Copyright (C) 2011-2018 Zeno Rogue, see 'hyper.cpp' for details
EX void glError(const char* GLcall, const char* file, const int line) {
if(!vid.usingGL) return;
GLenum errCode = glGetError();
if(errCode!=GL_NO_ERROR)
rate_limited_error(hr::format("OPENGL ERROR #%i: in file %s on line %i :: %s",errCode,file, line, GLcall));
@@ -72,6 +73,7 @@ struct glwrap {
#endif
void glwrap::act(const char *when) {
if(!vid.usingGL) return;
GLenum errCode = glGetError();
if(errCode!=GL_NO_ERROR)
rate_limited_error(hr::format("GL error %i %s: %s:%i", errCode, when, msg, line));