flat assembler
Message board for the users of flat assembler.

Index > Windows > achieving smooth 60 fps with GDI

Author
Thread Post new topic Reply to topic
tthsqe



Joined: 20 May 2009
Posts: 767
tthsqe 02 Oct 2012, 20:50
So I have been using the CreateDIBSection thingy along with a BitBlt to the window and have noticed that it very rarely produces stutter-free movies when the window is larger than, say, 400x600. (the cpu can finish the computation of the frame at a much higher rate than 60fps). It there another higher performance interface that can be used?
Post 02 Oct 2012, 20:50
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20415
Location: In your JS exploiting you and your system
revolution 02 Oct 2012, 21:03
DirectX?

CUDA/OpenCL?

Note that frame rates will be dependant upon many factors like what video hardware your have and what background tasks you run etc.

It is common to have to use double, and sometimes triple, buffering to get consistent frame rates even when using the GPU.


Last edited by revolution on 03 Oct 2012, 11:36; edited 1 time in total
Post 02 Oct 2012, 21:03
View user's profile Send private message Visit poster's website Reply with quote
nmake



Joined: 13 Sep 2012
Posts: 192
nmake 03 Oct 2012, 11:34
tthsqe, if you get stutter at 400x600 you are doing something wrong. When I code masm and I use 1920 x 1200 window using dib sections, I can output 200 million pixels randomly (using pseudo random generator) every second achieving 86 frames per second. And this all while using pseudo random (which is very slow)

When I don't output random pixels all over the screen it is not uncommon to achieve several hundred frames per second. of course you won't see all those frames.

If you want more frames you can go for a resolution that allows 75 fps using direct3d.
Post 03 Oct 2012, 11:34
View user's profile Send private message Reply with quote
tthsqe



Joined: 20 May 2009
Posts: 767
tthsqe 04 Oct 2012, 03:53
the 400x600 figure was indeed a little too small. more like 720x1300
My bad - I suppose it was the frame computation, which happens to be very memory & cpu intensive, that was getting in the way.
If the frame computation can be completed at a rate of over 120 fps, it seems that the playback is smooth at 60 fps.
If the frame computation rate hovers around or just above the playback rate, then it gets stuttery.
Post 04 Oct 2012, 03:53
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.