davidsiaw / SDL2

Mirror of the official SDL2 repository
Other
20 stars 17 forks source link

ok, #2

Closed hibengler closed 5 years ago

hibengler commented 6 years ago

OpenGL ES 2.0 is being used more and more because it is supported on all major platforms. But the support is hidden and clunky for Windows machines. I took the recent work form David and polished it.

  1. I wrote snobol parsers of the original khronos to give a complete list of the standard GLES 2.0 functions.

  2. I wrote more generated code to provide 2 easy ways to help developers run GLES2 in the best way: a. #define macros that hide the need to address a context (i.e ctx.GetString instead of just GetString. b. C shim code that looks to plug the gap of libGLES2.dll, allowing people to use the hardware/angle choices by SDL2.

  3. So the list of functions is complete, and allows for running of established code, thatnks to the Load Context method, and these shims.

I present this as an option, that can help developers get much further without the tedium, of building angle, or glew.

As is, the teo examples can be static or dynamic. Static builds might be biger, but are more guarenteed to just work without dll /hardware yuckiness.

So the build folder has the snobol code, a makefile on how to build these new options, a traingle demo that works, and the testgles2.c code modified to use the code (but probably not ready to replace the actual test code).

https://www.g-truc.net/post-0457.html - talks in detail of the status of GLES 2. I hope this will cause an update of the status.

Humbly I hope you accept this work.

hibengler commented 6 years ago

One more thing. This commit holds all the code to build the header files. The header files will be pulled in also- separate request I guess. I am adapting from decades of using cvs.

davidsiaw commented 6 years ago

Thanks for your PR. I am not the original creator of SDL2 so note that even if it gets merged into this repo, it may not reach upstream SDL2.

This commit is great. I forked SDL2 mostly so I can build it into my own projects the way I want. It is also good that you included the code generator.

Most importantly though. Does this work on Linux, MacOS and can it target Android and iOS too?

hibengler commented 5 years ago

I added a howto_setup.txt file to describe the snobol4 code, and how to build that code from gl2.h And did minor cleanups.

davidsiaw commented 5 years ago

Thanks