Support iOS for ogs-blue (#7)
This commit was merged in pull request #7.
This commit is contained in:
1 parent
37c4e6f442
commit
2b556a4a58
58 files changed
+710
-300
No files matched your search
@@ -0,0 +1,41 @@
|
||||
#ifndef RAYBRI_AUX_H
|
||||
#define RAYBRI_AUX_H
|
||||
|
||||
// Header
|
||||
|
||||
void *raybriGLLoader(const char *name);
|
||||
void raybriLoadExtensions(void);
|
||||
|
||||
// Source
|
||||
|
||||
#if defined(RAYBRI_AUX_IMPLEMENTATION)
|
||||
|
||||
#include <dlfcn.h>
|
||||
#include "raybriConst.h"
|
||||
#include "rlgl.h"
|
||||
#include <stddef.h>
|
||||
|
||||
// raylib is built as a static/dynamic library with GLFW baked in, but we never
|
||||
// call InitWindow(). Instead we render into an OpenGL context owned by the
|
||||
// macOS app, so we must supply the OpenGL entry point loader ourselves.
|
||||
void *raybriGLLoader(const char *name) {
|
||||
static void *handle = NULL;
|
||||
|
||||
if (handle == NULL) {
|
||||
handle = dlopen(RAYBRI_MAC_GL, RTLD_LAZY | RTLD_LOCAL);
|
||||
}
|
||||
|
||||
if (handle == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return dlsym(handle, name);
|
||||
}
|
||||
|
||||
void raybriLoadExtensions(void) {
|
||||
rlLoadExtensions(raybriGLLoader);
|
||||
}
|
||||
|
||||
#endif // RAYBRI_AUX_IMPLEMENTATION
|
||||
|
||||
#endif // RAYBRI_AUX_H
|
||||
Reference in new issue
Block a user