[Cogl] Creating sliced textures from data and framebuffer

Robert Bragg robert at sixbynine.org
Sat Jan 21 05:10:25 PST 2012


Forwarding off-list reply back to the list..

- Robert

---------- Forwarded message ----------
From: Tobias Hansen <Tobias.Hansen at physik.uni-hamburg.de>
Date: Fri, Jan 20, 2012 at 5:20 PM
Subject: Re: [Cogl] Creating sliced textures from data and framebuffer
To: Robert Bragg <robert at sixbynine.org>


Thanks for these nice explanations! (Btw, I wrote to the mailing list
and you answered only to me.)

Am 20.01.2012 15:43, schrieb Robert Bragg:
> Hey,
>
> On Fri, Jan 20, 2012 at 11:50 AM, Tobias Hansen
>> * cogl_texture_2d_sliced_new_from_data: I found
>> cogl_texture_2d_sliced_new_from_bitmap
>> in the private header. I could use that, but that would require me to
>> copy data that
>> is already in memory to a bitmap.
>
> To avoid exposing lots of _new_from_data() texture constructors for
> all of the different texture types I was hoping that we could instead
> get away with just having _new_with_size() constructors for most of
> them and then you can set the data using cogl_texture_set_region().
>
> Hopefully that makes sense and would be ok for you?

That's fine. I already wondered how to set the data when using
_new_with_size(), but I didn't find cogl_texture_set_region().

>
>>
>> * Creating sliced textures from framebuffer to replace
>> glCopyTexImage2D and glCopyTexSubImage2D. Or is this already possible
>> somehow?
>
> Ah yeah this is a good point, we don't currently have api for doing
> this. My gut feeling is that we should add some common cogl_texture_
> api for this, something like cogl_texture_set_data_from_framebuffer()
> and then we would internally use apis like glCopyTexImage2D.

That would be lovely.


So if I want to use Cogl only for texture slicing, would it work if I
just create CoglMetaTextures instead of GL textures, and do drawing in
the callback from cogl_meta_texture_foreach_in_region? (I don't need
repeated texturing, every texture is drawn just once.)

cogl_texture_get_gl_texture() is in cogl-texture.h, but not in the
reference manual.

I didn't find a public API for CoglTexture->set_filters. Did I miss it,
if not would it make sense for you to add one? Or should I use
glTexParameter() in the foreach callback?

Best regards,
Tobias


More information about the Cogl mailing list