On Thu, 21 Apr 2011 11:29:46 +0900 "Sung W. Park" <[email protected]> said:
yes yes yes! absolutely right. it's a bit inconsistent to have to do that when the rest of the normal evas api is all handle based - no "make currenting". the only time u should need to make current is before using gl calls as this is where u go from the boundary of evas's api into the gl api and thus it begins to look gl-like. > Hi all, > > I'm attaching a patch that addresses the awkward usage case. It's something > that didn't bother me initially but the more I look at it, i think > it's a little off. :-) > > The initial version of the evas_gl that I've submitted had the > following use case. > > evasgl = evas_gl_new(e); > sfc = evas_gl_surface_create(...); > ctx = evas_gl_context_create(...); > > // Make current triggers surface texture and FBO to be created > evas_gl_make_current(evasgl, sfc, ctx); > > // Then you can do a surface_get to retrieve the proper texture and set it > evas_gl_native_surface_get(evasgl, sfc, &ns); > evas_object_image_native_surface_set(img_obj, &ns); > > The unnatural thing about this use case is that you have to call the > make_current > one time in order for evas_gl to generate a surface texture. This is because > you need a context to create a texture. Unfortunately, this makes the usage > case really awkward. > > So, instead, I've decided to get rid of the need for calling the make_current > by generating a surface texture when evas_gl_surface_create() is called > by using the evas' gl context. This works because the newly created context > shares resources with evas. in fact, this is what i'm currently doing > with surface > deletion anyway so I thought this solution was reasonable. > > Here's how it looks after you get rid of the make_current: > > evasgl = evas_gl_new(e); > sfc = evas_gl_surface_create(...); > ctx = evas_gl_context_create(...); > > evas_gl_native_surface_get(evasgl, sfc, &ns); > evas_object_image_native_surface_set(img_obj, &ns); > > The patch is pretty small and straightforward. > > Let me know what you guys think. > > cheers, > Sung -- ------------- Codito, ergo sum - "I code, therefore I am" -------------- The Rasterman (Carsten Haitzler) [email protected] ------------------------------------------------------------------------------ Fulfilling the Lean Software Promise Lean software platforms are now widely adopted and the benefits have been demonstrated beyond question. Learn why your peers are replacing JEE containers with lightweight application servers - and what you can gain from the move. http://p.sf.net/sfu/vmware-sfemails _______________________________________________ enlightenment-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
