micahpearlman/MonkVG — Issue #4: glColor3f overriding paint
Author: Matt-Esch
Created: 2012-01-22 13:56:30+00:00
State: open

glColor3f(1,1,0) sets the current color to yellow. If I create a red paint and set the paint before drawing, things still appear yellow.

In setup:

// create a paint
_paint = vgCreatePaint();
vgSetPaint(_paint, VG_FILL_PATH );
VGfloat color[4] = { 1.0f, 0.0f, 0.0f, 1.0f };
vgSetParameterfv(_paint, VG_PAINT_COLOR, 4, &color[0]);

// create a box path
_path = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F,1,0,0,0, VG_PATH_CAPABILITY_ALL);
vguRect( _path, 0, 0, 64.0f, 64.0f );

In render loop:

glColor3f(1, 1, 0);
vgSeti(VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE);
vgLoadIdentity();
vgTranslate( 0, 0 );

vgSetPaint( _paint, VG_FILL_PATH );
vgDrawPath( _path, VG_FILL_PATH ); // Square is yellow not red