Skip to content

Commit

Permalink
updated RGFW
Browse files Browse the repository at this point in the history
  • Loading branch information
ColleagueRiley committed Jul 19, 2023
1 parent d372910 commit 77f7a57
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions include/deps/RGFW.h
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,9 @@ unsigned short RGFW_registerJoystickF(RGFW_window* win, char* file);

unsigned char RGFW_isPressedJS(RGFW_window* win, unsigned short controller, unsigned char button);

/*! Get max OpenGL version */
unsigned char* RGFW_getMaxGLVersion();

/*! Set OpenGL version hint */
void RGFW_setGLVersion(int major, int minor);

Expand Down Expand Up @@ -609,6 +612,22 @@ void RGFW_setGLVersion(int major, int minor) {
RGFW_minorVersion = minor;
}

#include <GL/gl.h>

unsigned char* RGFW_getMaxGLVersion() {
RGFW_window* dummy = RGFW_createWindowPointer("dummy", 0, 0, 1, 1, 0);

const char* versionStr = glGetString(GL_VERSION);

static unsigned char version[2];
version[0] = versionStr[0] - '0',
version[1] = versionStr[2] - '0';

RGFW_window_close(dummy);

return version;
}

#ifdef RGFW_EGL

#if defined(RGFW_LINK_EGL)
Expand Down

0 comments on commit 77f7a57

Please sign in to comment.