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 7 of 7

Thread: Are there any difference of coding for Win2000 and WinXP

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2004
    Location
    Bangkok
    Posts
    4

    Are there any difference of coding for Win2000 and WinXP

    I has developing a software with OpenGL for a
    while. After the released of my software, I have
    received many reports from users about bugs in
    Window2000.

    Then I tested my software with two difference
    system, WinXP and Win2000. The the result are
    also difference, WinXP can run witout bug but in
    Win2000 the sofware perform some bug the user
    were report earlier.

    I think that there must be something difference
    about coding for Win2000 system. Are there any
    suggestion or article about this issue? please
    help

  2. #2
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,580

    Re: Are there any difference of coding for Win2000 and WinXP

    Can you be more precise ? Which bug are talking about really ?

    Xp and 2000 are closer than win98 and 2000 for example.

    Did users had the latest video drivers for their graphic cards on both systems ? Most of opengl problems come from older/broken video drivers.

  3. #3
    Junior Member Newbie
    Join Date
    Jul 2004
    Location
    Bangkok
    Posts
    4

    Re: Are there any difference of coding for Win2000 and WinXP

    It was about the CPU usage. The result of test was obvious that my software using 12% of CPU in WinXP but 100% of CPU in Win2000, same version difference machine, but why?

    I have developed the software with VC++, OpenGL and QT.

  4. #4
    Advanced Member Frequent Contributor yooyo's Avatar
    Join Date
    Apr 2003
    Location
    Belgrade, Serbia
    Posts
    872

    Re: Are there any difference of coding for Win2000 and WinXP

    Have you try to turn on VSync in driver pages?
    Anyway... if your loop looks like:
    Code :
    while (!bQuit)
    {
     ProcessWindowsMessages();
     RenderScene();
     SwapBuffers();
    }
    then if you enable vsync, rendering will synced with display refresh and this usually lead to small CPU usage (app sleep in SwapBuffers call).
    If you disable vsync SwapBuffers call will immediatly show new image. In this case you app will eat 100% of CPU time.

    So.. check driver pages setup and turn on vsync, or use glSwapInterval(1) call after creating gl context to control buffer swaping.

    yooyo

  5. #5
    Junior Member Newbie
    Join Date
    Jul 2004
    Location
    Bangkok
    Posts
    4

    Re: Are there any difference of coding for Win2000 and WinXP

    glSwapInterval?

    I could not find any definition about this
    command. Please tell me more.

    If Vsync would changing the usage of CPU. So
    It will be the same result in XP and 2000,
    wouldn't it?

  6. #6
    Advanced Member Frequent Contributor yooyo's Avatar
    Join Date
    Apr 2003
    Location
    Belgrade, Serbia
    Posts
    872

    Re: Are there any difference of coding for Win2000 and WinXP

    Sorry... my mistake... Do google for WGL_EXT_swap_control extension. If it's supported (and usually is supported) map entry point of wglSwapIntervalEXT function. Simple usage is:

    wglSwapIntervalEXT(0); //disable vsync
    wglSwapIntervalEXT(1); //enable vsync
    wglSwapIntervalEXT(2); //show every 2-nd frame with vsync
    wglSwapIntervalEXT(n); //show every n-th frame with vsync

    yooyo

  7. #7
    Junior Member Newbie
    Join Date
    Jul 2004
    Location
    Bangkok
    Posts
    4

    Re: Are there any difference of coding for Win2000 and WinXP

    Thank you YooYo.

    I like the idea of using Vsync On/Off.
    It smarts to take the advantage of Monitor
    refreshing interval to decrease CPU usage.

    I'll apply the technique with my application soon.

Posting Permissions

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