News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

GDI Vertical blank and vertical retrace test

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

Previous topic - Next topic

FORTRANS

Hi,

   Tested engine5, and it works on Win XP.  No retrace signal,
test value 480.  (Yesterday, engine3 failed, by that time you had
put out engine4.)

Regards,

Steve N.

avcaballero

Congrats. Now it closes fine (v6). Nevertheless I'd say that I can observe some stumbles in the scrolling.

Siekmanski

Thanks guys for testing and the reports.  :t

Here a demo with Caballeros scrolling floor routine.
I could not apply the jitter correction factor on this routine because this routine takes integer steps for drawing the floor.
So, some stutters can be there.

One thing I noticed!

When running another GDI program that does blitting or drawing to the screen, my program starts to stutter else it is very smooth.
This stuttering doesn't take place when running at the same time with a DirectX program only with another GDI program.

I think because my program does not use BeginPaint and EndPaint, the screen BitBlt gets invoked by the GDI pipeline when other programs also using the GDI pipeline????
Creative coders use backward thinking techniques as a strategy.

daydreamer

tested on a extreme monitor,where I could test up to 200 mhz,234.370 fps
it ran smooth and very fast,but I guess that maybe not good for a fast game become 3 times faster

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

Then I have to implement a presentation interval, will be done.  :t
Creative coders use backward thinking techniques as a strategy.

daydreamer

Quote from: Siekmanski on April 28, 2018, 04:19:11 AM
Then I have to implement a presentation interval, will be done.  :t
I dont think its necessary as it can run on 60hz and many faster hz,I just remembered it was capable of upto 200hz, so I tested it
it shows your code is good enough to work even with so fast hardware :t
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

Cool.  8)

Presentation intervals can help for heavy games, to let it run at a steady 30 FPS for example.
Creative coders use backward thinking techniques as a strategy.

jj2007

I wonder if it would make sense to have a thread waiting for the vertical interrupt, and then just did an InvalidateRect.

Siekmanski

That was my first thought also, but GDI does not draw at a certain interval and it uses a sort of an event queue. I like to do the drawing whenever I want and at an even interval so the workload is evenly divided.
InvalidateRect, no need to use it, we own the window.
Direct3d9 offers all of this, I was curious if it would be possible with GDI.
And with using a timer thread we have the possibility to execute our routines while the thread takes care of the buffer switch, clearing the background and other things simultaneous

I'm not going to abandon Direct3d9 it's much cooler and faster than GDI.
Creative coders use backward thinking techniques as a strategy.

avcaballero

Hello.

- FloorWM01. Demo with GetMessage, so very little system resources needed.
- FloorWM02. Same demo with PeekMessage, FPS stabilizer and no WM_PAINT using. Much more system resources needed.

I wonder if PeekMessage worths the pity. Any one see any difference? Thank you

Siekmanski

FloorWM01.exe GetMessage 0 %
FloorWM02.exe PeekMessage 7-8 %

My proggy with your Floor Routine uses 0.5 % with PeekMessage + vertical blank.

This is my Message Pump:
    .while msg.message != WM_QUIT
        invoke PeekMessage,addr msg,NULL,0,0, PM_REMOVE
        .if (eax)
            invoke  TranslateMessage,addr msg
            invoke  DispatchMessage,addr msg
        .endif
        invoke RenderGDI    ; do the rendering stuff
    .endw
Creative coders use backward thinking techniques as a strategy.

jj2007

GetMessage 0, PeekMessage 20% (and both flicker a little bit)

avcaballero

Quote from: Siekmanski on April 29, 2018, 01:29:01 AM
This is my Message Pump:
    .while msg.message != WM_QUIT
        invoke PeekMessage,addr msg,NULL,0,0, PM_REMOVE
        .if (eax)
            invoke  TranslateMessage,addr msg
            invoke  DispatchMessage,addr msg
        .endif
        invoke RenderGDI    ; do the rendering stuff
    .endw

I checked this out, but I've got an error on exit, so I have to use this one:

    .WHILE    TRUE
      MessageLoop:
      invoke PeekMessage, ADDR msg, 0, 0, 0, PM_NOREMOVE
      .if eax != 0
          invoke GetMessage, ADDR msg, 0, 0, 0
          or eax, eax
          jz L_Fin
          invoke TranslateMessage, ADDR msg
          invoke DispatchMessage, ADDR msg
          jmp MessageLoop
      .endif
      [... My tasks here... ]
    .ENDW

Your program uses much less system resources but at least in my system also with flickering

Siekmanski

QuoteYour program uses much less system resources but at least in my system also with flickering.

I couldn't run it with the jitter correction factor because how your motion value is imbedded in the routine itself.
When I run mine together with other GDI programs on the background it stutters.
But when I run it without other running GDI programs it is smooth.

Timing in Windows Sucks.  :icon13:
Creative coders use backward thinking techniques as a strategy.

avcaballero

> When I run mine together with other GDI programs on the background it stutters.
> But when I run it without other running GDI programs it is smooth.

ah, it's possible :t. Not everything was going to be simple...