Hi
I use OpenGL ES 1.0 under Gizmondo (system WindowsCE) the opportunity to write at once in битмэп was necessary, but it has appeared that eglCreatePixmapSurface there does not work (is not supported) It was necessary to use Pbuffer - eglCreatePbufferSurface is supported
My initialization of OGLES:
static EGLDisplay FrameworkGL_Display;
static EGLConfig FrameworkGL_Config;
static EGLContext FrameworkGL_Context;
static EGLSurface FrameworkGL_WindowSurface;
bool GLInitialize()
{
EGLint configAttribs[] =
{
EGL_SURFACE_TYPE, EGL_PBUFFER_BIT,
EGL_NONE
};
EGLint numConfigs;
EGLint majorVersion;
EGLint minorVersion;
FrameworkGL_Display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
eglInitialize(FrameworkGL_Display, &majorVersion, &minorVersion);
eglChooseConfig(FrameworkGL_Display, configAttribs, &FrameworkGL_Config, 1, &numConfigs);
FrameworkGL_Context = eglCreateContext(FrameworkGL_Display, FrameworkGL_Config, EGL_NO_CONTEXT, NULL);
// FrameworkGL_WindowSurface = eglCreateWindowSurface(FrameworkGL_Display, FrameworkGL_Config, hWndApp, NULL);
EGLint Attribs[] =
{
EGL_WIDTH, 320,
EGL_HEIGHT, 240,
EGL_NONE
};
FrameworkGL_WindowSurface = eglCreatePbufferSurface(FrameworkGL_Display, FrameworkGL_Config, Attribs);
eglMakeCurrent(FrameworkGL_Display, FrameworkGL_WindowSurface, FrameworkGL_WindowSurface, FrameworkGL_Context);
return true;
}
My Rendering
void Render()
{
glClearColor(1.0, 1.0, 0, 0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
DrawMyObjects();
// glFinish();
// eglSwapBuffers(FrameworkGL_GetDisplay(), FrameworkGL_GetSurface());
EGLBoolean result = eglCopyBuffers(FrameworkGL_GetDisplay(), FrameworkGL_GetSurface(), iMemDC);
glFlush();
InvalidateRect(hWndApp, NULL, TRUE);
}
case WM_PAINT:
if (gl_bIsInitialized == false)
{
gl_hMainDC = BeginPaint( hWnd, &ps );
iMemDC = CreateCompatibleDC(gl_hMainDC);
iMemScreen = CreateCompatibleBitmap(gl_hMainDC, GetDeviceCaps(gl_hMainDC, HORZRES), GetDeviceCaps(gl_hMainDC, VERTRES));
iOldMemScreen = (HBITMAP)SelectObject(iMemDC, iMemScreen);
gl_bIsInitialized = true;
}
// test/debug rectangle
SelectObject(iMemDC, hBrush);
Rectangle(iMemDC, 40, 40, 280, 200);
BitBlt(gl_hMainDC, 0, 0, 320, 240, iMemDC, 0, 0, SRCCOPY);
// EndPaint( hWnd, &ps );
As a result on the screen only a rectangle on a black background - though on idea should be also mine 3d Objects on a yellow background?
Why? HELP