PDA

View Full Version : Ati initialization problem



Claudio
04-03-2001, 01:28 AM
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

BANE
04-10-2001, 12:31 AM
Can you post your initialisation code please ??

Dan.

Claudio
04-13-2001, 09:31 AM
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);

BANE
04-13-2001, 09:51 PM
Is fullscreen set to 1 one 0 ?? And have you tried taking the AGL_NO_RECOVERY off the attib list ??

Dan.

Claudio
04-14-2001, 02:56 AM
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

BANE
04-16-2001, 11:44 PM
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.

Claudio
04-17-2001, 11:14 AM
I have made it work i have reňoved the ACCELERATION tag by init parameter

BANE
04-18-2001, 05:43 AM
You probaly lost all acceleration though. What graphics card have you got ??

Dan.