IonicWind Software

Aurora Compiler => 2D Graphics => Topic started by: Zen on June 26, 2006, 06:56:19 am

Title: Mouse Flickering
Post by: Zen on June 26, 2006, 06:56:19 am
I have just created a basic 1024x768x32 full screen with the back buffer set to black and just looping throught the flip method but my mouse seems to flicker a lot. Is there any particular reason why this is happening?

Lewis
Title: Re: Mouse Flickering
Post by: Ionic Wind Support Team on June 26, 2006, 07:15:25 am
Are you setting the back buffer to black before each flip?  Remember the buffer is essentially "invalid" once you flip it and you have to redraw everything again before you flip again.

Also if your flipping with vertical sync off ...  flip(1)  you can get some anomolies with certain video cards.

Title: Re: Mouse Flickering
Post by: Zen on June 26, 2006, 07:18:50 am
Yes i am setting the back buffer to black before each flip and i have tried the flip with vertical sync on and off. Even tried drawing to the screen just incase it was because there was nothing there.

Strange...
Title: Re: Mouse Flickering
Post by: Ionic Wind Support Team on June 26, 2006, 07:47:08 am
I don't usually leave the mouse cursor on in full screen apps, normally you draw your one.  I don't see flickering here but I do remember an issue with certain video cards way back when....reading.

Reading through the Microsoft docs they do say that one cannot use the Windows system cursor in a DirectDraw/Direct3D application that uses full-screen exclusive mode.   Although it works fine with my card/driver set.

Thinking about it further it makes sense since the system cursor is tied to the GDI and uses the GDI surfaces front buffer to render on, which would occasionally flicker since the two operations are not in sync.

Paul.

Title: Re: Mouse Flickering
Post by: Zen on June 26, 2006, 07:51:19 am
Well if that is the case then thats ok. But howw do i draw one? Can i make a small square or does it have to be an image loaded? As the SetCursor's second argument appears to be a handle.

Thanks Paul
Lewis
Title: Re: Mouse Flickering
Post by: Ionic Wind Support Team on June 26, 2006, 08:04:40 am
Look at the frags2D example.  Just draw anything you want in the position of the mouse cursor. 

You can use a sprite too.  Just draw it as the last thing before you call flip so it will be on top of all other graphic elements.
Title: Re: Mouse Flickering
Post by: Zen on June 26, 2006, 08:27:29 am
Ahh ok then. Thanks a lot Paul. I justrealised that SetCursor is inherited from the window class, rather than been implemented specially for trhe 2D stuff.

Im still strugling how to implement the windows properly for my 2D controls. I need to figure out a way to implement the messages being sent. Ill get there eventually though.

Lewis
Title: Re: Mouse Flickering
Post by: Ionic Wind Support Team on June 26, 2006, 08:29:26 am
BTW...there is a way to use GDI dialogs in a full screen application.  But it is limited in that the dialog slows everything down as you must switch to the GDI surface every frame to keep it displayed.

Title: Re: Mouse Flickering
Post by: Zen on June 26, 2006, 08:32:48 am
Hmmm yeah i think ill give that a miss. I want to be able to give users full GUI support but with the abbility to skin and customize there applications interfaces, without having to create there own windows and controls themselves. With some nice classes it should be cool.

Lewis