-
Notifications
You must be signed in to change notification settings - Fork 123
Open
Description
The current API is pretty crappy, so here is my proposition to have a clean API and release some kind of non-work-in-progress version of the gl_generator.
- Hide the
registry
andgenerators
modules from the outside of the crate. - Only expose one single function named
generate
.
As far as I know, nobody has written an external generator yet, so I don't think it's a problem to remove this possibility.
The signature of generate
would be like this:
fn generate<W, I>(output: &mut W, generator: GeneratorType, api: Api,
version: &str, profile: &str, extensions: I, fallbacks: Fallbacks)
-> Result<(), Error>
where W: Write, I: IntoIterator, I::Item: AsRef<str>
- The user would no longer need to depend on
khronos_api
(major point IMO) - The namespace and XML files would be automatically deducted from the
api
- Anything could be passed for extensions, be it a
Vec<String>
or a&[&str]
. version
andprofile
are still strings as their content are peeked directly at the XML files. Not using an enum means that we won't have to do any modification when a new version of OpenGL is released.
Metadata
Metadata
Assignees
Labels
No labels