News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

GDI Vertical blank and vertical retrace test

Started by Siekmanski, April 16, 2018, 11:04:05 AM

Previous topic - Next topic

felipe

I tried the 8 version and i like it  :icon14:  :greenclp:. I can't see anything bad on it. I actually don't know what do you mean by stutters.  :idea:

felipe

Are stutters some rapid movements (but small movements)? That happen very little. Btw, are this figures fractals?

Siekmanski

Thanks Felipe,

Quote from: felipe on May 04, 2018, 06:56:00 AM
Are stutters some rapid movements (but small movements)? That happen very little. Btw, are this figures fractals?

Yes, those are stutters, GDI waits sometimes for the next frame to do the blitting and then it produces stutters.
The nice fractal like stuff, is the routine from Caballeros Floor demo
It is a repeating color routine, perfect to spot stutters because it scrolls as a flat plane at equal speed.
Creative coders use backward thinking techniques as a strategy.

HSE

Hi Siekmanski!

In my count last engines are 10 and 11!

From 7 (first with floor) very little difference in win7-32. Randon stutters that you note if are searching for.

Equations in Assembly: SmplMath

avcaballero

I'd say that both runs smoothly nearly all the time, but from time to time I can perceive some flickering. I'd say that v8 goes better than v7 though. :t

Siekmanski

Thanks guys,

It's not exactly the result I hoped for but it was a nice challenge.
If I only knew how to manipulate the GDI queueing management to get it to draw instantaneously, it could be really smooth....
Maybe some of you guys know about this.
GDI is not my preference for Games or Demo coding, Direct3D9 is!
Creative coders use backward thinking techniques as a strategy.

jj2007

Quote from: Siekmanski on May 04, 2018, 10:32:53 PMIf I only knew how to manipulate the GDI queueing management to get it to draw instantaneously

Would be interesting to see how much time it takes between an InvalidateRect (sent e.g. by a separate thread immediately after the VBI) and the arrival of the WM_PAINT message.

Siekmanski

I've tried that, and it is also queued, not preventing the stutters.
Also send InvalidateRect at exactly 60Hz to let WM_PAINT handle things with and without the BeginPaint and EndPaint functions. No success.
Creative coders use backward thinking techniques as a strategy.

felipe

There's a message named wm_erasebkgnd. It's used to erase the background, but i really don't know if this can help.  :idea:

avcaballero

no need to use it because you previously has defined wndclass.hbrBackground = 0

daydreamer

It runs smooth on my XP and win8,but few months before I ran lots of compability tests on old ddraw, but also some other GDI code and very little worked on win8, so I dont see a future in GDI coding,when it comes with wrestle win10 and next OS's to get it work
the only future I see for 2d .is load vram full of images and let hardware accelerated dx with all the whistles and bells( read all antialias etc filters and pixelshaders you want to use or not)

my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

Siekmanski

Still many people use GDI for there Games or Demos.
They like it because you can create old school 2D stuff without using OpenGL or DirectX.
I can understand that, because it is fun to write your own pixel manipulation effects as in the old days.

The only thing, there is no GDI function to wait for the vertical blank that really works.
DirectDraw has the WaitForVerticalBlank function but doesn't work on Win10 out of the box.
With Vista, microsoft implemented the D3DKMTWaitForVerticalBlankEvent function.
I wanted a function that worked at least on Win XP, Win 10 and all the operating systems in between.
The only challenge left is, can we take over control of the GDI drawing qeueuing meganism?

IMHO, the best way to create really smooth, stutter free old school 2D stuff is, setting up Direct3D9 in 2D modus.
You can use an empty 2D Texture ( with a pointer to the pixel data ) to do your pixel manipulation just as in GDI.
As Magnus mentions in the previous post, you have access to all the functions of the video card to do all kind of amazing effects, you don't have in GDI.
Creative coders use backward thinking techniques as a strategy.