From f8293f235c0398771dea74f57df328f72a8f50b1 Mon Sep 17 00:00:00 2001 From: NishiOwO Date: Wed, 1 Oct 2025 05:55:19 +0000 Subject: [PATCH] add the thing git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@92 b9cfdab3-6d41-4d17-bbe4-086880011989 --- include/Mw/OpenGL.h | 8 ++++++++ src/opengl.c | 12 ++++++++++++ 2 files changed, 20 insertions(+) diff --git a/include/Mw/OpenGL.h b/include/Mw/OpenGL.h index 64270f1..3b5a652 100644 --- a/include/Mw/OpenGL.h +++ b/include/Mw/OpenGL.h @@ -24,6 +24,14 @@ MWDECL MwClass MwOpenGLClass; */ MWDECL void MwOpenGLMakeCurrent(MwWidget handle); +/*! + * %brief Get a procedure from OpenGL + * %param handle Widget + * %param name Name + * %return Procedure + */ +MWDECL void* MwOpenGLGetProcAddress(MwWidget handle, const char* name); + /*! * %brief Swaps the buffer of OpenGL context * %param handle Widget diff --git a/src/opengl.c b/src/opengl.c index b63c3b3..1976bc8 100644 --- a/src/opengl.c +++ b/src/opengl.c @@ -99,3 +99,15 @@ void MwOpenGLSwapBuffer(MwWidget handle) { glXSwapBuffers(handle->lowlevel->display, handle->lowlevel->window); #endif } + +void* MwOpenGLGetProcAddress(MwWidget handle, const char* name) { +#ifdef _WIN32 + (void)handle; + + return wglGetProcAddress(name); +#else + (void)handle; + + return glXGetProcAddress((const GLubyte*)name); +#endif +}