aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ClientHamr/extantz
diff options
context:
space:
mode:
authorDavid Walter Seikel2014-01-13 19:32:44 +1000
committerDavid Walter Seikel2014-01-13 19:32:44 +1000
commite8bab8d84425f2773e411552f96ee20a078f3fa2 (patch)
tree6b1b4061b78d73386e0e9bc50a2047b6b4a3c624 /ClientHamr/extantz
parentFix EFL 1.7 -> 1.8 bit rot, make it work with Elm_glview to, and lots of clea... (diff)
downloadSledjHamr-e8bab8d84425f2773e411552f96ee20a078f3fa2.zip
SledjHamr-e8bab8d84425f2773e411552f96ee20a078f3fa2.tar.gz
SledjHamr-e8bab8d84425f2773e411552f96ee20a078f3fa2.tar.bz2
SledjHamr-e8bab8d84425f2773e411552f96ee20a078f3fa2.tar.xz
Failed experiment to quickly try EFL GL support Rasters way, but copious comments added.
Diffstat (limited to 'ClientHamr/extantz')
-rw-r--r--ClientHamr/extantz/crappisspuke.cpp55
1 files changed, 54 insertions, 1 deletions
diff --git a/ClientHamr/extantz/crappisspuke.cpp b/ClientHamr/extantz/crappisspuke.cpp
index 15cb523..576dd2b 100644
--- a/ClientHamr/extantz/crappisspuke.cpp
+++ b/ClientHamr/extantz/crappisspuke.cpp
@@ -33,14 +33,67 @@ EAPI int startIrr(GLData *gld)
33 void *display = NULL; 33 void *display = NULL;
34 unsigned long sfc = 0; 34 unsigned long sfc = 0;
35 void *ctx = NULL; 35 void *ctx = NULL;
36 Evas_GL_API *gl = gld->glApi;
36 37
37#if USE_DEMO 38#if USE_DEMO
38 myDemo = new CDemo(gld, additive); 39 myDemo = new CDemo(gld, additive);
39#endif 40#endif
40 41
41 display = glXGetCurrentDisplay(); 42/* Raster says -
434. evas exposes an opengl-es2 api. any existing engine needs to be adapted to
44use this. that's pretty much the end of that. if the engine doesn't have a
45gles2 port.. it will need one. once it has one, then it is a simple matter of
46replacing all the gl calls as follows:
47
48glDrawArrays() -> api->glDrawArrays()
49glBindBuffer() -> api->glBindBuffer()
50
51you could make the port switchable with a macro:
52
53#ifdef EVASGL
54#define EG() my_evas_gl_api->
55#else
56#define EG()
57#endif
58
59then fix up all the gl calls to be
60
61EG()glDrawArrays()
62EG()glBindBuffer()
63
64etc.
65
66doing the above allows evas to decide how to share context. it may allocate a
67separate context or share its own. either way as far as the evasgl api user is
68concerned.. they get their own private context to play with. if it does NOT do
69the above (use the api exposed by evas gl) then wrapping can't context switches
70can't work. all gl calls HAVE to go through the wrapped api to work right. this
71is because we can't REPLACE the internals of the gl driver which otherwise
72would be managing context and state all internally and we have zero access to
73that - especially with closed drivers. we'd end up writing a proxy gl library
74which conflicts with real gl symbol-wise (thus taking over and replacing
75normal gl calls) and i know i have no interest in maintaining a separate
76libGLwhatever.so that is an exact copy of gl and it's api's just to wrap it
77when we expose that wrapper without symbol complications via evas gl.
78
795. the engine will need to be adapted so the draw function is callable - eg by
80elm_glview. then it's easy to switch where rendering happens. evas offers a fast
81path to avoid buffer copies and make the gl view draw part of the evas
82rendering path directly. this would offer almost zero overhead vs doing it
83directly with egl/gles etc. to your backbuffer yourself, BUT gets you the bonus
84of having your 3d view as part of a larger scenegraph. combine 2 or 3 of them
85in a single window. overlay with evas objects or elm widgets for hud etc. all
86for free. this also implies the engine has to integrate to the efl mainloop
87etc. of course.
88*/
89
90
42 sfc = ecore_evas_window_get(gld->ee); 91 sfc = ecore_evas_window_get(gld->ee);
92 // This is the way Raster wants me to do things, but these functions are not actually available. Pffft
93// ctx = gl->glGetCurrentContext();
94// display = gl->glGetCurrentDisplay();
43 ctx = glXGetCurrentContext(); 95 ctx = glXGetCurrentContext();
96 display = glXGetCurrentDisplay();
44 /* For using a pre existing X11 window (with optional OpenGL). */ 97 /* For using a pre existing X11 window (with optional OpenGL). */
45 videoData = SExposedVideoData(); 98 videoData = SExposedVideoData();
46 videoData.OpenGLLinux.X11Display = display; // void * - Connection to the X server. 99 videoData.OpenGLLinux.X11Display = display; // void * - Connection to the X server.