Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

- Brew Version. 3.1.5.
- OpenGL ES 1.1 extension installed.
- FP04 installed.

I am using a sample code "Triangle Drawing".

when it calls eglCreateWindowSurface(), the return value is 0. maybe it means fail.

I don't know why it is failed.

help me. please.

boolean Renderer::Create(IShell * shell, IDisplay * display)
{
mIGL = NULL;
mIEGL = NULL;

mDisplay = NULL;
mConfig = NULL;
mSurface = NULL;
mContext = NULL;
#ifdef RENDER_IGL
if (ISHELL_CreateInstance(shell, AEECLSID_GL, (void **)&mIGL) != SUCCESS)
{
Destroy();
return FALSE;
}

if (ISHELL_CreateInstance(shell, AEECLSID_EGL, (void **)&mIEGL) != SUCCESS)
{
Destroy();
return FALSE;
}

IGL_Init(mIGL);
IEGL_Init(mIEGL);
#else
EGL_Init( shell );
GLES_Init( shell );
#endif
mDisplay = eglGetDisplay(display);

if (mDisplay == EGL_NO_DISPLAY )
{
DBGPRINTF(" *** eglGetDisplay failed");
Destroy();
return FALSE;
}

EGLint major = 0;
EGLint minor = 0;

if (eglInitialize(mDisplay, &major, &minor) == FALSE)
{
DBGPRINTF(" *** eglInitialize failed");
Destroy();
return FALSE;
}

DBGPRINTF(" *** ES version %d.%d", major, minor);

EGLint numConfigs = 1;
if (eglGetConfigs(mDisplay, &mConfig, 1, &numConfigs) == FALSE)
{
DBGPRINTF(" *** eglGetConfigs failed");
Destroy();
return false;
}

IBitmap * DeviceBitmap = NULL;
IDIB * DIB = NULL;

if (IDISPLAY_GetDeviceBitmap(display, &DeviceBitmap) != SUCCESS)
{
DBGPRINTF(" *** IDISPLAY_GetDeviceBitmap failed");
Destroy();
return FALSE;
}

if (IBITMAP_QueryInterface(DeviceBitmap, AEECLSID_DIB, (void**)&DIB) != SUCCESS)
{
DBGPRINTF(" *** IBITMAP_QueryInterface failed");
IBITMAP_Release(DeviceBitmap);
Destroy();
return FALSE;
}

EGLint params[5] = {EGL_NONE, EGL_NONE, EGL_NONE, EGL_NONE, EGL_NONE};
mSurface = eglCreateWindowSurface(mDisplay, mConfig, DIB, params); // here!!!!!!!!!!!

I was having this exact same problem.
The only way I could get it to work, was to replace the OpenGLESExtension.dll that 1.1.1 installed with the 1.0.3 version of the extension.
Not sure if its a bug in 1.1.1 or not.

I was having this exact same problem.
The only way I could get it to work, was to replace the OpenGLESExtension.dll that 1.1.1 installed with the 1.0.3 version of the extension.
Not sure if its a bug in 1.1.1 or not.

I have this same problem. but when it calls eglGetConfigs(), the return value is 0.why?

I have this same problem. but when it calls eglGetConfigs(), the return value is 0.why?