Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: OpenGL under WinXP

  1. #1
    Guest

    OpenGL under WinXP

    Hiya, I got a little question about WinXP and OpenGL. I used to code opengl under win98se, and I had no problems with it, I wrote a terrain engine and always got over 100 fps in it.

    However, I recently installed winXP. If I run my terrain engine there, I barely get 30 fps. Anyone have an idea why that is? I'd think theres a driver issue, but if I play HL or any other FPS that uses OpenGL, my fps is just the same as back in win98se.

    Any thoughts on this are appreciated!

  2. #2
    Senior Member Regular Contributor
    Join Date
    Feb 2003
    Location
    Westerville, Oh, USA
    Posts
    201

    Re: OpenGL under WinXP

    Have you downloaded your card vendor's latest drivers for XP?

  3. #3
    Guest

    Re: OpenGL under WinXP

    Yes, I have.

  4. #4
    Senior Member Regular Contributor
    Join Date
    Feb 2003
    Location
    Westerville, Oh, USA
    Posts
    201

    Re: OpenGL under WinXP

    Are you synching with the monitor vsync? You can disable this in the video settings, I believe. You can also do it with a Windows call which I don't recall offhand and my graphics code is all at home

    Perhaps the other applications disable this in software and your terrain program does not? If not, you'll be bound to the vsync rate of your monitor, with may be 30 FPS.

    I don't think I explained that very well. Try a groups.google.com search for "vsync" in comp.graphics.api.opengl.

  5. #5
    Guest

    Re: OpenGL under WinXP

    I'm aware of vsync, its off. I get 100 fps in HL so thats not the problem.

  6. #6
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,753

    Re: OpenGL under WinXP

    Check what you get with glGetString(GL_VENDOR) and glGetString(GL_RENDERER);

    Maybe something you are requesting for the pixelformat is putting you into software mode.
    Deiussum
    Software Engineer and OpenGL enthusiast

  7. #7
    Guest

    Re: OpenGL under WinXP

    You're right, Deiussum, that's exactly what seems to be the problem. It's using GDI to draw my scene, no wonder its slow.

    I'm not sure what could be wrong with my pixelformat though, since it used to work fine in win98se. I'll just paste my function here:

    bool CRenderer::SetupPixelFormat(HDC hdc)
    {
    PIXELFORMATDESCRIPTOR pfd, *ppfd;
    int pixelformat;

    ppfd = &pfd;

    ppfd->nSize = sizeof(PIXELFORMATDESCRIPTOR);
    ppfd->nVersion = 1;
    ppfd->dwFlags = PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
    ppfd->dwLayerMask = PFD_MAIN_PLANE;
    ppfd->iPixelType = PFD_TYPE_RGBA;
    ppfd->cColorBits = 8;
    ppfd->cDepthBits = 16;
    ppfd->cAccumBits = 0;
    ppfd->cStencilBits = 0;

    pixelformat = ChoosePixelFormat(hdc, ppfd);

    if ( (pixelformat = ChoosePixelFormat(hdc, ppfd)) == 0 )
    {
    MessageBox(NULL, "ChoosePixelFormat failed", "Error", MB_OK);
    return FALSE;
    }

    if (SetPixelFormat(hdc, pixelformat, ppfd) == FALSE)
    {
    MessageBox(NULL, "SetPixelFormat failed", "Error", MB_OK);
    return FALSE;
    }

    return TRUE;
    }

  8. #8
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,753

    Re: OpenGL under WinXP

    Try to clear out the memory for the PIXELFORMATDESCRIPTOR before setting those fields. You don't set all of them, so it's possible that some garbage is left behind since the memory is allocated locally on the stack.

    Either

    ZeroMemory(ppfd, sizeof(PIXELFORMATDESCRIPTOR); // After ppfd=&pfd;

    of

    ZeroMemory(&pfd, sizeof(PIXELFORMATDESCRIPTOR);

    Should work.

    If nothing else, you can also always enumerate through all the pixelformats and find the one with the properties you want, that is hardware accellerated.

    One more thing. Usually when you use ChoosePixelFormat, you should use DescribePixelFormat before SetPixelFormat to make sure that the PIXELFORMATDESCRIPTOR matches the number of the PixelFormat returned by ChoosePixelFormat.



    [This message has been edited by Deiussum (edited 05-02-2003).]
    Deiussum
    Software Engineer and OpenGL enthusiast

  9. #9
    Guest

    Re: OpenGL under WinXP

    Your help was invaluable to me, I got it working (some garbage did sneak in).

    Thanks a lot m8.

  10. #10
    Senior Member Regular Contributor
    Join Date
    Jun 2002
    Posts
    365

    Re: OpenGL under WinXP

    Originally posted by Parsec:

    ppfd->cColorBits = 8;
    An 8 bit color buffer(no alpha) will most certainly give you a software rendering format, if one even exists. Try setting this to 24. It might work for now on your hardware/driver but could fail for anything else.

Page 1 of 2 12 LastLast

Similar Threads

  1. Where to get OpenGL for WinXP
    By rustyr0824 in forum OpenGL: Windows
    Replies: 3
    Last Post: 10-23-2006, 06:23 PM
  2. OpenGL on a TNT with WinXP?
    By in forum OpenGL: User Software
    Replies: 1
    Last Post: 05-19-2004, 02:03 PM
  3. OpenGL & WinXP
    By in forum OpenGL: User Software
    Replies: 0
    Last Post: 11-27-2003, 06:37 AM
  4. WinXP OpenGL
    By in forum OpenGL: User Software
    Replies: 5
    Last Post: 04-17-2002, 08:19 AM
  5. Opengl on WinXp?
    By Berkz in forum OpenGL: User Software
    Replies: 1
    Last Post: 09-02-2001, 06:46 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean