diff --git a/components/raybri/ios/raybri.c b/components/raybri/ios/raybri.c deleted file mode 100644 index 3d44af9..0000000 --- a/components/raybri/ios/raybri.c +++ /dev/null @@ -1,36 +0,0 @@ -#define EGL_CONST_IMPLEMENTATION -#include "eglConst.h" - -#define EGL_IMPLEMENTATION -#include "egl.h" - -#include "raybri.h" - -#define RLGL_IMPLEMENTATION -#include "rlgl.h" - -#include - -void raybriInit(void) { - //SetTraceLogLevel(LOG_WARNING); - - // 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/raybri.h b/components/raybri/raybri.h index 902f706..4960c11 100644 --- a/components/raybri/raybri.h +++ b/components/raybri/raybri.h @@ -1,8 +1,42 @@ #ifndef RAYBRI_H #define RAYBRI_H +// Header + void raybriInit(void); void raybriRender(int width, int height); void raybriShutdown(void); +// Source + +#if defined(RAYBRI_IMPLEMENTATION) + +#include "rlgl.h" + +void raybriInit(void) { + //SetTraceLogLevel(LOG_WARNING); + + // 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(); +} + +#endif // RAYBRI_IMPLEMENTATION + #endif // RAYBRI_H diff --git a/ogs-blue/ver-ios/src/Blue.c b/ogs-blue/ver-ios/src/Blue.c new file mode 100644 index 0000000..919d07b --- /dev/null +++ b/ogs-blue/ver-ios/src/Blue.c @@ -0,0 +1,12 @@ +#define EGL_CONST_IMPLEMENTATION +#include "eglConst.h" + +#define EGL_IMPLEMENTATION +#include "egl.h" + +#define RAYBRI_IMPLEMENTATION +#include "raybri.h" + +#define RLGL_IMPLEMENTATION +#include "rlgl.h" + diff --git a/ogs-blue/ver-ios/src/raybri/raybri.c b/ogs-blue/ver-ios/src/raybri/raybri.c deleted file mode 120000 index d36f47a..0000000 --- a/ogs-blue/ver-ios/src/raybri/raybri.c +++ /dev/null @@ -1 +0,0 @@ -../../../../components/raybri/ios/raybri.c \ No newline at end of file