Hi, I was playing with the OpenGL ES state tracker in opengl-es branch. After digging a little into how it is built, I noticed that the dispatch table is gone. Instead of going through a dispatch table, every call to OpenGL ES API calls _mesa_XxxxXxxx directly after some checkings on the parameters and conversions. After some thinking, I think there are some benefits to use a dispatch table.
The first is about error checking. In OpenGL, _mesa_XxxXxx is called through a dispatch table. When it is called, it safely assumes that there is a valid current context. Now if it is called directly, and there is no current context, it could segfault. So dispatching implies valid current context. The other is about context lost. It is a term used in the EGL spec to indicate a power event like suspend/resume. It is still vague to me, but I think it might be convenient to simply dispatch all GL functions to a function that indicates such error to the user when context lost happens. This should be easier to do with a dispatch table. IMHO, dispatch table is a good paradigm to deal with such issues because it is very clear. It dispatches to different sets of functions depending on the state of current context. -- Regards, olv ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Mesa3d-dev mailing list Mesa3d-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mesa3d-dev