Glamour – An opengl wrapper for D
David
d at dav1d.de
Fri Jul 27 06:29:54 PDT 2012
> Check for errors after every GL call that can generate an error. Because
> GL functions fail silently, debugging why your program misbehaves after
> a failed GL call is almost as annoying as finding the cause of heap
> corruption. Also make sure that every GL call is covered, or you may get
> your errors at the wrong functions. The error code will not reset once
> it is set, until glGetError is called. These checks should be disabled
> in a release build, because they're quite costly.
I was about to implement it, but I thought it isn't necassary, but maybe
I was just wrong. I'll think about it (I will definitly add a template
to glamour.utils which calls the OpenGL method and adds a check)
> All resources are released using a release method, not the destructor.
> This is good. But to ease debugging, set the handle to zero in
> release(), and check for a zero handle in the destructor. Log a warning
> or something like that if the check fails.
Good idea.
> Some functions have overloads for both GLuint's and wrapper instances.
> Unless you really need the GLuint versions, it's probably better to
> remove these. Users should either use the wrappers for everything or not
> at all, anything in between will cause bloat, ugliness, and errors.
Really, where?
If you mean the `unit` param for Samplers/Textures, that is needed,
sometimes you just wanna bind the Sampler/Texture to a specific unit.
> Shader.shaders: perhaps rename to shaderSources?
Good idea.
> The ElementBuffer and Buffer constructors accepting a pointer will not
> compile, the pointer version of set_data requires a size argument.
Right.
Thanks for your input.
More information about the Digitalmars-d-announce
mailing list