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

Legacy renderer segfault on macOS #142

Open
trzy opened this issue Mar 10, 2024 · 1 comment
Open

Legacy renderer segfault on macOS #142

trzy opened this issue Mar 10, 2024 · 1 comment

Comments

@trzy
Copy link
Owner

trzy commented Mar 10, 2024

When running with the legacy renderer, CCrosshair::Init() crashes when it hits this line:

glGenVertexArrays(1, &m_vao);

This is because glGenVertexArrays() does not exist in GL 2.1 and we set a GL 2.1 context when running the legacy engine.

The fix is to backport the crosshair code to use simple GL 2.1 functions for rendering.

@dukeeeey
Copy link
Collaborator

hmm, yes
It works on windows because it creates a compatibility profile to run the legacy renderer, which means you can use depreciated functions. So old/new work together. But of course this doesn't work for apple because they only support core contexts. So I guess this gets stuck at 2.1 when creating a compatibility opengl context, which of course means glGenVertexAarrays doesn't exist

How glGenVertexAarrays works in a compatibility profile is 0 is reserved for like a default vertex array object.

Either you could port the new renderer to say 4.1, this probably isn't a major task, or just check to see if the function pointers go
glGenVertexArray and glBindVertexArray exist, if not just skip them. It should still work but might have to call the glAttributePointers and enables every time.

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

2 participants