EGL ??

Options
Brian Beuken
Brian Beuken New Member Posts: 35
edited September 2017 in UP Squared Linux
Running Ubilinux I wanted to try a simple hello triangle program, but I am failing to get EGL to initialise
I get
libEGL warning: DRI3: xcb_connect failed
libEGL warning: DRI2: xcb_connect failed
libEGL warning: DRI2: xcb_connect failed

Display was returned ok,

I'm using Mesa drivers for OpenGLES2.0

Any ideas why I can't get eglnitialize to work?

EDIT...looking at my VisualGDB debug settings I noticed it was set to having no X11 windows, changing that to display on target, appears to fix it...there are other issues, though just as i was starting to feel pleased with myself...see the other entries in this thread.

Comments

  • Brian Beuken
    Brian Beuken New Member Posts: 35
    edited September 2017
    Options
    hmm I managed to get an X11 version of Hello Triangle to work is that the only way to get graphics on this?
  • Brian Beuken
    Brian Beuken New Member Posts: 35
    edited September 2017
    Options
    How strange, I got a basic Hello Triangle working using X11 as a native window as per the normal GLES2.0 GoldBook example.

    But the exact same code in my demo project, throws up a strange error
    /*
    	     * X11 native display initialization
    	     */
    
    	x_display = XOpenDisplay(NULL);
    	
    	if (x_display == NULL)
    	{
    		return ;
    	}
    
    	root = DefaultRootWindow(x_display);
    
    	swa.event_mask  =  ExposureMask | PointerMotionMask | KeyPressMask;
    	win = XCreateWindow(
    	    x_display,
    		root,
    		0,
    		0,
    		state->width,
    		state->height,
    		0,
    		CopyFromParent,
    		InputOutput,
    		CopyFromParent,
    		CWEventMask,
    		&swa);
    
    	xattr.override_redirect = FALSE;
    	XChangeWindowAttributes(x_display, win, CWOverrideRedirect, &xattr);
    
    	hints.input = TRUE;
    	hints.flags = InputHint;
    	XSetWMHints(x_display, win, &hints);
    	char* title = (char*)"x11 windpw";
    	    // make the window visible on the screen
    	XMapWindow(x_display, win);
    	XStoreName(x_display, win, title);
    
    	    // get identifiers for the provided atom name strings
    	wm_state = XInternAtom(x_display, "_NET_WM_STATE", FALSE); <<<<<< This reports an error
    
    	memset(&xev, 0, sizeof(xev));
    	xev.type                 = ClientMessage;
    	xev.xclient.window       = win;
    	xev.xclient.message_type = wm_state;
    	xev.xclient.format       = 32;
    	xev.xclient.data.l[0]    = 1;
    	xev.xclient.data.l[1]    = FALSE;
    	XSendEvent(
    	  x_display,
    		DefaultRootWindow(x_display),
    		FALSE,
    		SubstructureNotifyMask,
    		&xev);
    

    The error returned in the output causing the app to shut down is
    X Error of failed request: BadValue (integer parameter out of range for operation)
    Major opcode of failed request: 1 (X_CreateWindow)
    Value in failed request: 0x0
    Serial number of failed request: 7
    Current serial number in output stream: 12

    So it appears X_CreateWindow is not happy.
    x_display is a static pointer in global memory and it is cleared before use.
    static Display* x_display = NULL;

    x_display = XOpenDisplay(NULL); did seem to return a valid value, (it returns NULL if it fails)
    root = DefaultRootWindow(x_display); also returned a value, though it was not the value I got from the Hello Triangle example ($de), this was ($222)
    I set the demo window size the same as hello triangle 320x240 just to try to replicate all the conditions Hello Triangle had in the Demo.

    Take note that the demo is a much larger project, so I expect location of the x_display would be different, but I sorta expected root to be the same for both examples.
    Also these are initialization systems to get a screen to draw too, and in that sense both set ups are the 1st things the demo's do.

    I'm a bit lost....any one got any ideas? Clearly something is different between the two projects but I am not sure what.
  • Brian Beuken
    Brian Beuken New Member Posts: 35
    Options
    Ok as I suspected I'm an idiot, I hadn't setup the screen height and width....doh!

    So now I have a window open, opengl is reporting everything fine, but as yet..nothing on screen, I will keep trying.

    I have noticed though that the intel graphics are very fussy about the format of their shaders, ARM GPU's are a lot more fogiving of size mismatches on 4x4Matrix*vec3 vectors.
    hey ho, its all about learning.
Privacy Policy