Hi all,

I've been toying around with creating a simple GLView smart object that
allows users do GL rendering simply.  Eventually, I would like to see this
as an Elementary widget called GLView.  The idea behind this is that
if evas_gl provides the low level stuff, GLView gives the simplified
user-version.
I'll start another email thread later on this topic.

The reason why I'm mentioning the above is because while working on GLView,
I've noticed an interesting behavior.  (You can see this by
compiling/running the
program that I'm attaching.)  I'm drawing a simple blended Triangle in
the middle
of the GLView object and what i'm getting is a smaller inverted red triangle on
the top left corner of the GLView object.  Obviously, something was messing
with the state of my GL code.

I've tracked this issue down to eng_window_use() in evas_x_main.c under gl_x11
module.  In the code,
_________________
void
eng_window_use(Evas_GL_X11_Window *gw)
{
   if ((_evas_gl_x11_window != gw) || (force_use))
     {
        if (_evas_gl_x11_window)
          {
             evas_gl_common_context_use(_evas_gl_x11_window->gl_context);
             evas_gl_common_context_flush(_evas_gl_x11_window->gl_context);
          }
        _evas_gl_x11_window = gw;
       if (gw)
         {
       ....
       // Make Current Stuff..
_________________

I've noticed that evas_gl_common_context_flush() gets called before it does
MakeCurrent().  When the evas_gl_common_context_flush() gets called, it resets
some shader stuff and does GL calls that tell the context to use the
particular shaders.  This explains why my GLView was picking on what seemed
to be the MVP matrix states that Evas was using.

Instead, what I think should happen is that the flush should be called after
MakeCurrent happens.  Otherwise, you're not guaranteeing that your GL calls are
being applied to the proper context. I've tried that and it seems to
address the
problem.

You can try running the glview program that I'm attaching before you apply
the patch and also try running it after you apply the patch.

Let me know if this seems reasonable or I'm missing something somewhere.

Thanks!

cheers,
Sung

Attachment: glview.tgz
Description: GNU Zip compressed data

------------------------------------------------------------------------------
Forrester Wave Report - Recovery time is now measured in hours and minutes
not days. Key insights are discussed in the 2010 Forrester Wave Report as
part of an in-depth evaluation of disaster recovery service providers.
Forrester found the best-in-class provider in terms of services and vision.
Read this report now!  http://p.sf.net/sfu/ibm-webcastpromo
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to