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

GL Loader System #21

Open
Lokathor opened this issue Jan 13, 2021 · 0 comments
Open

GL Loader System #21

Lokathor opened this issue Jan 13, 2021 · 0 comments

Comments

@Lokathor
Copy link
Member

Separate from initializing a GL context (very platform specific) is the issue of making that GL context even slightly easy to use (fairly platform neutral).

Basically you usually end up with a function like:

fn gl_get_proc_address(name: &[u8]) -> *mut c_void;

And from there you fill in a struct of pointers or you fill in some global static values.

// global fn style
glClearColor(1.0, 1.0, 0.5, 1.0);

// struct style
gl.Clear(GL_COLOR_BUFFER_BIT);

The global functions style is a hair easier to use, but the struct style connects the fns more closely to their context (which is essentially "more correct").

So we should have a lesson about how you do all this. We don't have to do the full thing necessarily, since our actual GL usage is very modest. We can just show people what they would do and then say "now go use the crate".

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