Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 30

Thread: TBitmap vs. CreateDIBsection

  1. #11
    PGDCE Developer de_jean_7777's Avatar
    Join Date
    Nov 2006
    Location
    Bosnia and Herzegovina (Herzegovina)
    Posts
    259

    Re: TBitmap vs. CreateDIBsection

    Quote Originally Posted by FusionWolf
    Yeah, but does the shuttle move smoothly?
    The application moved relatively smoothly. However, the shuttle had a twitching movement(you could say it made small jumps). You can notice this when running without the backbuffer, as the shuttle leaves a inconsistent trail when it is supposed to run with consistent speed.

    Quote Originally Posted by FusionWolf
    Open delphi and run my GDI test application
    Don't have Delphi, but I don't think this is only related to Delphi.

    Quote Originally Posted by FusionWolf
    I assume that the game (Meteors) moved smoothly on your PC?
    The game ran very smoothly and the ship had a fluid motion. There were no signs of twitching movement.
    In defeat we learn.

  2. #12

    Re: TBitmap vs. CreateDIBsection

    YES!! Finally I got it right. And thanks goes to de_jean_7777 for doubting my timing functions.

    I made some test and noticed that my timer leaps forward on time to time for some sort of bug from Microsoft side (thats why my shuttle 'jumps' ahead between the frames). there's even knowledge artice on MSDN about that bug.

    Now I'm using both timers (TimeGetTime and QueryPerformanceCounter) together and when other leaps ahead another, then time difference is fixed with some calculation of about what the time should be. (This I realized when I found an article telling about physics simulation on computer).

    I also found that GetDevicaps() can retrieve minimum and maximum timer resolutions which I took to use with TimeBeginPeriod and TimeEndPeriod routines.

    Now everything goes smoothly with decent ~2000 frames per second at my laptop (Core 2 Duo T9500 @ 2,4GHz with nVidia Quadro FX 1600M 512MB)

    Tomorrow I will put up a new application which can be downloaded from here with a source code. No need for DIBs anymore. CompatibleBitmap does it what's expected.

    Thanks again de_jean_7777 to point me to the right tracks.


    edit: And what comes to that Meteors 'game' it uses excactly the same timing functions than that GDI blit example, but DirectX handles the bad behavior somehow 'silent' at background.

    Here's the executable with the new timer. It's still very, very unfinished (no error handling, no DIB back buffer, no optimization and etc.), but one can try and see the difference.

    Here you go: http://www.saunalahti.fi/hag/share/GDIBlitting2.exe
    - In a world without the wall and fences, who will need the Gates and Windows.

  3. #13
    PGDCE Developer de_jean_7777's Avatar
    Join Date
    Nov 2006
    Location
    Bosnia and Herzegovina (Herzegovina)
    Posts
    259

    Re: TBitmap vs. CreateDIBsection

    I am glad I was able to help and I am glad you got your application working. Microsoft is full of strange bugs.

    I also tested the new application on my PII 400 with a nVidia TNT2 M64. Funnily, the framerate is similar to the one on my AMD computer, 120 ~ 150 FPS.
    In defeat we learn.

  4. #14

    Re: TBitmap vs. CreateDIBsection

    I have to resume on this timing issue problem. I already thought that all is fine and working, but no...

    I still noticed some glitches and jumps here and there with that second GDIBlitting example and begun wondering what the heck.

    After a while I realized that the loop goes so fast that there is no time difference between the call of TimeGetTime on each loop.

    So, I made an array and begun to collect elapsed times between the updates into it. Array is size of 10 cells. Then I set a break point at the code after a tenth loop. I looked the values in the array on noticed that only 2 cells had a value other than zero!! (my GetTime() -method gives result in seconds how much time has passed since initiazation of timer class).

    Then I made lot's and lot's of more similar tests and noticed same thing again and again. So the conclusion is that the loop goes so fast that timer has no resolution to measure the difference between calls.

    Now I implemented new timer. It collects elapsed times to array as I mentioned and calculates average of those time which isn't zeros. So, if array has 10 values and three of them is another than zero then the sum of those values is divided by three and that's the result of elapsed time since previous call.

    I'm currently putting up a new test application (again) with this 'MyGameTimer' and share it here (with sources) later on today / night.

    It uses compatible bitmap as an back buffer, which is actually all ok. (the issue of a thread is not about a back buffer anymore as it was at the very begining ).
    - In a world without the wall and fences, who will need the Gates and Windows.

  5. #15

    Re: TBitmap vs. CreateDIBsection

    Okey, here it comes the final test application for this thread (finally)

    An executable with the sources as promised. The sources are not commented (except the timer part), but they are very self explanatory.

    I appreciate if people who try this would report how it works on their computer. Maybe the major specs. of the used computer would be also nice to know among the achieved FPS.

    Ouh, and if there's something to point out at the source code, feel free to give a comment. Anykind of feedback is welcome.

    I continue to develop the 'real thing' (GDI version of Asteroids) and put up a link at here somewhere, where people can download it among with the source codes of course.

    But, here you go:

    http://www.saunalahti.fi/hag/share/MyGame.zip


    Use arrow keys to float around.
    - In a world without the wall and fences, who will need the Gates and Windows.

  6. #16

    Re: TBitmap vs. CreateDIBsection

    I'm getting around 54-55 FPS on my work computer:

    Win XP SP3
    Intel(R) Core(TM)2 Quad CPU
    2.83 GHz
    3.35 GB RAM

    cheers,
    Paul

  7. #17

    Re: TBitmap vs. CreateDIBsection

    1000 fps exactly, didn't change anywhere during the whole runtime.

    Intel Core 2 Duo E8400, 3 Ghz
    2 GB RAM
    Geforce 8600 GT

  8. #18

    Re: TBitmap vs. CreateDIBsection

    Quote Originally Posted by paul_nicholls
    I'm getting around 54-55 FPS on my work computer:

    Win XP SP3
    Intel(R) Core(TM)2 Quad CPU
    2.83 GHz
    3.35 GB RAM

    cheers,
    Paul
    That's very strange. Which display adapter you may have on that computer? I'm also getting 1000fps as User137 (that's maximum) with 3 different computers.

    - Intel Core2Duo T9500 @ 2,4GHz 2GB RAM and nVidia Quadro FX 1600M 512MB

    - Intel Pentium 4 2,8Ghz 1GB RAM and ATI Radeon X300 128MB

    - AMD Duron 1,6GHz 2GB RAM and ATI Radeon 9600XT 256MB


    Can you tell me (approximately) what the rendering time is showing to you?
    - In a world without the wall and fences, who will need the Gates and Windows.

  9. #19

    Re: TBitmap vs. CreateDIBsection

    Quote Originally Posted by FusionWolf
    Quote Originally Posted by paul_nicholls
    I'm getting around 54-55 FPS on my work computer:

    Win XP SP3
    Intel(R) Core(TM)2 Quad CPU
    2.83 GHz
    3.35 GB RAM

    cheers,
    Paul
    That's very strange. Which display adapter you may have on that computer? I'm also getting 1000fps as User137 (that's maximum) with 3 different computers.

    - Intel Core2Duo T9500 @ 2,4GHz 2GB RAM and nVidia Quadro FX 1600M 512MB

    - Intel Pentium 4 2,8Ghz 1GB RAM and ATI Radeon X300 128MB

    - AMD Duron 1,6GHz 2GB RAM and ATI Radeon 9600XT 256MB


    Can you tell me (approximately) what the rendering time is showing to you?
    The 54-55 FPS was with this file you gave us:

    http://www.saunalahti.fi/hag/share/MyGame.zip

    I have two graphics cards (as I have 3 monitors at work):
    NVidia GeForce 8400 GS
    NVidia GeForce FX 5200

    The rendering time seems to be between 0.0184 - 0.0186
    I hope this helps?

    cheers,
    Paul

  10. #20

    Re: TBitmap vs. CreateDIBsection

    Quote Originally Posted by paul_nicholls

    The 54-55 FPS was with this file you gave us:

    http://www.saunalahti.fi/hag/share/MyGame.zip

    I have two graphics cards (as I have 3 monitors at work):
    NVidia GeForce 8400 GS
    NVidia GeForce FX 5200

    The rendering time seems to be between 0.0184 - 0.0186
    I hope this helps?

    cheers,
    Paul
    Yes, that's the lates file I shared.

    Maybe there's something to do with those multiple screens, I don't know... Perhaps. I have to do some test with multiple monitors on my working place.

    Can you give me your averge rendering time which you see at the top of the game window?

    Thank's for your very valuable reply.
    - In a world without the wall and fences, who will need the Gates and Windows.

Page 2 of 3 FirstFirst 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Comodo SSL