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

Organizing The Code #7

Open
4ydx opened this issue Feb 10, 2018 · 3 comments
Open

Organizing The Code #7

4ydx opened this issue Feb 10, 2018 · 3 comments
Assignees

Comments

@4ydx
Copy link
Owner

4ydx commented Feb 10, 2018

I am thinking it might be a reasonable idea to create an interface that describes all of the required opengl api calls so that the code can accept different opengl core objects which would bring all of the code back down into a single folder rather than having any core specific code. I am not sure if this will work or not in terms of how opengl handles the same function calls across versions. Thoughts are appreciated.

@4ydx 4ydx changed the title Organizing code Organizing The Code Feb 10, 2018
@4ydx 4ydx self-assigned this Feb 10, 2018
@dumkin
Copy link
Contributor

dumkin commented Feb 11, 2018

The official repository github.com/go-gl/gl practices this. I took the idea from there. I'm not sure what exactly in OpenGL is a better tone. From the options to do:

  1. All versions in different folders (github.com/go-gl/gl)
  2. Common code in the shared folder, different code in different (current)
  3. All the code chooses different methods based on the selected version (is it correct in Golang?)

@4ydx
Copy link
Owner Author

4ydx commented Feb 11, 2018

Gotcha. Those folders are all being generated so there isn't much manual maintenance involved. As long as the function signatures are universal (at least in terms of what gltext needs) and the underlying results of the given functions are the same, I would rather maintain less code.

When I look at the shaders I originally wrote they still specify 330 as the version. If support for 2.1 were added at some point then that would require changes. I might just give this a try at some point. Thanks for your input!

If you want to give this a try, let me know. I don't want us both to work on the same thing.

@4ydx
Copy link
Owner Author

4ydx commented Feb 19, 2018

I am looking into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants