I'm writing an application which gets some graphical data from a library.
In the past, I've been writing this application using straight opengl
(through python), but I've found that clutter/cogl both interfaces with gtk
better and correlates more closely to the pythonic model, so I made the
switch to using clutter. It's working really well so far, until I try to
render the data into my GLArea (a custom actor that just renders a cogl
texture). The data that comes in is in the format arrrrrbbbbbggggg, which I
can't find a good equivalent for in cogl (I use glTexImage2D(GL_TEXTURE_2D,
0, GL_RGB, pitch, height, 0, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV, data)
to generate the texture in opengl), so my only recourse has been to try to
make it into an opengl texture and then translate that into a texture (If
there's a way to translate it directly into a cogl texture that would be
preferable, but I can't find a good way). I do this by first creating that
texture as shown above, then translating it with:
clutter.cogl.texture_new_from_foreign(texture,GL_TEXTURE_2D,
pitch,height,0,0,
clutter.cogl.PIXEL_FORMAT_RGB_888)
However, when I finally go to render the newly created texture, I end up
with only the top half of the texture and the texture being repeated 4
times horizontally. On top of that, every other "scanline" within the
texture is blacked out. This led me to believe that the width of the
texture was too high, so I tried dividing pitch by two, but to no avail.
So, anyways, the question comes down to two things: Is there anything wrong
in that call for transforming or is there any way to get data in that
format to directly translate into a cogl texture?
Thanks, Josiah.
_______________________________________________
clutter-app-devel-list mailing list
[email protected]
http://lists.clutter-project.org/listinfo/clutter-app-devel-list