Results 1 to 5 of 5

Thread: Why is desktop dc flickering?

  1. #1

    Thread Starter
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755

    Why is desktop dc flickering?

    hi!
    my prog draws something to the desktop dc, but when im running a game, it starts to flicker!
    why?
    do i have to draw it at the same time as the game draws?
    Last edited by cyborg; Nov 26th, 2002 at 12:07 AM.
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

  2. #2

    Thread Starter
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755
    if i set a form to allways on top, it doesnt flicker, but the things i draw on the desktopdc with setpixelv flickers
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

  3. #3
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    You need to use LockWindowUpdate(GetDesktopWindow) before your SetPixelV calls and then LockWindowUpdate(ByVal 0) after it.... I think. Not sure about the 2nd part, look up how to use LockWindowUpdate.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  4. #4

    Thread Starter
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755
    ok! thanks!
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

  5. #5

    Thread Starter
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755
    hey!
    if i put LockWindowUpdate GetDesktopWindow first and LockWindowUpdate ByVal 0 after, this it what happens:

    lock; drawing stuff not possible
    then draw my stuff, but the DC is locked so it doesnt draw
    unlock; drawing stuff is possible


    if i put it in the other oder:

    unlock; drawing stuff is possible
    then draw my stuff
    lock; drawing stuff not possible



    so what happens is:
    the first way, nothing happens!
    the second way, my stuff is drawn but NO other things, so the screen looks the same all the time untill i press ctrl+alt+del!
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

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