Hi Shariq,

There is a major problem when I try to use your header in my project: My library is based on enumerations defined both on OpenGL ES and desktop. My copy of glew, even when set for OpenGL ES build, includes the define's for desktop platform (such as GL_TEXTURE_3D). And a desktop build should recognize the enumeration for GL_ETC1_RGB8_OES, for example, which is ES specific (and actually an extension). The main reason is the library enumerates all reasonable values for a basic operation, such as :
    enum TextureType {
        TextureType_1D   = GL_TEXTURE_1D, (not natively in ES 2.0)
        TextureType_2D   = GL_TEXTURE_2D,
        TextureType_3D   = GL_TEXTURE_3D, (not natively in ES 2.0)
        TextureType_Cube = GL_TEXTURE_CUBE_MAP
    };

Including defines for all platform (&preventing multiple definitions) is important for libraries that aim to be cross-platform. I hope the use case of making all define's available across platforms is reasonable. I have been using it that way and it makes my own library so much easier to understand and use. In my case, checking if the enumerated value is supported is left to runtime, with many overloaded isSupported(X) functions (X can be ImageFormat, IndexDataType, FrameBufferAttachType, ShaderType, etc).

My changes to glew were only to make sure that I can use the same header file, and "to prevent missing define's every time I added some enumeration access" across domains (my builds used to break every time I switched development platforms and extended by library). The major drawback of my copy is that it is no longer up-to-date with recent changes in glew. Things to improve include implementing the glewInit function to set extension function entry points. Implementing EGL wrappers can be a secondary improvement, since it is not a requirement directly. Anyone can opt to use default EGL headers they have in their platform. I also think that supporting ES 1.1 and 1.0 is not important at all. They seem to be relatively old API's and can introduce additional complexity, especially when a full ES 2.0 is not complete with all the right design decisions.

Thanks,

On Thu, Jul 14, 2011 at 11:39 AM, Patrick Meehan <patrick@ziplinegames.com> wrote:
Cool. Please keep us posted. I am going to concentrate on my task at
hand (adding ES 2.0 support to my project) and will check back in
early next week.

I don't know of other systems using EAGL instead of EGL - though I
haven't looked closely at Android.

--P

On Thu, Jul 14, 2011 at 3:43 AM, Shariq Hasnain
<shariq.hasnain@linaro.org> wrote:
>
> Hi Patrick/All,
>
> I have assumed that EGL is always used with OpenGL ES.So you are getting
> that error from 'eglew.h' file.
> Window-system-dependent types are defined in 'eglplatform.h' for EGL and
> that code I have included in 'eglew.h'.
> I checked and found that Xcode does not use EGL but instead 'EAGL.h'.Need to
> modify the code to take care of cases where EGL is not used with OpenGL ES.
> Do you have idea of any other OS doing so ?
>
>  I should have also explicitly mentioned in the earlier mail what are still
> missing in the patches for ES (GLEW_ES_ONLY). I will keep in mind to do so
> next time onward.
> -  Need to add code to glew.c to get the function pointers of OpenGL ES and
> EGL functions.i.e. to implement 'esGetProcAddress' for all cases.
> - Proper Makefile need to be added to compile for ES cases (GLEW_ES_ONLY
> need to be defined).
> - glewinfo and visualinfo needs to be implemented.
>
>
> Thanks,
> Shariq
>
>> OK. Built GLEW from Shariq's project on OSX. Now trying to compile for
>> iPhone using Xcode. Using GLEW_NO_GLU, but I am left with a number of
>> errors. Have tried with and without GLEW_ES_ONLY.
>>
>>
>>
>> With GLEW_ES_ONLY I get a 'platform not recognized' follow by a bunch
>> of errors. Without, glew.c compiles, but if I include glew.h I get a
>> different set of warnings and errors. I'm also wondering if GLEW is
>>
>>
>> deducing the iPhone platform correctly or if it thinks it.s building
>> for OSX.
>>
>> Before I send a bunch of specifics, can anyone advise me on the
>> correct settings to build for iPhone? Shariq, are you targeting iPhone
>>
>>
>> or other ES platforms?
>

------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric
Ries, the creator of the Lean Startup Methodology on "Lean Startup
Secrets Revealed." This video shows you how to validate your ideas,
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
glew-coders mailing list
glew-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/glew-coders



--
M. Adil Yalcin
University of Maryland - Department of Computer Science
http://www.umiacs.umd.edu/~yalcin