www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - glamour / gl3n

reply David <d dav1d.de> writes:
So, I did some more work on both libraries (last announce until today):

Glamour:
https://github.com/Dav1dde/glamour
http://dav1dde.github.io/glamour/

* BootDoc documentation
* some code-style changes (api did mostly not change, see next point)
* removed a few default arguments, make code less confusing
* Better support for uniform arrays in shader
* generate_mipmaps method for textures
* a few minor improvements with Texture1D
* loading textures from SDL (thanks OlaOst) and stb_image
* VAOs (well they were there for a while now)
* FBOs
* RenderBuffers
* A emulation sampler was added for Mac OSX
* Better support OSX in general (thanks SerialVelocity, aka Ben G.)
* a few helpers were added to util to transform opengl types to d types
and vice versa, also gl type to d type size (runtime and compiletime)
* A custom error callback can be set, which only fires when compiled
with -debug on opengl errors (after every opengl call done by glamour
glGetError is called)

Example:

-----

void glamour_error_cb(GLenum errno, string func, string args) {
    static GLenum last_errno = GL_NO_ERROR;
    static string last_func = "";

    if(last_errno != errno && last_func != func) {
        logger.log!Warn(`OpenGL function "%s(%s)" failed: "%s."`, func,
args, gl_error_string(errno));
        last_errno = errno;
        last_func = func;
    }
}
debug glamour_set_error_callback(&glamour_error_cb);

-----


Future plan(s):
* maybe: adding a own opengl loader, independend from derelict,
generated by parsing the opengl spec
* PBO, IBO and more abstraction, will be done if requested or I actually
need them, just message me on irc or open an issue on github




Onto gl3n:

https://github.com/Dav1dde/gl3n
http://dav1dde.github.io/gl3n/

* on dub regestry, thanks BitPuffin!
* color.hsv (rgb - hsv conversion)
* ext.matrixstack added a simple but powerful matrixstack
* aabb support
* a simple plane was added (mainly for frustum support)
* a frustum was added, note it says the module is not tested, that means
there are no unittests for it (the other parts of gl3n use unittests
quite a lot, basically everything is covered with several unittests),
but I have it in use and it works, if someone could come up with
unittests, this would be great
* linalg, supports now vectors with an arbitrary length, of course not
all operations work on N-length vectors (dot product e.g.). This is done
with automatically unrolling foreach loops, instead of hardcoding the
max. length and unrolling with static if

----
        foreach(index; TupleRange!(0, dimension)) {
            temp += vector[index]^^2;
        }
----

* swizzling now returns a Vector!(...), api shouldn't be affected,
assuming you passed the result to a vector constructor
* things like "v.x *= 3" "v.y += 3" are now possible


Future plans:

* fully support SIMD, either I will introduce gl3n.ext.simd, or use
core.simd directly in place, or I will wait for std.simd, or I will
copy&paste the parts I need from the existing std.simd into
gl3n.ext.simd, not sure yet how I will do it, also when I am going to do
it (atm not a whole lot of time), but it will happen, sometime...
* move geometry related stuff (plane, aabb, frustum) into gl3n.geometry
and add more, like bounding spheres, improve plains etc. (not sure about
that yet)



And a little goodie:

Since a lot of you started using the awesome glfw, I made also a glfw
abstraction: https://github.com/Dav1dde/glwtf
Not documentated, but relativly self-explanatory, also WIP, but I have
it in use atm and I am missing nothing so far (fullscreen support will
be added at some point (soon?))
glwtf.glfw imports either glfw from deimos (default) or derelict3
(-version=DynamicGLFW)



If you have any question, go ahead ;)
Any wishes?

- David aka Dav1d.
Jun 18 2013
parent "Kiith-Sa" <kiithsacmp gmail.com> writes:
Awesome. Will try out the new gl3n once I have time to work on my 
project.
Jun 18 2013