Celestia loves my ATI graphics cards. Bugs nailed!

Report bugs, bug fixes and workarounds here.
Topic author
Boux
Posts: 435
Joined: 25.08.2004
With us: 20 years 2 months
Location: Brittany, close to the Ocean

Celestia loves my ATI graphics cards. Bugs nailed!

Post #1by Boux » 21.11.2009, 14:16

Work-arounds/bug fixes for ATI/Vista
Hi all!

Celestia does not seem to like some configurations with ATI graphics cards.
Under Vista, for many users - laptops notably - , this translates into:

Windowed mode:
- top of opengl viewport is hidden by the menubar
- viewport is shifted up by the height of the menubar and bottom of viewport does not render anything

Fullscreen mode:
- right-clicking selection does not make context menu to pop-up to the foreground

Some pictures to illustrate what is happening

1 - Windowed mode
Top of viewport hidden behind menubar:
Top left/top right:
Image

Image

Bottom left/bottom right:
20-pixel thick empty area (figure returned by a call to GetSystemMetrics)
Image

Image


After changing some code in winmain.ccp to make sure menubar is thrown in at the right time so that the opengl viewport is created at the right place:


Top left/top right:
Image

Image

Bottom left/bottom right:
Image

Image

First bug fixed!

2 - Fullscreen mode
Right-click context menu invisible but shape of pointer changes to acknowledge the event:
Image

After changing the window style in winmain.ccp:
Image

Second bug nailed!

Here is the code block where the changes have been made (with relevant comments where needed):

Code: Select all

    // Line 1971 of winmain.ccp Determine the proper window style to use
    DWORD dwStyle;
    if (newMode != 0)
    {
        dwStyle = WS_POPUPWINDOW | WS_MAXIMIZE;
      // original style is: dwStyle = WS_POPUP;
      // work-around for right-click context menu
      // not popping up in fullscreen mode with ATI card in Vista
    }
    else
    {
      dwStyle = WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
    }

    // Create the window
    HWND hwnd = CreateWindow(AppName,
                             AppName,
                             dwStyle,
                             x, y,
                             width, height,
                             NULL,
                             NULL,
                             appInstance,
                             NULL);

    if (hwnd == NULL)
        return NULL;

    ShowWindow(hwnd, SW_SHOW);
    SetForegroundWindow(hwnd);
    SetFocus(hwnd);

    deviceContext = GetDC(hwnd);
    if (!SetDCPixelFormat(deviceContext))
    {
        MessageBox(NULL,
                   "Could not get appropriate pixel format for OpenGL rendering.", "Fatal Error",
                   MB_OK | MB_ICONERROR);
      return NULL;
    }

   // beginning of moved code block
   // to make sure the menubar is created right now
   {
    if (newMode == 0)
        SetMenu(hwnd, menuBar);
    else
        hideMenuBar = true;
   }
   // end of moved code block

   bool firstContext = false;
    if (glContext == NULL)
   {
        glContext = wglCreateContext(deviceContext);
      firstContext = true;
   }
    wglMakeCurrent(deviceContext, glContext);

   if (firstContext)
   {
      GLenum glewErr = glewInit();
      if (glewErr != GLEW_OK)
      {
         MessageBox(NULL, "Could not set up OpenGL extensions.", "Fatal Error",
                  MB_OK | MB_ICONERROR);
         return NULL;
      }
   }
   /* 4 lines below moved to lines 2012-2015 above
    if (newMode == 0)
        SetMenu(hwnd, menuBar);
    else
        hideMenuBar = true;//*/

    return hwnd;
}


It would be nice to have some building and testing done by you guys, both on ATI and Nvidia hardware.

The code bit is available here:
http://www.quickfixcomm.fr/Celestia/winmainccp-modification.cpp

Edit:
For your convenience, a latest SVN build can be grabbed here:
http://www.quickfixcomm.fr/Celestia/celestiaSVN4912.zip
Intel core i7 3770 Ivy Bridge @ 4.4 GHz -16 GB ram - 128 GB SSD cache - AMD Radeon 7970 3 GB o'clocked - Windows 7 64 Ultimate / Linux Kubuntu

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 9 months
Location: Seattle, Washington, USA

Re: Celestia loves my ATI graphics cards. Bugs nailed!

Post #2by chris » 26.11.2009, 22:02

Boux,

Thank you for making these changes. I'm on the road with just my MacBook, but will try out your changes on my Windows system when I get back in a few days. I expect that they should work just fine with NVIDIA cards, too.

--Chris

Granyte
Posts: 8
Joined: 26.11.2009
With us: 14 years 11 months

Re: Celestia loves my ATI graphics cards. Bugs nailed!

Post #3by Granyte » 26.11.2009, 22:56

thanks for the try it fixed the problems but created a new and i think worst one

cause it fixes both problem but when i try to exit full screen celestia just crash brighing the display driver with him
how ever the crash issue with your code might be proper to window 7x64 driver


the problem seem to be in the driver it self since catalyst 9.7 didn't had any problem with the windowed mode or full screen mode and since then it just kept degradating and has of now with catalyst 9.11 i'm having issue with my opengl 2.0 render path

for the information i use 2x 4850 mobility in cfx setup

Reiko
Posts: 1119
Joined: 05.10.2006
Age: 41
With us: 18 years 1 month
Location: Out there...

Re: Celestia loves my ATI graphics cards. Bugs nailed!

Post #4by Reiko » 26.11.2009, 23:10

I had that same problem with ATI and fixed it by setting the windows theme to windows classic.

Granyte
Posts: 8
Joined: 26.11.2009
With us: 14 years 11 months

Re: Celestia loves my ATI graphics cards. Bugs nailed!

Post #5by Granyte » 26.11.2009, 23:19

setting my theme to classic caused my laptop to lagg and spin th fan like crazy (like a tornado) for like 5 min when it stop it comes back to normal the result made me draw the conclusion that setting it to classic caused some wierd overheating problem
Alienware M17
Intel® Core™ 2 Quad Q9000 2.0GHz (6MB Cache 1066MHz FSB)
Dual 1024MB ATI® Mobility Radeon™ HD 4850 – CrossFireX™ Enabled!
17-inch WideUXGA 1920 x 1200 LCD (1200p)
4GB Dual Channel DDR3 SO-DIMM at 1067MHz - 2 x 2048MB
windows 7 Ultimate x64

Topic author
Boux
Posts: 435
Joined: 25.08.2004
With us: 20 years 2 months
Location: Brittany, close to the Ocean

Re: Celestia loves my ATI graphics cards. Bugs nailed!

Post #6by Boux » 27.11.2009, 10:19

Granyte wrote:thanks for the try it fixed the problems but created a new and i think worst one

cause it fixes both problem but when i try to exit full screen celestia just crash brighing the display driver with him
how ever the crash issue with your code might be proper to window 7x64 driver


the problem seem to be in the driver it self since catalyst 9.7 didn't had any problem with the windowed mode or full screen mode and since then it just kept degradating and has of now with catalyst 9.11 i'm having issue with my opengl 2.0 render path

for the information i use 2x 4850 mobility in cfx setup

Well, I am running Vista64 here with 2x4870 in crossfire and I have not this crash issue with latest catalyst. It just work.
I do not see how the changes I made would do any harm.

Regarding your specific issue, you may want to try another opengl driver dropped right into your Celestia root folder. Celestia only will use this one instead of the version installed in the system.
I have had some success with the FireGl opengl driver (atioglxx.dll) extracted from the driver package (version 6.14.10.8794).
I you cannot find it, just tell me, I will upload it to my ftp.
There are complaints all over the net about problems with opengl ATI drivers.
They are great for direct3d though.
Intel core i7 3770 Ivy Bridge @ 4.4 GHz -16 GB ram - 128 GB SSD cache - AMD Radeon 7970 3 GB o'clocked - Windows 7 64 Ultimate / Linux Kubuntu

Topic author
Boux
Posts: 435
Joined: 25.08.2004
With us: 20 years 2 months
Location: Brittany, close to the Ocean

Re: Celestia loves my ATI graphics cards. Bugs nailed!

Post #7by Boux » 27.11.2009, 10:32

Reiko wrote:I had that same problem with ATI and fixed it by setting the windows theme to windows classic.

Tried this too, and also disabling desktop composition, even with some more C++ code checking graphic card vendor ID at runtime.
They are ugly - litterally :) - workarounds which do not solve both issues at the same time.
I want Celestia to behave as it should, with aero and glass enabled as they are supposed to be.
And ... I just can't stand the old interface from windows 95 jurassic times :lol:
Intel core i7 3770 Ivy Bridge @ 4.4 GHz -16 GB ram - 128 GB SSD cache - AMD Radeon 7970 3 GB o'clocked - Windows 7 64 Ultimate / Linux Kubuntu

Granyte
Posts: 8
Joined: 26.11.2009
With us: 14 years 11 months

Re: Celestia loves my ATI graphics cards. Bugs nailed!

Post #8by Granyte » 27.11.2009, 16:47

i agree it need to work all together if not it kill the point of having those OS and hardware acceleration is not has good with aero disabeled than it's with it enabeled


i agree it's wierd that your changes cause the display driver to crash especialy in window 7 who is the windows os who is the hardest to make driver crash but you changes does so i have no clue why while the normal celestia work with out crashing

actualy opengl on ati is not the best i agree however they are workin on it and in 9.10 it improved celestia was runing smoother and i had only the displacement and full screen issue but at the time i was runing win vista x64

i recently switched over to win 7 x64 and at the sametime performed a clean instal and installed catalyst 9.11 and i'm now having a subtle issue with opengl 2.0 that i can only notice when looking at the black hole addons
Alienware M17
Intel® Core™ 2 Quad Q9000 2.0GHz (6MB Cache 1066MHz FSB)
Dual 1024MB ATI® Mobility Radeon™ HD 4850 – CrossFireX™ Enabled!
17-inch WideUXGA 1920 x 1200 LCD (1200p)
4GB Dual Channel DDR3 SO-DIMM at 1067MHz - 2 x 2048MB
windows 7 Ultimate x64

Reiko
Posts: 1119
Joined: 05.10.2006
Age: 41
With us: 18 years 1 month
Location: Out there...

Re: Celestia loves my ATI graphics cards. Bugs nailed!

Post #9by Reiko » 27.11.2009, 23:16

Granyte wrote:setting my theme to classic caused my laptop to lagg and spin th fan like crazy (like a tornado) for like 5 min when it stop it comes back to normal the result made me draw the conclusion that setting it to classic caused some wierd overheating problem
That's odd that classic, a less stressful theme to your system, would cause an overheat problem. :?

Boux wrote:
Reiko wrote:I had that same problem with ATI and fixed it by setting the windows theme to windows classic.

Tried this too, and also disabling desktop composition, even with some more C++ code checking graphic card vendor ID at runtime.
They are ugly - litterally :) - workarounds which do not solve both issues at the same time.
I want Celestia to behave as it should, with aero and glass enabled as they are supposed to be.
And ... I just can't stand the old interface from windows 95 jurassic times :lol:
I understand how you feel. I like the vista themes better too and went back to them once I bought an Nvidia card. :blue:

Granyte
Posts: 8
Joined: 26.11.2009
With us: 14 years 11 months

Re: Celestia loves my ATI graphics cards. Bugs nailed!

Post #10by Granyte » 28.11.2009, 00:00

i have a theorie on what cause overheating ... when you disable the theme all the renders on screen pass through the cpu instead of the gpu
and the cpu just hate rendering things (drag a window in classic theme the lagg will tell y how much it likes it)
i just recalled i had a ridiculously high nb of windows opened at the time so forcing my cpu to render all that caused the issue
i also tryed this time with less things opened and it worked no trouble but still the win 95 look ....

also putting window theme to classic don't fix the issue about full screen not displaying the menu
Alienware M17
Intel® Core™ 2 Quad Q9000 2.0GHz (6MB Cache 1066MHz FSB)
Dual 1024MB ATI® Mobility Radeon™ HD 4850 – CrossFireX™ Enabled!
17-inch WideUXGA 1920 x 1200 LCD (1200p)
4GB Dual Channel DDR3 SO-DIMM at 1067MHz - 2 x 2048MB
windows 7 Ultimate x64

Topic author
Boux
Posts: 435
Joined: 25.08.2004
With us: 20 years 2 months
Location: Brittany, close to the Ocean

Re: Celestia loves my ATI graphics cards. Bugs nailed!

Post #11by Boux » 28.11.2009, 10:36

Granyte,
Please try this new build:
http://www.quickfixcomm.fr/Celestia/celestiaSVN4912.zip
I may have left inadvertantly some aggressive optimisations in the previous one.
I am also thinking as a possibility that the changed code - which is plain standard Windows API stuff - may simply have exposed some other issue on your system.
Intel core i7 3770 Ivy Bridge @ 4.4 GHz -16 GB ram - 128 GB SSD cache - AMD Radeon 7970 3 GB o'clocked - Windows 7 64 Ultimate / Linux Kubuntu

Granyte
Posts: 8
Joined: 26.11.2009
With us: 14 years 11 months

Re: Celestia loves my ATI graphics cards. Bugs nailed!

Post #12by Granyte » 29.11.2009, 06:31

this tim jjust switching to dull screen cause the software to crash and again brigning the display driver with it

it might be a window 7 issue also ..
Alienware M17
Intel® Core™ 2 Quad Q9000 2.0GHz (6MB Cache 1066MHz FSB)
Dual 1024MB ATI® Mobility Radeon™ HD 4850 – CrossFireX™ Enabled!
17-inch WideUXGA 1920 x 1200 LCD (1200p)
4GB Dual Channel DDR3 SO-DIMM at 1067MHz - 2 x 2048MB
windows 7 Ultimate x64

duds26
Posts: 328
Joined: 05.02.2007
Age: 34
With us: 17 years 9 months
Location: Europe

Re: Celestia loves my ATI graphics cards. Bugs nailed!

Post #13by duds26 » 04.12.2009, 12:49

Thanks for the bug fixes, this should really be added to a Celestia 1.6.1 version.
Problem 1 annoys me a lot, makes stuff unreadable which stops a lot.
Please bring a bugfix release for Celestia with these fixes.

Windows 7 is fairly new, and x64 is not so well tested as x86 is.

I had that same problem with ATI and fixed it by setting the windows theme to windows classic.
This is not a solution, but just a workaround.

Tried the executable and...
The fixes work!
Fantastic.

Win Vista 32bit, ATI X1600
Drivers: ATI Catalyst 9.3

Topic author
Boux
Posts: 435
Joined: 25.08.2004
With us: 20 years 2 months
Location: Brittany, close to the Ocean

Re: Celestia loves my ATI graphics cards. Bugs nailed!

Post #14by Boux » 05.12.2009, 10:11

duds26 wrote:...
Tried the executable and...
The fixes work!
Fantastic.

Win Vista 32bit, ATI X1600
Drivers: ATI Catalyst 9.3

Glad to know that it worked for you.
Always been puzzled why nobody ever cared.
ATI is a major provider of GPUs for laptops and the latest generation of their desktop graphics cards are currently the most powerful.
I am guessing Celestia has lost most of this large potential user base.
For your convenience, here is the latest SVN build:
http://www.quickfixcomm.fr/Celestia/celestiaSVN4920.zip
Intel core i7 3770 Ivy Bridge @ 4.4 GHz -16 GB ram - 128 GB SSD cache - AMD Radeon 7970 3 GB o'clocked - Windows 7 64 Ultimate / Linux Kubuntu

chris
Site Admin
Posts: 4211
Joined: 28.01.2002
With us: 22 years 9 months
Location: Seattle, Washington, USA

Re: Celestia loves my ATI graphics cards. Bugs nailed!

Post #15by chris » 06.12.2009, 21:23

Boux,

These changes work fine on my Windows system with an NVIDIA card. I've committed your fixes to both the trunk and 1.6.1 branches. Thanks again for debugging this problem and providing patches!

--Chris

Granyte
Posts: 8
Joined: 26.11.2009
With us: 14 years 11 months

Re: Celestia loves my ATI graphics cards. Bugs nailed!

Post #16by Granyte » 08.12.2009, 05:19

lastes build

first try
work flawlessly in windowed mode like all befor it

but when switching to full screen make it crash after switching (not brigning the display driver this time)


second try
randrom crash 2 second after start up (just had time to see earth)


third try

work flawlessly in windowed

fullscrren make it crash (brigning the display driver with it)
Alienware M17
Intel® Core™ 2 Quad Q9000 2.0GHz (6MB Cache 1066MHz FSB)
Dual 1024MB ATI® Mobility Radeon™ HD 4850 – CrossFireX™ Enabled!
17-inch WideUXGA 1920 x 1200 LCD (1200p)
4GB Dual Channel DDR3 SO-DIMM at 1067MHz - 2 x 2048MB
windows 7 Ultimate x64

Topic author
Boux
Posts: 435
Joined: 25.08.2004
With us: 20 years 2 months
Location: Brittany, close to the Ocean

Re: Celestia loves my ATI graphics cards. Bugs nailed!

Post #17by Boux » 08.12.2009, 09:13

Well , this is exposing a problem that is likely specific to ATI's Win7 drivers.
They may be not mature enough yet.
I suggest you try one or all of the following:
- deactivating all options in the Catalyst control center i.e. leaving everything strictly as application-controlled
- deactivating Crossfire (which is useless with Celestia btw)
- uninstall the Win7 drivers and do some testing with the latest Vista64 drivers which may be more stable
- build Celestia on your system just to be sure there is not some Win7 dll or lib weirdness happening
- maybe begin with dropping the attached dll right in your Celestia root folder.
http://www.quickfixcomm.fr/Celestia/atioglxxFirePro.zip
Intel core i7 3770 Ivy Bridge @ 4.4 GHz -16 GB ram - 128 GB SSD cache - AMD Radeon 7970 3 GB o'clocked - Windows 7 64 Ultimate / Linux Kubuntu

Granyte
Posts: 8
Joined: 26.11.2009
With us: 14 years 11 months

Re: Celestia loves my ATI graphics cards. Bugs nailed!

Post #18by Granyte » 08.12.2009, 15:48

thx disabeling crossfire made your build work flawlesly switching betwen full screen and windowed

the firegl dll fixed the opengl 2.0 render error
Alienware M17
Intel® Core™ 2 Quad Q9000 2.0GHz (6MB Cache 1066MHz FSB)
Dual 1024MB ATI® Mobility Radeon™ HD 4850 – CrossFireX™ Enabled!
17-inch WideUXGA 1920 x 1200 LCD (1200p)
4GB Dual Channel DDR3 SO-DIMM at 1067MHz - 2 x 2048MB
windows 7 Ultimate x64


Return to “Bugs”