Re: [GtkGLExt] Pango rendering



On 04.7.17 6:32 AM, "Tristan Van Berkom" <vantr touchtunes com> wrote:

>   I've been fooling around with gtkglext packages in conjunction
> with sonar spectrum analysis (I cant believe my job actualy pays
> me for that ;-) to create groovy OpenGL plugins with album jackets
> and song titles etc.
> 
>   I've noticed in the example codes in gtkglext that rendering fonts
> to texture surfaces from pango layouts requires some intimate knowlage
> of the FreeType bitmap, i.e. code that looks like:
> 
> do {
>  row -= bitmap.width;
>  for (i = 0; i < bitmap.width; i++)
> #if !defined(GL_VERSION_1_2) && G_BYTE_ORDER == G_LITTLE_ENDIAN
>     *t++ = rgb | (((guint32) (a * row[i])) << 24);
> #else
>     *t++ = rgb | ((guint32) (a * row[i]));
> #endif
> } while (row != row_end);
> 
> Right now, the only way I see around this (admitting that I only spent the
> afternoon on this bugger) is possibly using gdk_draw_layout() onto an
> offscreen GdkPixmap, and obtaining the pixeldata to feed to glTexSubImage2D.
> 
> And even there, I might have to go to quite an extent to obtain the pixel
> data (GdkPixmap --> GdkPixbuf --> GdkPixdata ?).
> 
> As I draft this email, I'm thinking, what if we were to derive a GdkDrawable
> that represents an OpenGL texture ? (maybe that would be a little too rigid ?)
> 

Hmm... I cannot see the necessity of new GdkDrawable for OpenGL texture.
We can use GdkPixbuf to load texture data.

Regards,
--Naofumi




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]