diff --git a/components/raybri/mac/raybri.c b/components/raybri/mac/raybri.c deleted file mode 100644 index c9dccd5..0000000 --- a/components/raybri/mac/raybri.c +++ /dev/null @@ -1,34 +0,0 @@ -#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 - -void raybriInit(void) { - //SetTraceLogLevel(LOG_WARNING); - - // Load OpenGL extensions - rlLoadExtensions((void *)raybriGLLoader); - // Initialize raylib graphics layer with a placeholder 1x1 framebuffer size - // Graphics layer includes default texture, shader, render batch and OpenGL state - rlglInit(1, 1); - // Background is painted in blue - rlClearColor(0, 0, 255, 255); -} - -void raybriRender(int width, int height) { - // Set the drawing area to the current pixel size - rlViewport(0, 0, width, height); - // Clear color and depth buffers for the next frame - rlClearScreenBuffers(); - // Draw any queued geometry - rlDrawRenderBatchActive(); -} - -void raybriShutdown(void) { - // Release rlgl buffers, shaders and textures - rlglClose(); -} diff --git a/components/raybri/mac/raybriAux.h b/components/raybri/mac/raybriAux.h index 40c44ca..fd9630c 100644 --- a/components/raybri/mac/raybriAux.h +++ b/components/raybri/mac/raybriAux.h @@ -10,8 +10,8 @@ void *raybriGLLoader(const char *name); #if defined(RAYBRI_AUX_IMPLEMENTATION) #include -#include #include "raybriConst.h" +#include // 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 diff --git a/components/raybri/mac/raybriConst.h b/components/raybri/raybriConst.h similarity index 100% rename from components/raybri/mac/raybriConst.h rename to components/raybri/raybriConst.h diff --git a/components/render/mac/renderEffect.swift b/components/render/mac/renderEffect.swift index ad3d568..4f7b306 100644 --- a/components/render/mac/renderEffect.swift +++ b/components/render/mac/renderEffect.swift @@ -16,6 +16,9 @@ func renderInit(_ vm: RenderVM) { var swapInterval: Int32 = 1 vm.glView.openGLContext?.setValues(&swapInterval, for: .swapInterval) + // Load OpenGL extensions + rlLoadExtensions((void *)raybriGLLoader); + raybriInit() } diff --git a/ogs-blue/ver-ios/src/Blue.c b/ogs-blue/ver-ios/src/Blue.c index 919d07b..52c46a0 100644 --- a/ogs-blue/ver-ios/src/Blue.c +++ b/ogs-blue/ver-ios/src/Blue.c @@ -4,6 +4,9 @@ #define EGL_IMPLEMENTATION #include "egl.h" +#define RAYBRI_CONST_IMPLEMENTATION +#include "raybriConst.h" + #define RAYBRI_IMPLEMENTATION #include "raybri.h" diff --git a/ogs-blue/ver-ios/src/raybri/raybriConst.h b/ogs-blue/ver-ios/src/raybri/raybriConst.h new file mode 120000 index 0000000..7e1b994 --- /dev/null +++ b/ogs-blue/ver-ios/src/raybri/raybriConst.h @@ -0,0 +1 @@ +../../../../components/raybri/raybriConst.h \ No newline at end of file diff --git a/ogs-blue/ver-mac/src/Blue.c b/ogs-blue/ver-mac/src/Blue.c new file mode 100644 index 0000000..d0e9f07 --- /dev/null +++ b/ogs-blue/ver-mac/src/Blue.c @@ -0,0 +1,11 @@ +#define RAYBRI_CONST_IMPLEMENTATION +#include "raybriConst.h" + +#define RAYBRI_AUX_IMPLEMENTATION +#include "raybriAux.h" + +#define RAYBRI_IMPLEMENTATION +#include "raybri.h" + +#define RLGL_IMPLEMENTATION +#include "rlgl.h" diff --git a/ogs-blue/ver-mac/src/raybri/raybri.c b/ogs-blue/ver-mac/src/raybri/raybri.c deleted file mode 120000 index 80f2251..0000000 --- a/ogs-blue/ver-mac/src/raybri/raybri.c +++ /dev/null @@ -1 +0,0 @@ -../../../../components/raybri/mac/raybri.c \ No newline at end of file diff --git a/ogs-blue/ver-mac/src/raybri/raybriConst.h b/ogs-blue/ver-mac/src/raybri/raybriConst.h index f834a27..7e1b994 120000 --- a/ogs-blue/ver-mac/src/raybri/raybriConst.h +++ b/ogs-blue/ver-mac/src/raybri/raybriConst.h @@ -1 +1 @@ -../../../../components/raybri/mac/raybriConst.h \ No newline at end of file +../../../../components/raybri/raybriConst.h \ No newline at end of file