Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - eglChooseConfig and EGL_RENDERABLE_TYPE EGL_OPENVG_BIT: (5 Items)
   
eglChooseConfig and EGL_RENDERABLE_TYPE EGL_OPENVG_BIT  
Hello:

I am trying to insure that the egl config I use has the EGL_OPENVG_BIT set for the renderable_type.

This is on an i.MX35.

I tried modifying the sample gles1-kd-gears app to set the EGL_OPENVG_BIT for the renderable type (in the egl_conf_attr 
struct).  However, eglChooseConfig returns 0 configs.  From looking at the sysres output from io-winmgr, it would appear
 that EGL_OPENVG_BIT is available on several of the configs.

Why does eglChooseConfig not find the appropriate config?
Re: eglChooseConfig and EGL_RENDERABLE_TYPE EGL_OPENVG_BIT  
If you provide us with the attrib list you are passing to eglChooseConfig, we should be able to tell you the exact cause
 of the error. I suspect that it is returning 0 configs because you are asking for EGL_OPENVG_BIT renderable type with a
 EGL_DEPTH_SIZE which isn't 0.
Re: eglChooseConfig and EGL_RENDERABLE_TYPE EGL_OPENVG_BIT  
You are correct; Here's my (current) version of the attrs section from gles1-kd-gears.c:

struct {
    EGLint surface_type[2];
    EGLint renderable_type[2];
    EGLint depth_size[2];
    EGLint level[2];
    EGLint transparent_type[2];
    EGLint red_size[2];
    EGLint green_size[2];
    EGLint blue_size[2];
    EGLint alpha_size[2];
    EGLint sample_buffers[2];
    EGLint samples[2];
    EGLint config_id[2];
    EGLint none;
} egl_conf_attr = {
    .surface_type = { EGL_SURFACE_TYPE, EGL_WINDOW_BIT },
    .renderable_type = { EGL_RENDERABLE_TYPE, EGL_OPENVG_BIT },
    .depth_size = { EGL_DEPTH_SIZE, 0 },
    .level = { EGL_LEVEL, 0 },
    .transparent_type = { EGL_TRANSPARENT_TYPE, EGL_DONT_CARE },
    .red_size = { EGL_RED_SIZE, EGL_DONT_CARE },
    .green_size = { EGL_GREEN_SIZE, EGL_DONT_CARE },
    .blue_size = { EGL_BLUE_SIZE, EGL_DONT_CARE },
    .alpha_size = { EGL_ALPHA_SIZE, EGL_DONT_CARE },
    .sample_buffers = { EGL_SAMPLE_BUFFERS, 0 },
    .samples = { EGL_SAMPLES, 0 },
    .config_id = { EGL_CONFIG_ID, EGL_DONT_CARE },
    .none = EGL_NONE
};

That works (I find a config in eglChooseConfigs()).

However, with that configuration, eglCreateContext() returns EGL_NO_CONTEXT, and eglGetError() returns EGL_BAD_CONFIG.

So, while eglChooseConfig() found a config, eglCreateContext() cannot use it?

as an aside, here's what I get now when I use the verbose flag to the gles1-kd-gears sample app:

EGL_VENDOR = QNX Software Systems
EGL_VERSION = 1.4
EGL_CLIENT_APIS = OpenGL_ES OpenVG 
EGL_EXTENSIONS = EGL_KHR_lock_surface EGL_QNX_gf_surface EGL_QNX_swap_interval

EGL_CONFIG_ID = 2
EGL_RED_SIZE = 8
EGL_GREEN_SIZE = 8
EGL_BLUE_SIZE = 8
EGL_ALPHA_SIZE = 8
EGL_DEPTH_SIZE = 0
EGL_LEVEL = 0
EGL_NATIVE_RENDERABLE = EGL_FALSE
EGL_NATIVE_VISUAL_TYPE = 5152
EGL_RENDERABLE_TYPE = 0x0002
EGL_SURFACE_TYPE = 0x0487
EGL_TRANSPARENT_TYPE = EGL_NONE

I'm assuming that EGL_NATIVE_REDNERABLE being false is the issue here.  So... does this imply that I cannot use EGL with
 an OPENVG config? From looking through my sysres output, it would appear that every config with the EGL_OPENVG_BIT 
renderable type has native_renderable as "no".
Re: eglChooseConfig and EGL_RENDERABLE_TYPE EGL_OPENVG_BIT  
I suspect it's simpler than that. Make sure you call eglBindAPI prior to calling eglCreateContext. With EGL, the current
 API defaults to OpenGL ES if it is supported, or to EGL_NONE otherwise. For OpenVG, you have to set it explicitely with
 eglBindAPI.
Re: eglChooseConfig and EGL_RENDERABLE_TYPE EGL_OPENVG_BIT  
Awesome!  Thanks.. that works.