compact mac files
This commit is contained in:
1 parent
48f7d37c78
commit
9757a40b36
8 files changed
+43
-27
No files matched your search
@@ -1,4 +1,8 @@
|
||||
#include "raybri.h"
|
||||
// Const must be before Aux due to Aux referencing constants of Const
|
||||
#define RAYBRI_CONST_IMPLEMENTATION
|
||||
#include "raybriConst.h"
|
||||
#define RAYBRI_AUX_IMPLEMENTATION
|
||||
#include "raybriAux.h"
|
||||
#include "rlgl.h"
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
#include <dlfcn.h>
|
||||
#include "raybriAux.h"
|
||||
#include "raybriConst.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);
|
||||
}
|
||||
@@ -1,6 +1,35 @@
|
||||
#ifndef RAYBRI_AUX_H
|
||||
#define RAYBRI_AUX_H
|
||||
|
||||
// Header
|
||||
|
||||
void *raybriGLLoader(const char *name);
|
||||
|
||||
// Source
|
||||
|
||||
#if defined(RAYBRI_AUX_IMPLEMENTATION)
|
||||
|
||||
#include <dlfcn.h>
|
||||
#include <stddef.h>
|
||||
#include "raybriConst.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);
|
||||
}
|
||||
|
||||
#endif // RAYBRI_AUX_IMPLEMENTATION
|
||||
|
||||
#endif // RAYBRI_AUX_H
|
||||
@@ -1,3 +0,0 @@
|
||||
#include "raybriConst.h"
|
||||
|
||||
const char RAYBRI_MAC_GL[] = "/System/Library/Frameworks/OpenGL.framework/OpenGL";
|
||||
@@ -1,6 +1,16 @@
|
||||
#ifndef RAYBRI_CONST_H
|
||||
#define RAYBRI_CONST_H
|
||||
|
||||
// Header
|
||||
|
||||
extern const char RAYBRI_MAC_GL[];
|
||||
|
||||
// Source
|
||||
|
||||
#if defined(RAYBRI_CONST_IMPLEMENTATION)
|
||||
|
||||
const char RAYBRI_MAC_GL[] = "/System/Library/Frameworks/OpenGL.framework/OpenGL";
|
||||
|
||||
#endif // RAYBRI_CONST_IMPLEMENTATION
|
||||
|
||||
#endif // RAYBRI_CONST_H
|
||||
@@ -1 +0,0 @@
|
||||
../../../../components/raybri/mac/raybriAux.c
|
||||
@@ -1 +0,0 @@
|
||||
../../../../components/raybri/mac/raybriConst.c
|
||||
@@ -1 +0,0 @@
|
||||
../../../../components/raybri/raybriConst.c
|
||||
Reference in new issue
Block a user