From 3b1a3531a754edd151b71db6b472e28913c73611 Mon Sep 17 00:00:00 2001 From: Tom Gall Date: Mon, 6 Oct 2014 21:19:21 -0500 Subject: Better but not quite perfect. VG Buffer image from vgReadPixels seems to be exactly backwords. --- tests/font/main.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/font/main.c b/tests/font/main.c index 10abf9a..992bbeb 100644 --- a/tests/font/main.c +++ b/tests/font/main.c @@ -492,7 +492,7 @@ GLuint CreateVGTexture2D(ESContext *esContext) glBindTexture ( GL_TEXTURE_2D, textureId ); // Load the texture - glTexImage2D ( GL_TEXTURE_2D, 0, GL_RGB, esContext->width, esContext->height, 0, GL_RGB, GL_UNSIGNED_BYTE, tgTextureBuffer); + glTexImage2D ( GL_TEXTURE_2D, 0, GL_RGBA, esContext->width, esContext->height, 0, GL_RGBA, GL_UNSIGNED_BYTE, tgTextureBuffer); // Set the filtering mode glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST ); @@ -578,7 +578,9 @@ void Draw ( ESContext *esContext ) TextMid((VGfloat)(esContext->width / 2),(VGfloat) ( esContext->height / 2),(char *) &text, SerifTypeface, esContext->width/10); // Greetings // End(); - f = VG_sARGB_8888; +// f = VG_sARGB_8888; + + f = VG_sRGBA_8888; vgReadPixels(tgTextureBuffer, esContext->width*sizeof(unsigned int), f, 0, 0, esContext->width, esContext->height); @@ -624,7 +626,7 @@ int main ( int argc, char *argv[] ) esContext.userData = &userData; DBG("Step 1. initial EGL"); - esCreateWindow ( &esContext, "Simple Texture 2D", WINDOW_W, WINDOW_H, ES_WINDOW_RGB ); + esCreateWindow ( &esContext, "Simple Font Test", WINDOW_W, WINDOW_H, ES_WINDOW_RGB ); Init(&esContext); initFont(); -- cgit v1.2.3