Recent

Author Topic: OpenGLContext and visible true/false  (Read 4589 times)

Ocye

  • Hero Member
  • *****
  • Posts: 518
    • Scrabble3D
OpenGLContext and visible true/false
« on: August 17, 2010, 11:29:20 am »
With one of the latest updates OpenGLContext seems to have changed. When I create the context on a hidden parent the content is black/white on making it visible. This was an issue for older releases when the parent was changed. What can I do?
Lazarus 1.7 (SVN) FPC 3.0.0

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: OpenGLContext and visible true/false
« Reply #1 on: August 18, 2010, 11:50:50 am »
This should be reported in the bug tracker and noted as a regression.  It would also really help if you can find which exact revision broke this. Read more here:

http://wiki.lazarus.freepascal.org/How_To_Help_Developing_Lazarus#Dealing_with_regressions

Ocye

  • Hero Member
  • *****
  • Posts: 518
    • Scrabble3D
Re: OpenGLContext and visible true/false
« Reply #2 on: August 18, 2010, 12:57:04 pm »
Stupid error, as always  ;D
A simple application for the bug tracker worked well so I checked the code again. The problem was that I had implemented a method Repaint() for the glcontrol. Of course this was not a good idea since TOpenGLControl is derived from TWinControl. Now, I placed the code in OnPaint and call simply Invalidate. I don't know why it worked prior the update.
The phenomenon with black/white output persists when I change the parent. I create the GLControl for a TPanel and move (parent:=newform) the panel with all controls into a new form (or back to mainform). It's a crude approach so I don't post it at the bugtracker. Probably it's my failure again.
Lazarus 1.7 (SVN) FPC 3.0.0

 

TinyPortal © 2005-2018