some
This commit is contained in:
1 parent
cc2748efb7
commit
2fbaba4a51
2 files changed
+23
-1
No files matched your search
@@ -1,4 +1,8 @@
|
|||||||
#include "raybri.h"
|
#include "raybri.h"
|
||||||
|
|
||||||
|
#define RAYBRI_EGL_CONST_IMPLEMENTATION
|
||||||
|
#include "raybriEGLConst.h"
|
||||||
|
|
||||||
#define RAYBRI_EGL_IMPLEMENTATION
|
#define RAYBRI_EGL_IMPLEMENTATION
|
||||||
#include "raybriEGL.h"
|
#include "raybriEGL.h"
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include <libEGL/libEGL.h>
|
#include <libEGL/libEGL.h>
|
||||||
#include <libGLESv2/GLES/gl.h>
|
#include <libGLESv2/GLES/gl.h>
|
||||||
|
#include "raybriEGLConst.h"
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
// Header
|
// Header
|
||||||
@@ -14,7 +15,11 @@ bool raybriEGLInit(void);
|
|||||||
#if defined(RAYBRI_EGL_IMPLEMENTATION)
|
#if defined(RAYBRI_EGL_IMPLEMENTATION)
|
||||||
|
|
||||||
bool raybriEGLInit(void) {
|
bool raybriEGLInit(void) {
|
||||||
EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
|
EGLConfig cfg = NULL;
|
||||||
|
EGLContext ctx = EGL_NO_CONTEXT;
|
||||||
|
EGLDisplay display = EGL_NO_DISPLAY;
|
||||||
|
|
||||||
|
display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
|
||||||
if (display == EGL_NO_DISPLAY) {
|
if (display == EGL_NO_DISPLAY) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -27,6 +32,19 @@ bool raybriEGLInit(void) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EGLint cfgCount = 0;
|
||||||
|
if (
|
||||||
|
eglChooseConfig(display, RAYBRI_EGL_CFG, &cfg, 1, &cfgCount) == EGL_FALSE ||
|
||||||
|
cfgCount < 1
|
||||||
|
) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
ctx = eglCreateContext(display, cfg, EGL_NO_CONTEXT, RAYBRI_EGL_CTX);
|
||||||
|
if (ctx == EGL_NO_CONTEXT) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user