Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » GLCtrl display error on Vista
GLCtrl display error on Vista [message #16549] Tue, 24 June 2008 19:14 Go to next message
kodos is currently offline  kodos
Messages: 111
Registered: March 2008
Experienced Member
Hi,

I think I have no luck with the GLCtrl Wink

On my Vista x64 SP1 PC the OpenGL example has some display problems. If I move the mouse over the window than I can see the animation, but when I don't move the cursor I will just get a white screen.

This happens with and without Ctrl::GlobalBackPaint() .

Thanks in advance Smile
Re: GLCtrl display error on Vista [message #16550 is a reply to message #16549] Tue, 24 June 2008 21:54 Go to previous messageGo to next message
gertwin is currently offline  gertwin
Messages: 25
Registered: May 2007
Location: Netherlands
Promising Member
The same behavior is on linux systems with compiz desktop effects enabled.
On the ubuntu forum this is reported on cards using the ati driver (like i have).
Disabling desktop effects solves the problem.

Maybe on vista the same is true, i don't think it is UPP or OpenGL related.

Gertwin
Re: GLCtrl display error on Vista [message #16554 is a reply to message #16549] Wed, 25 June 2008 15:02 Go to previous messageGo to next message
kodos is currently offline  kodos
Messages: 111
Registered: March 2008
Experienced Member
I have tested the OpenGL example on Linux with and without Compiz enabled and everything works for me as expected. But I have a Nvidia card.

And other applications based on OpenGL also work under Vista so this seems to be a problem with UPP.
Re: GLCtrl display error on Vista [message #16566 is a reply to message #16549] Thu, 26 June 2008 20:02 Go to previous messageGo to next message
kodos is currently offline  kodos
Messages: 111
Registered: March 2008
Experienced Member
Some updates:
- If I run the OpenGL example in the WinXP compatibility mode everything works as expected
- If I turn of the desktop effects on Vista the problem is still there, so I don't think it has something to do with it
Re: GLCtrl display error on Vista [message #16570 is a reply to message #16549] Fri, 27 June 2008 12:59 Go to previous messageGo to next message
kodos is currently offline  kodos
Messages: 111
Registered: March 2008
Experienced Member
OK, I think I have found the problem.

http://www.opengl.org/pipeline/article/vol003_7/

If I set the PFD_SUPPORT_COMPOSITION flag on the OpenGL context and WS_CLIPCHILDREN, WS_CLIPSIBLINGS on the main window I can get it to work but now we have to InvalidateRect the DhCtrls individually.

I have not included a patch because my current solution is just a hack and I don't know how I should implement this in a proper manner.
Re: GLCtrl display error on Vista [message #16611 is a reply to message #16570] Wed, 02 July 2008 10:53 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Thanks for hints! It helped a lot.

Please check the attached "official" patch. I believe it is OK now.

Mirek
  • Attachment: patch.zip
    (Size: 1.78KB, Downloaded 282 times)
Re: GLCtrl display error on Vista [message #16616 is a reply to message #16549] Wed, 02 July 2008 15:48 Go to previous messageGo to next message
kodos is currently offline  kodos
Messages: 111
Registered: March 2008
Experienced Member
Thank you very much, it works perfectly Smile

Another small thing: Is the
pragma comment( lib, "glaux.lib" )
really necessary? I don't have this lib and I just uncomment this line and it works fine Smile
Re: GLCtrl display error on Vista [message #16621 is a reply to message #16616] Wed, 02 July 2008 22:45 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
kodos wrote on Wed, 02 July 2008 09:48

Thank you very much, it works perfectly Smile

Another small thing: Is the
pragma comment( lib, "glaux.lib" )
really necessary? I don't have this lib and I just uncomment this line and it works fine Smile


Ehm, not sure Smile

Have you tried with XP, Win2K and Win98?

Mirek
Re: GLCtrl display error on Vista [message #16625 is a reply to message #16549] Thu, 03 July 2008 06:58 Go to previous messageGo to next message
kodos is currently offline  kodos
Messages: 111
Registered: March 2008
Experienced Member
I tried with Win XP and Vista, but I think if it compiles without the lib it doesn't need it. If there are no functions called from the lib how should it not work without it?
Re: GLCtrl display error on Vista [message #16630 is a reply to message #16625] Thu, 03 July 2008 15:33 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
kodos wrote on Thu, 03 July 2008 00:58

I tried with Win XP and Vista, but I think if it compiles without the lib it doesn't need it. If there are no functions called from the lib how should it not work without it?


OK, glaux removed.
Re: GLCtrl display error on Vista [message #18444 is a reply to message #16549] Wed, 01 October 2008 14:50 Go to previous messageGo to next message
kodos is currently offline  kodos
Messages: 111
Registered: March 2008
Experienced Member
Hi,

I think I have to open this thread again.
The problem is still there with the flickering in Vista, even if it is far better with the patch from luzr.
After I have reread the article on opengl.org I think I have found the problem. The WS_CLIPCHILDREN and WS_CLIPSIBLINGS have to be set on the parent window of the OpenGl control, not on the control itself.
With the following changes I haven't noticed any flickering yet:

TopWin32.cpp:86
style |= WS_CAPTION|WS_CLIPSIBLINGS|WS_CLIPCHILDREN;

CtrlCore.h:1767
void Refresh() { InvalidateRect(GetHWND(), NULL, false); }

I don't call the Refresh() from Ctrl because in my tests it is not needed, but I have just done my tests with the GLCtrl Wink and I don't know exactly what Refresh is doing.

DHCtrl.cpp:36
CreateWindowEx(0, "UPP-CLASS-A", "",
		               WS_CHILD|WS_DISABLED|WS_VISIBLE,
		               0, 0, 20, 20,
		               phwnd, NULL, hInstance, this);

The WS_CLIPSIBLINGS and WS_CLIPCHILDREN styles can be removed from here again.

But I don't know if this changes have some side effects with other controls that derive from DHCtrl, I really just know the GLCtrl and my custom CairoCtrl. Smile
Re: GLCtrl display error on Vista [message #18465 is a reply to message #18444] Thu, 02 October 2008 09:25 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Well, it required a little bit more attention, using these flags only when DHCtrl is present (in theory, performance affected, also, more interactions are possible) and finding a way how to make Ctrl::Refresh work instead of implementing it in DHCtrl.

Hopefuly, it should now work without affecting anything else.

Please check (will be on svn mirror in 40 minutes).

Mirek
Re: GLCtrl display error on Vista [message #18472 is a reply to message #16549] Thu, 02 October 2008 19:14 Go to previous message
kodos is currently offline  kodos
Messages: 111
Registered: March 2008
Experienced Member
Thanks for the update.

I have tested the changes a little bit, and it's better now.
The only problem now, there is still a flash, when the GLCtrl is shown the first time, that one isn't there with my solution. I don't know exactly why, but I think the SyncCaption function is called a bit "to late", but I'm really not sure Wink .

But I have found some confusing things:

- If I comment out the line:
if(hasdhctrl)
		style |= WS_CLIPSIBLINGS|WS_CLIPCHILDREN;

from SyncCaption it changes nothing. Actually I thought with this change it should be worse again but it isn't... Probably beacause of the new refresh function but I'm not sure.

- If I just comment out the if, the first flash is also gone.



EDIT: I just want to say that the first flash that is still there isn't really that bad, so if it's to complicated to fix it I think we could just leave it as it is.

[Updated on: Thu, 02 October 2008 19:15]

Report message to a moderator

Previous Topic: start up program
Next Topic: Small Correction about Vista/GLCtrl corrections
Goto Forum:
  


Current Time: Fri Mar 29 06:53:09 CET 2024

Total time taken to generate the page: 0.01873 seconds