[Feat] (MG_Impl): add macOS CGL and NSOpenGL frontends

This commit is contained in:
2026-06-28 20:33:14 +08:00
parent d61a0b6904
commit f121aeb57f
12 changed files with 1406 additions and 21 deletions
+33
View File
@@ -7,6 +7,13 @@
// End of Source File Header
#include "GetProcAddress.h"
#if defined(__APPLE__)
#ifndef GL_SILENCE_DEPRECATION
#define GL_SILENCE_DEPRECATION
#endif
#include <OpenGL/OpenGL.h>
#endif
#define GETPROC(name, var) \
if (strcmp(#name, var) == 0) { \
return (void*)name; \
@@ -60,6 +67,32 @@ namespace MobileGL::MG_Impl {
GETPROC(eglCreatePlatformPixmapSurface, name);
GETPROC(eglWaitSync, name);
#if defined(__APPLE__)
GETPROC(CGLChoosePixelFormat, name);
GETPROC(CGLDestroyPixelFormat, name);
GETPROC(CGLDescribePixelFormat, name);
GETPROC(CGLReleasePixelFormat, name);
GETPROC(CGLRetainPixelFormat, name);
GETPROC(CGLGetPixelFormatRetainCount, name);
GETPROC(CGLCreateContext, name);
GETPROC(CGLDestroyContext, name);
GETPROC(CGLRetainContext, name);
GETPROC(CGLReleaseContext, name);
GETPROC(CGLGetContextRetainCount, name);
GETPROC(CGLGetPixelFormat, name);
GETPROC(CGLSetCurrentContext, name);
GETPROC(CGLGetCurrentContext, name);
GETPROC(CGLSetParameter, name);
GETPROC(CGLGetParameter, name);
GETPROC(CGLUpdateContext, name);
GETPROC(CGLClearDrawable, name);
GETPROC(CGLFlushDrawable, name);
GETPROC(CGLLockContext, name);
GETPROC(CGLUnlockContext, name);
GETPROC(CGLGetVersion, name);
GETPROC(CGLErrorString, name);
#endif
GETPROC(glCullFace, name);
GETPROC(glFrontFace, name);
GETPROC(glHint, name);