Skip to content

Commit 96f6f39

Browse files
Merge pull request #422 from Hedgehogsoft/main
add RGFW_glForwardCompatibility
2 parents cce0511 + ff9600e commit 96f6f39

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

RGFW.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ typedef RGFW_ENUM(u8, RGFW_keymod) {
621621
/*! @brief codes for the event types that can be sent */
622622
typedef RGFW_ENUM(u8, RGFW_eventType) {
623623
RGFW_eventNone = 0, /*!< no event has been sent */
624-
RGFW_keyPressed, /* a key has been pressed */
624+
RGFW_keyPressed, /*!< a key has been pressed */
625625
RGFW_keyReleased, /*!< a key has been released */
626626
/*! key event note
627627
the code of the key pressed is stored in
@@ -946,6 +946,7 @@ typedef RGFW_ENUM(i32, RGFW_glReleaseBehavior) {
946946
/*! values for the profile hint */
947947
typedef RGFW_ENUM(i32, RGFW_glProfile) {
948948
RGFW_glCore = 0, /*!< the core OpenGL version, e.g. just support for that version */
949+
RGFW_glForwardCompatibility, /*!< allow compatibility for older versions of OpenGL as well as the requested version */
949950
RGFW_glCompatibility, /*!< allow compatibility for older versions of OpenGL as well as the requested version */
950951
RGFW_glES /*!< use OpenGL ES */
951952
};
@@ -4531,8 +4532,11 @@ RGFW_bool RGFW_window_createContextPtr_EGL(RGFW_window* win, RGFW_eglContext* ct
45314532
RGFW_attribStack_pushAttribs(&stack, EGL_CONTEXT_OPENGL_PROFILE_MASK, EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT);
45324533
} else if (hints->profile == RGFW_glCompatibility) {
45334534
RGFW_attribStack_pushAttribs(&stack, EGL_CONTEXT_OPENGL_PROFILE_MASK, EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT);
4535+
} else if (hints->profile == RGFW_glForwardCompatibility) {
4536+
RGFW_attribStack_pushAttribs(&stack, EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE, EGL_TRUE);
45344537
}
45354538

4539+
45364540
RGFW_attribStack_pushAttribs(&stack, EGL_CONTEXT_OPENGL_ROBUST_ACCESS, hints->robustness);
45374541
RGFW_attribStack_pushAttribs(&stack, EGL_CONTEXT_OPENGL_DEBUG, hints->debug);
45384542

@@ -7105,6 +7109,7 @@ RGFW_bool RGFW_FUNC(RGFW_window_createContextPtr_OpenGL) (RGFW_window* win, RGFW
71057109
i32 mask = 0;
71067110
switch (hints->profile) {
71077111
case RGFW_glES: mask |= GLX_CONTEXT_ES_PROFILE_BIT_EXT; break;
7112+
case RGFW_glForwardCompatibility: mask |= GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB; break;
71087113
case RGFW_glCompatibility: mask |= GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB; break;
71097114
case RGFW_glCore: mask |= GLX_CONTEXT_CORE_PROFILE_BIT_ARB; break;
71107115
default: mask |= GLX_CONTEXT_CORE_PROFILE_BIT_ARB; break;
@@ -10545,6 +10550,7 @@ void RGFW_win32_loadOpenGLFuncs(HWND dummyWin) {
1054510550
#define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126
1054610551
#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001
1054710552
#define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002
10553+
#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002
1054810554
#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091
1054910555
#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092
1055010556
#define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9
@@ -10638,6 +10644,7 @@ RGFW_bool RGFW_window_createContextPtr_OpenGL(RGFW_window* win, RGFW_glContext*
1063810644
switch (hints->profile) {
1063910645
case RGFW_glES: mask |= WGL_CONTEXT_ES_PROFILE_BIT_EXT; break;
1064010646
case RGFW_glCompatibility: mask |= WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB; break;
10647+
case RGFW_glForwardCompatibility: mask |= WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB; break;
1064110648
case RGFW_glCore: mask |= WGL_CONTEXT_CORE_PROFILE_BIT_ARB; break;
1064210649
default: mask |= WGL_CONTEXT_CORE_PROFILE_BIT_ARB; break;
1064310650
}

0 commit comments

Comments
 (0)