Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rlgl] Remove GLEW library dependency (if possible) #43

Closed
raysan5 opened this issue Sep 5, 2015 · 2 comments
Closed

[rlgl] Remove GLEW library dependency (if possible) #43

raysan5 opened this issue Sep 5, 2015 · 2 comments

Comments

@raysan5
Copy link
Owner

raysan5 commented Sep 5, 2015

In order to reduce raylib external dependencies, OpenGL extensions loading library GLEW could be replaced by a lightweight alternative to load only OpenGL 3.3 Core profile required extensions.

Related functions [rlgl.c]:

void rlglInit(void);

Some alternatives have been already tested: glad and glLoadGen. Those libraries generate custom headers to be included in the project with only the required functionality.

glad seems the most interesting alternative but it's not working (neither glLoadGen), #include <windows.h> must be removed due to conflicts with raylib, but glad compiles anyway... When running any example, it crashes.

@raysan5
Copy link
Owner Author

raysan5 commented Jan 21, 2016

After further investigation and testing, I realized a couple of things.

Extensions initialization should be moved from rlgl.c to core.c function InitDisplay(), just below function call glfwMakeContextCurrent(window).

That way, all required GL functions will be loaded before InitGraphics().

I confirm omitting #include <windows.h> on glad.h breaks the program (despite compilation with no complaints).

@raysan5
Copy link
Owner Author

raysan5 commented Jan 23, 2016

Issue solved on commit 4e57bd1

Thanks to @Dav1dde directions, GLEW was finally replaced by GLAD (Check Dav1dde/glad#42).

GLEW alternative has also been left in the code (temporaly) while checking some weird behaviours on gDEBugger/CodeXL profilers.

@raysan5 raysan5 closed this as completed Jan 23, 2016
michaelfiber pushed a commit to michaelfiber/raylib that referenced this issue Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant