Hi Robert,
attached is a patch for getting a Window+Context on the N900 with OpenGL
ES 2.0
- eglBindAPI should be done before any egl* call
- the defaults for EGL_<COLOR>_SIZE is 0 and can be set safely to
EGL_DONT_CARE
- some old PowerVR drivers (as on the N900) need twice EGL_NONE to
terminate the list
Cheers,
Hartmut
--
Hartmut Seichter, PhD (HKU), Dipl.-Ing. (BUW)
Index: src/osgViewer/GraphicsWindowX11.cpp
===================================================================
--- src/osgViewer/GraphicsWindowX11.cpp (revision 12681)
+++ src/osgViewer/GraphicsWindowX11.cpp (working copy)
@@ -718,6 +718,7 @@
Context sharedContext = graphicsHandleX11 ?
graphicsHandleX11->getContext() : 0;
#ifdef OSG_USE_EGL
+ eglBindAPI(EGL_OPENGL_ES_API);
_valid = _ownsWindow ? createWindow() : setWindow(windowHandle);
@@ -739,14 +740,15 @@
#endif
EGLint configAttribs[] = {
+ EGL_RENDERABLE_TYPE, OSG_EGL_OPENGL_TARGET_BIT,
+ EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
EGL_SAMPLE_BUFFERS, 0,
EGL_SAMPLES, 0,
- EGL_RED_SIZE, 1,
- EGL_GREEN_SIZE, 1,
- EGL_BLUE_SIZE, 1,
- EGL_DEPTH_SIZE, 1,
- EGL_RENDERABLE_TYPE, OSG_EGL_OPENGL_TARGET_BIT,
- EGL_NONE
+ EGL_RED_SIZE, EGL_DONT_CARE,
+ EGL_GREEN_SIZE, EGL_DONT_CARE,
+ EGL_BLUE_SIZE, EGL_DONT_CARE,
+ EGL_DEPTH_SIZE, EGL_DONT_CARE,
+ EGL_NONE, EGL_NONE /* needed for old PowerVR drivers */
};
int numConfigs;
@@ -759,16 +761,14 @@
return;
}
- eglBindAPI(EGL_OPENGL_ES_API);
-
_eglSurface = eglCreateWindowSurface(_eglDisplay, eglConfig,
(EGLNativeWindowType)_window, NULL);
if (_eglSurface == EGL_NO_SURFACE)
{
OSG_NOTICE<<"GraphicsWindowX11::init() -
eglCreateWindowSurface(..) failed."<<std::endl;
- XCloseDisplay( _display );
- _valid = false;
- _display = 0;
- return;
+ XCloseDisplay( _display );
+ _valid = false;
+ _display = 0;
+ return;
}
#if defined(OSG_GLES1_AVAILABLE)
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org