Results 1 to 2 of 2

Thread: Cursed bug

  1. #1
    Senior Member Regular Contributor
    Join Date
    Oct 2000

    Cursed bug

    It was one of the most annoying bugs I ever seen.
    I took HDC of window on which OGL was rendering only once at program starup.
    There was three tabsheets on my Delphian form. When I switched between
    first and third tabsheets all was OK. And when I switched between second
    and third all was OK. But direct switching between first and second tabsheets
    caused DC's change. And it became no more valid, and that caused SwapBuffers
    failure. (I dont do anything on switch, that's Delphi). But sometimes DC
    became valid for a short period of time.
    (maybe, DC was switching randomly, sometimes coming to starting value).
    When I started doing DC:=GetDC(Handle) each frame all became OK.
    But it still isn't clear.

    PS.Should I call ReleaseDC after GetDC?

  2. #2
    Member Newbie
    Join Date
    Dec 2000
    Donetsk, Ukraine

    Re: Cursed bug

    This is may be some VCL gluck, but if it works with GetDC every time - then leave it. Calling ReleaseDC same number of times is advisable (even if now it works without it, maybe in next version of Windows it will not??).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Proudly hosted by Digital Ocean