Ati initialization problem

HI,
i have a source, tha on the my old 3dfx worked, now on my new g4 don’t work.
The problem was the agl apy that allocate the glcontext.
Anyone as an idea?

Claudio

Can you post your initialisation code please ??

Dan.

Thanks for he answer, this is the code…:

GLint         	attrib[64];
GLint			i = 0;
AGLPixelFormat 	glPixForm = 0L;
OSStatus		err = noErr;
	
try {
	
	LightAmbient[0] = 0.5f;
	LightAmbient[1] = 0.5f;
	LightAmbient[2] = 0.5f;
	LightAmbient[3] = 1.0f;
	
	LightDiffuse[0] = 1.0f;
	LightDiffuse[1] = 1.0f;
	LightDiffuse[2] = 1.0f;
	LightDiffuse[3] = 1.0f;
	
	LightPosition[0] = 0.0f;
	LightPosition[1] = 0.0f;
	LightPosition[2] = 2.0f;
	LightPosition[3] = 1.0f;
	
	// Controllo se devo andare in fullscreen
	if(isFullScreen) {
		attrib[i++] = AGL_RGBA;
		attrib[i++] = AGL_DOUBLEBUFFER;
		attrib[i++] = AGL_NO_RECOVERY;
		attrib[i++] = AGL_ACCELERATED;
		attrib[i++] = AGL_FULLSCREEN;
		attrib[i++] = AGL_NONE;
	} else {
		attrib[i++] = AGL_RGBA;
		attrib[i++] = AGL_DOUBLEBUFFER;
		attrib[i++] = AGL_NO_RECOVERY;
		attrib[i++] = AGL_ACCELERATED;
		attrib[i++] = AGL_NONE;
	}
	
	/* Choose an rgb pixel format */
	/* the first element is gdhandle*/
	glPixForm = aglChoosePixelFormat(0L, 0, attrib);
	if(glPixForm == NULL) {return NULL;}
	
	/* Creo il context per le OpenGL */
	glContext = aglCreateContext(glPixForm, NULL);
	if(glContext == NULL) throw (OSErr) 1;

	/* Attacco il context delle openGL alla finestra Mac */
	//getWindowRef(); called from videomanage class
	if(!aglSetDrawable(glContext, (AGLDrawable)_3DWindow)) throw (OSErr) 1;
	
	/* Setto il context come corrente */
	if(!aglSetCurrentContext(glContext)) throw (OSErr) 1;

	/* rimuovo il pixel format */
	aglDestroyPixelFormat(glPixForm);

Is fullscreen set to 1 one 0 ?? And have you tried taking the AGL_NO_RECOVERY off the attib list ??

Dan.

the error is given by
glContext = aglCreateContext(glPixForm, NULL);
i have tried to taking of the AGL_NO_RECOVERY param…
This error occure also in fullscreen mode.
The aglCreateContext return null.
This on the 3dfx work perfectly

Maybe you should try specifying a pixel size like 16 bits or 32 bits. I have no problem myself with the ATI Rage 128. I 'll post my init code if you cannot make it work.

Dan.

I have made it work i have reòoved the ACCELERATION tag by init parameter

You probaly lost all acceleration though. What graphics card have you got ??

Dan.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.