Multiuple window surface

Hello,
Please take a look to this code.

////////////////////////////////////////////////
EGLDisplay eglDisplay = 0;
EGLConfig eglConfig = 0;
EGLSurface eglSurface = 0;
EGLSurface eglSurfacetmp= 0;

EGLContext eglContext = 0;

eglDisplay = eglGetDisplay((NativeDisplayType)0);
EGLint iMajorVersion, iMinorVersion;
if (!eglInitialize(eglDisplay, &iMajorVersion, &iMinorVersion))
{
	printf("Error: eglInitialize() failed.

");
goto cleanup;
}
EGLint pi32ConfigAttribs[3];
pi32ConfigAttribs[0] = EGL_SURFACE_TYPE;
pi32ConfigAttribs[1] = EGL_WINDOW_BIT;
pi32ConfigAttribs[2] = EGL_NONE;
int iConfigs;
if (!eglChooseConfig(eglDisplay, pi32ConfigAttribs, &eglConfig, 1, &iConfigs) || (iConfigs != 1))
{
printf("Error: eglChooseConfig() failed.
");
goto cleanup;
}
eglSurface = eglCreateWindowSurface(eglDisplay, eglConfig, (NativeWindowType)0, NULL);
if (!TestEGLError(“eglCreateWindowSurface”))
{
goto cleanup;
}
eglSurfacetmp = eglCreateWindowSurface(eglDisplay, eglConfig, (NativeWindowType)0, NULL);
if (!TestEGLError(“eglCreateWindowSurface”))
{
goto cleanup;
}

////////////////////////////////////////////////

I would like to know if there’s an OpenGLES 1.x specicifation restriction on the number of window surfaces that we can create, in fact, as shown in the previous example, secondary surface creation always fails.

Thank you in advance.
gpgnews

What’s the EGL error that you’re getting? I’m surprised the first call to eglCreateWindowSurface isn’t failing since you’re passing in a NULL window handle to each call.

You cannot have more than one EGLWindowSurface for a specific window (in this case, the whole screen). That’s an EGL restriction. What do you want to achieve with two surfaces for the same window?

That’s fine on an implementation without window system, and creates a surface for the entire screen.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.