PDA

View Full Version : Possible to use OpenVG on Symbian?



tangobravo
09-15-2009, 08:52 AM
Hi all

I've got a new Symbian phone (Samsung i8910) based on S60 5th Edition. It uses an OMAP 3-something with the SGX hardware, and definitely supports Open GL ES, and I thought the hardware also supported OpenVG. Is it possible to use OpenVG under symbian?

The SDKs are generally old and a bit rubbish. There is a libopenvg available for linking to, but the egl headers in the latest SDK are only version 1.1. Doing eglQueryString(..., EGL_VERSION) showed the phone has egl 1.4. I hacked around the reference headers for a more recent egl so a could compile eglQueryString(..., EGL_CLIENT_APIS) which worked, but only returned "OpenGL_ES". However I'm not sure if that's just down to my hackery and if it is possible to install something to the phone to enable OpenVG?

OpenVG is mentioned in the nokia docs:
http://www.forum.nokia.com/infocenter/i ... vg_8h.html (http://www.forum.nokia.com/infocenter/index.jsp?topic=/S60_5th_Edition_Cpp_Developers_Library/GUID-759FBC7F-5384-4487-8457-A8D4B76F6AA6/html/openvg_8h.html)

The header files there were nowhere to be found in the SDK, so again I hacked the files together from the "go to the source code" links from the documentation pages.

If anyone has had success with OpenVG on a symbian device, let me know please!

Simon

Ivo Moravec
09-17-2009, 09:00 AM
I don't know how - if it's possible at all - to directly access the Hardware OpenVG stuff on that platform.
Try checking for updated drivers (which you've probably already done). But just because the hardware can support something, doesn't necessarily mean the driver for it does though :(

You could try the ShivaVG / Mesa versions of VG which work on top of OpenGL to just "get something working" in the meantime.

Kari Pulli
09-24-2009, 11:07 AM
There's no official support for application developers to use the libopenvg yet on Symbian.
Currently only manufacturers can use it internally.
Official support should come later.

polarpeder
11-11-2009, 09:57 AM
Hi.

I'm having somewhat the same problem. Using a prototype Sony Ericsson device which is pretty much the same as the Samsung i8910 under the hood (Symbian 9.3, PVR SGX chipset etc).

On my device eglQueryString( .. , EGL_CLIENT_APIS) do infact return "OpenGL_ES OpenVG", so that's a plus.
I'm linking with libopenvg.lib found in the S60_5th_Edition_v1.0 SDK also using my own (khronos EGL and openVG headers). There is a libopenvg.dll present on the device which seems to somewhat work.

vgGetString gives me this info:
Vendor: Nokia
Version: 1.0
Renderer: OpenVG 1.0.1 (Fixed)
Extensions: <empty>

My problem comes when I try to set it all up. I can't seem to be able to retrieve an egl context when I've bound the OpenVG API. Eighter it's flat out non-supported, or there's something i'm doing wrong. Here's my initialisation sequence:



eglBindAPI(EGL_OPENVG_API);
display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
eglInitialize( display, &major, &minor );

static const EGLint configAttribs[] =
{
EGL_RED_SIZE, 8,
EGL_GREEN_SIZE, 8,
EGL_BLUE_SIZE, 8,
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
EGL_RENDERABLE_TYPE, EGL_OPENVG_BIT,
EGL_NONE
};
eglChooseConfig( display, configAttribs, &egl_config, 1, &num_configs);

static const EGLint surfAttribs[] =
{
EGL_COLORSPACE, EGL_COLORSPACE_sRGB,
EGL_ALPHA_FORMAT, EGL_ALPHA_FORMAT_PRE,
EGL_NONE
};

eglCreateWindowSurface( display, egl_config, hwnd, surfAttribs);

eglCreateContext( display, egl_config, NULL, NULL);
// This is where it fails. EGL_NO_CONTEXT is returned and eglGetError tells me EGL_NOT_INITIALIZED


None of the previous steps fails or yield any error, only that last CreateContext. I can't really understand why
it says that EGL isn't initialized when eglInitialize returns successful.

Ivo Moravec
11-11-2009, 12:56 PM
Use eglGetError() to find more information (preferably after every egl statement - and especially after the one that failed).
It's possible that there is some issue with the config you are trying to set (you did verify it is returning one valid config I hope right?). Try other bit depths like rgb565, and also try leaving out the EGL_SURFACE_TYPE and EGL_RENDERABLE_TYPE attributes from the config attribute list. Maybe you're choosing some wonky non-standard config because of them.

If the driver is reporting that VG is supported though, then it probably is.
--
edit:
You might also want to try calling eglBindAPI() after eglInitialize().
I think, eglGetDisplay() is the only call designed to work before eglInitialize().