Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 8 of 8

Thread: Ati initialization problem

  1. #1
    Intern Newbie
    Join Date
    Jun 2000
    Location
    Italy
    Posts
    45

    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

  2. #2
    Intern Newbie
    Join Date
    May 2000
    Location
    LONDON
    Posts
    46

    Re: Ati initialization problem

    Can you post your initialisation code please ??

    Dan.
    Being crazy is not a requirement but it helps.

  3. #3
    Intern Newbie
    Join Date
    Jun 2000
    Location
    Italy
    Posts
    45

    Re: Ati initialization problem

    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);

  4. #4
    Intern Newbie
    Join Date
    May 2000
    Location
    LONDON
    Posts
    46

    Re: Ati initialization problem

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

    Dan.
    Being crazy is not a requirement but it helps.

  5. #5
    Intern Newbie
    Join Date
    Jun 2000
    Location
    Italy
    Posts
    45

    Re: Ati initialization problem

    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

  6. #6
    Intern Newbie
    Join Date
    May 2000
    Location
    LONDON
    Posts
    46

    Re: Ati initialization problem

    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.
    Being crazy is not a requirement but it helps.

  7. #7
    Intern Newbie
    Join Date
    Jun 2000
    Location
    Italy
    Posts
    45

    Re: Ati initialization problem

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

  8. #8
    Intern Newbie
    Join Date
    May 2000
    Location
    LONDON
    Posts
    46

    Re: Ati initialization problem

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

    Dan.
    Being crazy is not a requirement but it helps.

Posting Permissions

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