Thread: BitBlt and vertical retrace

  1. #1
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145

    BitBlt and vertical retrace

    I'm having troubles with the vertical retracer when blitting a lot of images using BitBlt (windows GUI program). The window becomes very flickery.
    Is there any way to start the rendering sequency just after the vertical retracer have finished?

    I'm also having troubles with a non-working scrollbar. I create it using CreateWindow();
    Code:
    ScrollHandle = CreateWindow("SCROLLBAR", "-+UnusedString+-",
       WS_CHILD | WS_VISIBLE | SBS_HORZ, 0, 480, 640, 20, hWnd,
       (HMENU)Scrollbar, GlobalInst, NULL);
    (GlobalInst = the HINSTANCE sent to WinMain)

    Later I set the range using SetScrollInfo();
    Code:
    SCROLLINFO TempScroll;
    TempScroll.cbSize = sizeof(SCROLLINFO);
    TempScroll.fMask = SIF_RANGE | SIF_POS;
    TempScroll.nMin = 0;
    TempScroll.nMax = Width-20;
    TempScroll.nPage = 0;
    TempScroll.nPos = 0;
    TempScroll.nTrackPos = 0;
    SetScrollInfo(ScrollHandle, SB_CTL, &TempScroll, TRUE);
    But the scrollbar won't respond to mouse clicks properly, you cannot "scroll" the scrollbar...
    Any idea what could be wrong?
    Last edited by Magos; 06-14-2002 at 01:36 PM.
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  2. #2
    Registered User
    Join Date
    Apr 2002
    Posts
    1,571

    Re: BitBlt and vertical retrace

    Originally posted by Magos
    I'm having troubles with the vertical retracer when blitting a lot of images using BitBlt (windows GUI program). The window becomes very flickery.
    Well to my knowledge you cannot draw during the vertical blank interval with GDI like you can with DirectX. But to avoid some of the "visual artifcats" try creating a compatible DC and blitting the image there first like a back buffer. This usually helps a lot.

Popular pages Recent additions subscribe to a feed