3dfxdev / EDGE

EDGE Source Code
http://edge2.sf.net
74 stars 10 forks source link

Replacing GLEW #10

Closed Corbachu closed 6 years ago

Corbachu commented 8 years ago

Okay, so as you guys might know, I want to strip 3DGE of all GLEW-related stuff in favor of a faster, smaller API to handle OpenGL. Glew is too large, and loads way too much information about GL when we only (for now) use a small set of GL extensions (in RGL_CheckExtensions) -- which we could probably rewrite as well. . .

I have committed a library containing a few headers into a folder inside /src named "GLAD". It seemed like a smaller, decent solution.

However, we do have a few more options:

LibEpoxy

(https://github.com/anholt/libepoxy)

GlLoadGen (https://bitbucket.org/alfonse/glloadgen/wiki/Home)

GLAD

https://github.com/Dav1dde/glad

glBinding

https://github.com/cginternals/glbinding

Reference Sheet

https://www.opengl.org/wiki/OpenGL_Loading_Library

I would like all developers to weigh in on this and see what will work best for us.

One thing is certain: GLEW is not part of 3DGE's future, so we should look into this before creating the new release build (2.1.0).

usernameak commented 8 years ago

I think that custom implementation is the best way :smiley:

Corbachu commented 8 years ago

I was thinking about that, too: any ideas where we could start with that? I have always used external loaders..

usernameak commented 8 years ago

What methods of GLEW are used?

Corbachu commented 8 years ago

Look in r_main.cc:

RGL_CheckExtensions() is the function that finds and appends all functions (which, really, isn't a ton...)

Corbachu commented 8 years ago

I am also looking into dGLMake from Doom64-EX, so hopefully I can get on that soon!

ryan-sg commented 8 years ago

Is 3dge still using GL/glew.h really? I noticed at least in i_video.cc i can comment out the include for GL/glew.h and it seems to affect nothing...

Corbachu commented 8 years ago

I will test this out tonight. The i_video code now uses sdl_opengl, but GLEW is still required for extension checking. We really need to get a replacement going..

usernameak commented 7 years ago

On Linux it's easier: just make a header On Windows we need to use wglGetProcAddress

Corbachu commented 6 years ago

Want to revisit this issue soon :)

Corbachu commented 6 years ago

Opened up a new branch called "noglew", it uses GZDoom's version of glLoadGen. If anyone is curious. As soon as I get it working properly consider GLEW as good as gone :-D

Corbachu commented 6 years ago

@usernameak Maybe you can help me test it out? Just checkout noglew to see where it stands right now. :-)

Corbachu commented 6 years ago

We have successfully stripped out GLEW for our own implementation (based off of GZDoom). Closing this finally :)