Support iOS for ogs-blue #7
No files matched your search
@@ -0,0 +1,36 @@
|
|||||||
|
#include "raybri.h"
|
||||||
|
#include "rlgl.h"
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
void raybriInit(void *layer) {
|
||||||
|
//SetTraceLogLevel(LOG_WARNING);
|
||||||
|
|
||||||
|
if (!raybriInitEGL()) {
|
||||||
|
raybriLog(stderr, "ERROR Could not initialize EGL")
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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 raybriLog(const char *txt) {
|
||||||
|
fprintf(stderr, "Raybri: %s\n", txt);
|
||||||
|
fflush(stderr);
|
||||||
|
}
|
||||||
|
|
||||||
|
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();
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
#include <libEGL/libEGL.h>
|
||||||
|
#include <libGLESv2/GLES/gl.h>
|
||||||
|
#include "raybriEGL.h"
|
||||||
|
|
||||||
|
bool raybriInitEGL(void) {
|
||||||
|
EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
|
||||||
|
if (display == EGL_NO_DISPLAY) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (eglInitialize(display, NULL, NULL) == EGL_FALSE) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (eglBindAPI(EGL_OPENGL_ES_API) == EGL_FALSE) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
#ifndef RAYBRI_EGL_H
|
||||||
|
#define RAYBRI_EGL_H
|
||||||
|
|
||||||
|
bool raybriInitEGL(void);
|
||||||
|
|
||||||
|
#endif // RAYBRI_EGL_H
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
#include "raybri.h"
|
#include "raybri.h"
|
||||||
#include "raybriAux.h"
|
#include "raybriAux.h"
|
||||||
#include "rlgl.h"
|
#include "rlgl.h"
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
void raybriInit(void *layer) {
|
void raybriInit(void *layer) {
|
||||||
//SetTraceLogLevel(LOG_WARNING);
|
//SetTraceLogLevel(LOG_WARNING);
|
||||||
@@ -14,6 +15,11 @@ void raybriInit(void *layer) {
|
|||||||
rlClearColor(0, 0, 255, 255);
|
rlClearColor(0, 0, 255, 255);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void raybriLog(const char *txt) {
|
||||||
|
fprintf(stderr, "Raybri: %s\n", txt);
|
||||||
|
fflush(stderr);
|
||||||
|
}
|
||||||
|
|
||||||
void raybriRender(int width, int height) {
|
void raybriRender(int width, int height) {
|
||||||
// Set the drawing area to the current pixel size
|
// Set the drawing area to the current pixel size
|
||||||
rlViewport(0, 0, width, height);
|
rlViewport(0, 0, width, height);
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
#define RAYBRI_H
|
#define RAYBRI_H
|
||||||
|
|
||||||
void raybriInit(void *layer);
|
void raybriInit(void *layer);
|
||||||
|
void raybriLog(const char *txt);
|
||||||
void raybriRender(int width, int height);
|
void raybriRender(int width, int height);
|
||||||
void raybriShutdown(void);
|
void raybriShutdown(void);
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user