Results 1 to 5 of 5

Thread: BitBlting 2 images on top of eachother, fighting for top and flickering.

  1. #1

    Thread Starter
    Lively Member FireSlash518's Avatar
    Join Date
    Nov 2001
    Posts
    67

    Unhappy BitBlting 2 images on top of eachother, fighting for top and flickering.

    im trying to draw my units over my terrain (tiled terrain and units that dont stick to the tiles)
    the problem is when i draw the units, i get this flickering where the 2 images are fighting for the top spot, and with 225 fps, its not pretty.

    any way around this? i cant just not render the below image since it might be over 2 or 3 images at once, and not the entire one of any of them. can i set up layers or somthing?

    Leader of the Maxoverkill Mods
    -Fire§lash

  2. #2
    Lively Member
    Join Date
    Sep 2001
    Posts
    74

    Question ?????

    I don't quite understand the question. Flickering in most cases is caused by not using a backbuffer is that the type your talking about?

    In the game I'm working on I only have to worry about two sprites at a time the one who gets blitted first will be underneath the one that gets blitted second you can switch that around just by changing the order they go down. You don't want them on the exact same layer in suto code: (mask1, mask2, sprite1, sprite2) instead you must do (mask1 sprite1 mask2 sprite2) because they will become distorted when they overlap if you do it the first way.

    Anyway my knowledge is not as much as most here. Sorry if that didn't help.
    All will fall before the might of the Black Sashi...

  3. #3

    Thread Starter
    Lively Member FireSlash518's Avatar
    Join Date
    Nov 2001
    Posts
    67
    lets take a simplier example.

    make a loop, nd in this loop blit 2 images on the same spot. they will flicker as they change layers.

    i think a backbuffer would change this but i dont know how to set one up, i only understand them from my small expierences in 3D graphics.

    could you put some source up for me to peck at?

    Leader of the Maxoverkill Mods
    -Fire§lash

  4. #4
    Zaei
    Guest
    When Blitting, the image you draw first will be on the bottom. There wont be any fighting at all. I assume that the entire screen is what is flickering. This is where you need a back buffer. You simple set up an invisible surface (picture box, whatever), and do all of your drawing to that surface (picture box, whatever), then, when you are all done, simply copy the back buffer to the front buffer.

    Z.

  5. #5

    Thread Starter
    Lively Member FireSlash518's Avatar
    Join Date
    Nov 2001
    Posts
    67
    thanks. it cut 100 FPS from my framerates but it solves alot.
    guess it has to blit twice as much, so i wont complain. 125 is still fast. im not done yet, but i should be well above 60 still at the end. then i can always optimise

    Leader of the Maxoverkill Mods
    -Fire§lash

Posting Permissions

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



Click Here to Expand Forum to Full Width