March 18, 2024, 09:00:37 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Mouse Flickering

Started by Zen, June 26, 2006, 06:56:19 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Zen

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

Ionic Wind Support Team

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.

Ionic Wind Support Team

Zen

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

Ionic Wind Support Team

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.

Ionic Wind Support Team

Zen

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

Ionic Wind Support Team

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.
Ionic Wind Support Team

Zen

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

Ionic Wind Support Team

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.

Ionic Wind Support Team

Zen

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