el_pango
Member
Good morning,
In my code, I'm doing the following:
	
	
	
		
(Some error checks have been removed from the above for brevity's sake, but all the previous steps seem to complete cleanly.)
I more or less copied what I saw in WakeBreaker, but alas, no luck.
What kinds of things could cause creating a context to fail (especially after EGL was happy about everything else)? Is there the equivalent of 'errno' that I can check to see what made it unhappy?
edit: This is on the target device itself.
				
			In my code, I'm doing the following:
		Code:
	
	#define DUH_WHERE_AM_I(x) fprintf(stderr,"%s, ln %d: %s\n",__FILE__,__LINE__,x)
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <GLES/gl.h>
#include <GLES/egl.h>
static EGLint const attributes[] =
{
	EGL_BLUE_SIZE,	5,
	EGL_GREEN_SIZE, 6,
	EGL_RED_SIZE, 	5,
	EGL_DEPTH_SIZE,	16,
	EGL_NONE
};
static EGLDisplay	egl_disp	= 0;
static EGLSurface	egl_surface	= 0;
static EGLContext	egl_context	= 0;
static Window		my_window	= 0;
Display*		disp	= 0;
/* later on */
	disp = XOpenDisplay(NULL);
	screen = DefaultScreen(disp);
	root_window = RootWindow(disp,screen);
	my_window = XCreateSimpleWindow(disp, root_window,0,0,SCRN_W,SCRN_H,0,0,0);
	XUndefineCursor(disp, my_window);
	XMapRaised(disp,my_window);
	XFlush(disp);
	egl_disp = eglGetDisplay((NativeDisplayType)disp);
	result = eglInitialize(egl_disp, NULL, NULL);
	result = eglChooseConfig(egl_disp,attributes,&gl_config,1,&num_gl_configs);
        egl_surface = eglCreateWindowSurface(egl_disp, gl_config,(NativeWindowType)my_window,NULL);
	/* finally, try to create the context and set it up	*/
	/* use.							*/
	egl_context = eglCreateContext(egl_disp, gl_config, EGL_NO_CONTEXT, attributes);
	if(egl_context == EGL_NO_CONTEXT)
	{
		DUH_WHERE_AM_I("Couldn't create the EGL context...");
		clean_up_gl();
		clean_up_x();
		exit(1);
	}
	(Some error checks have been removed from the above for brevity's sake, but all the previous steps seem to complete cleanly.)
I more or less copied what I saw in WakeBreaker, but alas, no luck.
What kinds of things could cause creating a context to fail (especially after EGL was happy about everything else)? Is there the equivalent of 'errno' that I can check to see what made it unhappy?
edit: This is on the target device itself.
	