Hi
I am a beginner inOpenGL ES 2.0,and get a problem,
After decompress Mali_OpenGL_ES_2.0_SDK_for_Linux_On_ARM_v1.2.0.9310_Linux.tar.gz
and install Sourcery CodeBench Lite Edition for ARM (arm-2013.05-24-arm-none-linux-gnueabi.bin),
build the sample (Cube)
bash build-x86-linux.sh Cube succeed
cd build/x86/Cube
ls
assets Cube
./Cube
Error: eglGetError() = 12291 (0x00003003) at /home/pass2014/Software/Mali_OpenGL_ES_2.0_SDK_for_Linux_On_ARM_v1.2.0/samples/linux/Cube/Cube.cpp:177
code
int main(void)
{
/* Intialize the Platform object for platform specific functions. */
Platform* platform = Platform::getInstance();
/* Initialize windowing system. */
platform->createWindow(WINDOW_W, WINDOW_H);
/* Initialize EGL. */
EGLRuntime::initializeEGL(EGLRuntime::OPENGLES2);
EGL_CHECK(eglMakeCurrent(EGLRuntime::display, EGLRuntime::surface, EGLRuntime::surface, EGLRuntime::context)); //line 177
/* Initialize OpenGL ES graphics subsystem. */
setupGraphics(WINDOW_W, WINDOW_H);
/* Timer variable to calculate FPS. */
Timer fpsTimer;
fpsTimer.reset();
bool end = false;
/* The rendering loop to draw the scene. */
while(!end)
/* If something has happened to the window, end the sample. */
if(platform->checkWindow() != Platform::WINDOW_IDLE)
end = true;
}
/* Calculate FPS. */
float fFPS = fpsTimer.getFPS();
if(fpsTimer.isTimePassed(1.0f))
LOGI("FPS:\t%.1f\n", fFPS);
/* Render a single frame */
renderFrame();
/*
* Push the EGL surface color buffer to the native window.
* Causes the rendered graphics to be displayed on screen.
*/
eglSwapBuffers(EGLRuntime::display, EGLRuntime::surface);
/* Shut down OpenGL ES. */
/* Shut down Text. */
delete text;
/* Shut down EGL. */
EGLRuntime::terminateEGL();
/* Shut down windowing system. */
platform->destroyWindow();
/* Shut down the Platform object. */
delete platform;
return 0;
What should I do to fix the problem?
Thanks
Hi mofeng,
looking at the egl.h header file here: http://www.khronos.org/registry/egl/api/1.1/EGL/egl.h
we see this definition:
#define EGL_BAD_ALLOC 0x3003
So it's a bad alloc error. If we take a quick look at the EGL specification here: https://www.khronos.org/registry/egl/sdk/docs/man/xhtml/eglMakeCurrent.html
it looks as though the reason might be
EGL_BAD_ALLOC may be generated if allocation of ancillary buffers for draw or read were delayed until eglMakeCurrent is called, and there are not enough resources to allocate them.
EGL_BAD_ALLOC
draw
read
eglMakeCurrent
so something about initializing the window system or EGL went wrong I think.
Can you tell us more about your platform? Are you using the X Window System, or a framebuffer device?
Thanks, Pete