PDA

View Full Version : vgGeti(VG_MAX_IMAGE_WIDTH) returning 0



g6r6e6g
06-24-2010, 02:44 AM
Hello,

I m trying to use EGL over OpenVG to initialize 1 offscreen surface,
but after initialization, vgGeti() on VG_MAX_IMAGE_WIDTH and HEIGTH
return 0 instead of something like 2048 ...

Did I miss something during my initialization ?

Thank you for your help


egl_display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
if (!eglInitialize(egl_display, &major, &minor)) {
if (!eglBindAPI(EGL_OPENVG_API)) {
if (!eglChooseConfig(egl_display, configAttrs, &config, 1, &numConfigs)) {
egl_context = eglCreateContext(egl_display, config, EGL_NO_CONTEXT, contextAttrs);

=> check width and height
if (width > vgGeti (VG_MAX_IMAGE_WIDTH) ||
height > vgGeti (VG_MAX_IMAGE_HEIGHT))
{
fprintf(stderr, "Surface creation failed, size %dx%d exceeding %dx%d .\n", width, height, vgGeti (VG_MAX_IMAGE_WIDTH), vgGeti (VG_MAX_IMAGE_HEIGHT));
return -1;
}

image = vgCreateImage (format, width, height, VG_IMAGE_QUALITY_BETTER);

ebenupton
07-07-2010, 06:33 AM
Hi
I believe you need to make the context current (and probably create a surface to render to as well).

Regards
Eben