Closed ellipse12 closed 4 weeks ago
I also was not sure what to link to for every target, so I just did the ones I know.
Oh, this was an interesting solution. So the idea was that to avoid the user having to specify a version, all are available and you pick from the versions you know are available?
Sort of? I believe the version number in the source is in reference to when the specific functions were added, as the earlier versions definitely do not have all of the functions of that version (e.g. fixed pipeline functions like glStart and glEnd are not included). I came from a background of using Java/LWJGL which does something similar with their bindings.
I could probably add the old functions, though it would likely take a little while longer.
There is the alternative to use the env
so for module opengl::gl13;
replace that by module opengl @if(env::GL_VERSION >= 13);
. Another thing would be to have module opengl13::gl
and then have each version essentially include the other and you'd import module opengl15::gl
and you get everything
Is env defined in the project.json? or is it a separate custom module?
I am talking about std::core::env, which can be injected. Another option is to have import opengl
in every module, and it then looks for the constant opengl::VERSION
which a user of the module must define, so essentially:
module opengl;
const int VERSION = 22;
module mycode;
...
This would work.
how do you inject it? (sorry I am still a bit new to C3)
Also as of this moment the bindings should be fully functional with the latest version of OpenGL.
Literally just placing these rows anywhere in your sources:
module opengl;
const int VERSION = 22;
You can access it then through env?
That's not even needed if all opengl modules import this.
Do you mind explaining to me how it(injecting variables into env) works anyway, it may be useful in other ways.
I'll start working on supporting earlier versions
Basically all modules are extendable, so if your program adds something to some other module it's there.
Ooh ok so it's just like the opengl thing but with std::core::env
I have been looking around and I can't seem to find older versions of the OpenGL headers/ xml spec. Would it be alright if you just merged this pull request and I will work on trying to find sources for older versions.
Oh wait I found the previous versions. It will probably take a day or two to do all of them.
Finished adding all of the previous versions! I also tested it by making a simple triangle and everything seemed to work.
Awesome work!
I was not sure if it was better to have multiple files or just one. So I added one file for each sub-module, I am willing to merge them together if necessary though.