notaz.gp2x.de
/
libpicofe.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e288d77
)
gl: make surface and context readable by users
author
notaz
<notasas@gmail.com>
Wed, 6 Feb 2013 01:46:20 +0000
(
03:46
+0200)
committer
notaz
<notasas@gmail.com>
Wed, 6 Feb 2013 01:46:20 +0000
(
03:46
+0200)
used by PCSX gles plugin
gl.c
patch
|
blob
|
blame
|
history
gl.h
patch
|
blob
|
blame
|
history
diff --git
a/gl.c
b/gl.c
index
44e0dd5
..
2ebb87c
100644
(file)
--- a/
gl.c
+++ b/
gl.c
@@
-10,6
+10,10
@@
static EGLDisplay edpy;
static EGLSurface esfc;
static EGLContext ectxt;
static EGLSurface esfc;
static EGLContext ectxt;
+/* for external flips */
+void *gl_es_display;
+void *gl_es_surface;
+
static int gl_have_error(const char *name)
{
GLenum e = glGetError();
static int gl_have_error(const char *name)
{
GLenum e = glGetError();
@@
-119,6
+123,8
@@
int gl_init(void *display, void *window, int *quirks)
if (gl_have_error("init"))
goto out;
if (gl_have_error("init"))
goto out;
+ gl_es_display = (void *)edpy;
+ gl_es_surface = (void *)esfc;
retval = 0;
out:
free(tmp_texture_mem);
retval = 0;
out:
free(tmp_texture_mem);
@@
-185,5
+191,8
@@
void gl_finish(void)
eglTerminate(edpy);
edpy = EGL_NO_DISPLAY;
eglTerminate(edpy);
edpy = EGL_NO_DISPLAY;
+ gl_es_display = (void *)edpy;
+ gl_es_surface = (void *)esfc;
+
gl_platform_finish();
}
gl_platform_finish();
}
diff --git
a/gl.h
b/gl.h
index
83b9e41
..
f87afb0
100644
(file)
--- a/
gl.h
+++ b/
gl.h
@@
-4,6
+4,10
@@
int gl_init(void *display, void *window, int *quirks);
int gl_flip(const void *fb, int w, int h);
void gl_finish(void);
int gl_flip(const void *fb, int w, int h);
void gl_finish(void);
+/* for external flips */
+extern void *gl_es_display;
+extern void *gl_es_surface;
+
#else
static __inline int gl_init(void *display, void *window, int *quirks)
#else
static __inline int gl_init(void *display, void *window, int *quirks)
@@
-18,6
+22,9
@@
static __inline void gl_finish(void)
{
}
{
}
+#define gl_es_display (void *)0
+#define gl_es_surface (void *)0
+
#endif
#define GL_QUIRK_ACTIVATE_RECREATE 1
#endif
#define GL_QUIRK_ACTIVATE_RECREATE 1