PDA

View Full Version : Assertion failed Error for VG_TRUE in Open VG



sowmyaa
04-28-2012, 05:19 AM
Hi,

I developed an Open VG application to draw a circle and a rectangle. The window is properly initialized and updated to the colour set in the code, but the circle and rectangle is not drawn in the screen.

When i run the application, I am getting the following errors in the hyper terminal:
*** ASSERTION FAILED in .\OpenVGApplication.cpp(138):
vgGetError() == VG_TRUE

*** ASSERTION FAILED in .\OpenVGApplication.cpp(140):
vgGetError() == VG_TRUE

*** ASSERTION FAILED in .\OpenVGApplication.cpp(144):
vgGetError() == VG_TRUE

*** ASSERTION FAILED in .\OpenVGApplication.cpp(146):
vgGetError() == VG_TRUE

*** ASSERTION FAILED in .\OpenVGApplication.cpp(148):
vgGetError() == VG_TRUE

*** ASSERTION FAILED in .\OpenVGApplication.cpp(150):
vgGetError() == VG_TRUE

*** ASSERTION FAILED in .\OpenVGApplication.cpp(153):
vgGetError() == VG_TRUE

*** ASSERTION FAILED in .\OpenVGApplication.cpp(155):
vgGetError() == VG_TRUE

*** ASSERTION FAILED in .\OpenVGApplication.cpp(157):
vgGetError() == VG_TRUE

*** ASSERTION FAILED in .\OpenVGApplication.cpp(161):
vgGetError() == VG_TRUE

*** ASSERTION FAILED in .\OpenVGApplication.cpp(164):
vgGetError() == VG_TRUE

*** ASSERTION FAILED in .\OpenVGApplication.cpp(166):
vgGetError() == VG_TRUE

*** ASSERTION FAILED in .\OpenVGApplication.cpp(168):
vgGetError() == VG_TRUE

*** ASSERTION FAILED in .\OpenVGApplication.cpp(170):
vgGetError() == VG_TRUE

*** ASSERTION FAILED in .\OpenVGApplication.cpp(173):
vgGetError() == VG_TRUE

*** ASSERTION FAILED in .\OpenVGApplication.cpp(176):
vgGetError() == VG_TRUE

*** ASSERTION FAILED in .\OpenVGApplication.cpp(178):
vgGetError() == VG_TRUE

*** ASSERTION FAILED in .\OpenVGApplication.cpp(181):
vgGetError() == VG_TRUE

*** ASSERTION FAILED in .\OpenVGApplication.cpp(183):
vgGetError() == VG_TRUE

*** ASSERTION FAILED in .\OpenVGApplication.cpp(186):
vgGetError() == VG_TRUE

*** ASSERTION FAILED in .\OpenVGApplication.cpp(188):
vgGetError() == VG_TRUE

My code is:
void CreateFilledRectangleCircle(void)
{
VGPath Rectangle;
VGPath Circle;
VGPaint fillRectangle;
VGPaint fillCircle;

/*Set White background colour*/
VGfloat color[4] = { 0.00f, 0.80f, 0.80f, 1.0f };//RGBA

/* Set the background colour*/
vgSetfv( VG_CLEAR_COLOR, 4, color );
vgClear( 0, 0, 500, 300);

/*Rectangle */
/*Create the path */
Rectangle = vgCreatePath(VG_PATH_FORMAT_STANDARD,VG_PATH_DATAT YPE_F, 1.0, 0, 0, 0,VG_PATH_CAPABILITY_ALL);
assert(vgGetError() == VG_TRUE);
VGubyte seg[] = {VG_MOVE_TO_ABS,VG_LINE_TO_REL,VG_LINE_TO_REL,VG_L INE_TO_REL,VG_LINE_TO_REL,VG_CLOSE_PATH};
assert(vgGetError() == VG_TRUE);
VGfloat coords[] = {50,100,250,0,0,100,-250,0,0,-100};

fillRectangle = vgCreatePaint();
assert(vgGetError() == VG_TRUE);
VGfloat Vertices[4] = {0.0f,0.4f,1.0f,1.0f};//Used to set colour to the rectangle. RBGA
assert(vgGetError() == VG_TRUE);
vgSetParameteri(fillRectangle,VG_PAINT_TYPE,VG_PAI NT_TYPE_COLOR);
assert(vgGetError() == VG_TRUE);
vgSetParameterfv(fillRectangle,VG_PAINT_COLOR,4,Ve rtices);
assert(vgGetError() == VG_TRUE);

vgSetPaint(fillRectangle,VG_FILL_PATH);
assert(vgGetError() == VG_TRUE);
vgAppendPathData(Rectangle,6,seg,coords);
assert(vgGetError() == VG_TRUE);
vgDrawPath(Rectangle,VG_FILL_PATH);
assert(vgGetError() == VG_TRUE);

/*Circle*/
Circle = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F, 1.0f, 0.0f, 0, 0, VG_PATH_CAPABILITY_ALL);
assert(vgGetError() == VG_TRUE);

fillCircle = vgCreatePaint();
assert(vgGetError() == VG_TRUE);
VGfloat colour[4] = {0.0f,0.5f,0.25f,1.0f};//Used to set colour to the circle. RBGA
assert(vgGetError() == VG_TRUE);
vgSetParameteri(fillCircle,VG_PAINT_TYPE,VG_PAINT_ TYPE_COLOR);
assert(vgGetError() == VG_TRUE);
vgSetParameterfv(fillCircle,VG_PAINT_COLOR,4,colou r);
assert(vgGetError() == VG_TRUE);

vgSetPaint(fillCircle,VG_FILL_PATH);
assert(vgGetError() == VG_TRUE);

vguEllipse( Circle, 400, 150, 100.0f, 100.0f );
assert(vgGetError() == VG_TRUE);
vgDrawPath( Circle, VG_FILL_PATH );
assert(vgGetError() == VG_TRUE);

vgDestroyPath( Rectangle );
assert(vgGetError() == VG_TRUE);
vgDestroyPaint(fillRectangle);
assert(vgGetError() == VG_TRUE);

vgDestroyPath( Circle );
assert(vgGetError() == VG_TRUE);
vgDestroyPaint(fillCircle);
assert(vgGetError() == VG_TRUE);

eglSwapBuffers(egldisplay, eglsurface);
assert(eglGetError() == EGL_SUCCESS);
}

Please help me in solving this.

Thanks and Regards,
Sowmya

Ivo Moravec
05-01-2012, 05:40 PM
The API document I have says that vgGetError() is defined as follows:
VGErrorCode vgGetError(void)
and where
VGErrorCode is an enum with values like (VG_NO_ERROR [=0], VG_BAD_HANDLE_ERROR [=0x1000], etc).

Did they change the spec?
Pity if they did - the call used to return lots of very useful information before... :-p

sowmyaa
05-02-2012, 12:16 AM
Hi,

I was checking for "VG_TRUE". I printed the value of the "vgGetError() " . Now i am getting "VG_NO_ERROR ". But nothing (rectangle and circle) is drawn in the window. The background colour is changing as per the value set in "color". Please help me in solving this issue.

Regards,
Sowmya