Results 1 to 7 of 7

Thread: eglInitialize crash

  1. #1

    eglInitialize crash

    eglInitialize is crashing on my MX31 device. Parameters given are:

    1) an EGLDisplay recieved after an eglGetDisplay of the default display type. This parameter has the integer value of 1.
    2)NULL
    3)NULL

    Any idea of ANYTHING that could cause a crash in this function? Appreciate ur help!

  2. #2
    It shouldn't crash. Passing null-pointers for the major and minor version number is valid according to the standard.

    However, my first try would be to pass valid pointers to the two last parameters and see if it works that way..

  3. #3

    what does eglInitialize do?

    Nope, that doesnt work either.

    My hunch is that its not the eglInitialize code that is crashing. But if I skip eglInitialize(along with some other gl and egl calls), the application runs fine, ofcourse, without UI.

    Does eglInitialize start some thread or call some code somewhere that could crash under certain conditions?

    If possible, could someone please summarize in simple terms what eglInitialize really does internally. Not much info out there on this.

    Thanks alot for your help!

  4. #4
    Senior Member
    Join Date
    May 2006
    Posts
    353

    Re: what does eglInitialize do?

    Quote Originally Posted by akhil
    If possible, could someone please summarize in simple terms what eglInitialize really does internally. Not much info out there on this.
    That is entirely implementation dependent.

    Could you give some more details on the platform you are using?
    Georg Kolling, Imagination Technologies
    Please ask questions specific to PowerVR hardware or SDKs on the PowerVR Insider Forum
    DevTech@imgtec.com | http://www.powervrinsider.com

  5. #5
    Its on an MX31 platform, ARM processor.

  6. #6
    Quote Originally Posted by akhil
    Its on an MX31 platform, ARM processor.
    Try this (it's my EGL initialization code, tested also on iMX31):

    Code :
    int initEGL() {
     
    	EGLint majorVersion, minorVersion;
    	EGLConfig *configList = NULL;
    	EGLint numOfConfigs = 0; 
    	EGLint configSize = 0;
    	const EGLint attrib_list_fsaa[] = {
    		EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
    		EGL_BUFFER_SIZE, 16,
    		EGL_DEPTH_SIZE, 24,
    		EGL_STENCIL_SIZE, EGL_DONT_CARE,
    		EGL_SAMPLE_BUFFERS, 1,
    		EGL_SAMPLES, 4,
    		EGL_NONE
    	};
    	const EGLint attrib_list[] = {
    		EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
    		EGL_BUFFER_SIZE,  16,
    		EGL_DEPTH_SIZE, 24,
    		EGL_STENCIL_SIZE, EGL_DONT_CARE,
    		EGL_NONE
    	};
     
    	eglDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
    	if (eglDisplay == EGL_NO_DISPLAY) {
    		printf("eglGetDisplay failed!\n");
    		return 0;
    	}
    	else
    		printf("eglGetDisplay OK!\n");
     
    	if (eglInitialize(eglDisplay, &majorVersion, &minorVersion) == EGL_FALSE) {
    		printf("eglInitialize failed!\n");
    		return 0;
    	}
    	else
    		printf("eglInitialize OK: %d.%d\n", majorVersion, minorVersion);
     
    	if (eglGetConfigs(eglDisplay, configList, configSize, &numOfConfigs) == EGL_FALSE) {
    		printf("eglGetConfigs failed!\n");
    		return 0;
    	}
    	else
    		printf("eglGetConfigs OK!\n");
     
    	configSize = numOfConfigs;
    	configList = (EGLConfig *)malloc(sizeof(EGLConfig) * configSize);
    	if (configList == NULL) {
    		printf("Memory allocation to store EGL configurations failed!\n");
    		return 0;
    	}
    	else
    		printf("Memory allocation to store EGL configurations OK!\n");
     
    	if (eglChooseConfig(eglDisplay, attrib_list_fsaa, configList, configSize, &numOfConfigs) == EGL_FALSE) {
    		printf("eglChooseConfig FSAA failed!\n");
    		return 0;
    	}
    	else
    		printf("eglChooseConfig FSAA OK!\n");
     
    	if (numOfConfigs == 0) {
    		if (eglChooseConfig(eglDisplay, attrib_list, configList, configSize, &numOfConfigs) == EGL_FALSE) {
    			printf("eglChooseConfig without FSAA failed!\n");
    			return 0;
    		}
    		else
    			printf("eglChooseConfig without FSAA OK!\n");
     
    		if (numOfConfigs == 0) {
    			printf("Can't find the requested configuration!\n");
    			return 0;
    		}
    	}
     
    	eglConfig = configList[0];
    	free(configList);
     
    	eglSurface = eglCreateWindowSurface(eglDisplay, eglConfig, (NativeWindowType)0, NULL);
    	if (eglSurface == NULL) {
    		printf("eglCreateWindowSurface failed\n");
    		return 0;
    	}
    	else
    		printf("eglCreateWindowSurface OK!\n");
     
    	eglContext = eglCreateContext(eglDisplay, eglConfig, EGL_NO_CONTEXT, NULL);
    	if (eglContext == NULL) {
    		printf("eglCreateContext failed\n");
    		return 0;
    	}
    	else
    		printf("eglCreateContext OK!\n");
     
    	if (eglMakeCurrent(eglDisplay, eglSurface, eglSurface, eglContext) == EGL_FALSE) {
    		printf("eglMakeCurrent failed");
    		return 0;
    	}
    	else
    		printf("eglMakeCurrent OK!\n");
     
    	return 1;
    }
    AmanithVG Lead Programmer

  7. #7
    Turns out the problem was a mixup of different library versions of opengles for mx31.....

Similar Threads

  1. After eglInitialize(), can I create window multiple times?
    By junglecui in forum Cross API and window system integration
    Replies: 2
    Last Post: 10-24-2011, 01:23 AM
  2. Error: eglInitialize() failed.
    By chandrashekar in forum OpenVG and VGU
    Replies: 5
    Last Post: 07-10-2010, 04:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •