Android support, attempt-1 #8

Open
kornerr wants to merge 62 commits from and1 into master
pull from: and1
5 changed files with 69 additions and 0 deletions
Showing only changes of commit dfe16133df - Show all commits

No files matched your search

+36
View File
@@ -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();
}
+20
View File
@@ -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;
}
+6
View File
@@ -0,0 +1,6 @@
#ifndef RAYBRI_EGL_H
#define RAYBRI_EGL_H
bool raybriInitEGL(void);
#endif // RAYBRI_EGL_H
+6
View File
@@ -1,6 +1,7 @@
#include "raybri.h"
#include "raybriAux.h"
#include "rlgl.h"
#include <stdio.h>
void raybriInit(void *layer) {
//SetTraceLogLevel(LOG_WARNING);
@@ -14,6 +15,11 @@ void raybriInit(void *layer) {
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);
+1
View File
@@ -2,6 +2,7 @@
#define RAYBRI_H
void raybriInit(void *layer);
void raybriLog(const char *txt);
void raybriRender(int width, int height);
void raybriShutdown(void);