GLscene Runtime & Designtime difference lazarus / 5-Lazarus Extra Components ---------------------------------------------------------------------- mmab · 2010-11-03 17:20 Hi, I've noticed an unusual behavior of the GLsceneviewer. If I create the glsceneviewer at designtime everything works fine. However, if I create it in runtime using the following code, Code: [Select]unit ... uses   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,   ExtCtrls, GLScene, GLViewer, Unit2; type   TForm1 = class(TForm)    ...     procedure GLSceneViewer1MouseDown(Sender: TObject; Button: TMouseButton;      Shift: TShiftState; X, Y: Integer);     procedure GLSceneViewer1MouseMove(Sender: TObject; Shift: TShiftState; X,      Y: Integer);   private     { private declarations }   public     { public declarations }     GLSceneViewers: array of TGLSceneViewer;   end; var   Form1: TForm1;    mx, my:integer; implementation {$R *.lfm} { TForm1 } procedure TForm1.Button1Click(Sender: TObject); var id:integer; begin   id := length(GLSceneViewers);   setlength(GLSceneViewers,id+1);   GLSceneViewers[ id ] := TGLSceneViewer.Create(frame1_1);   GLSceneViewers[ id ].Parent:=frame1_1;   GLSceneViewers[ id ].Align:=alclient;   GLSceneViewers[ id ].Camera:=frame1_1.GLCamera1;   GLSceneViewers[ id ].Buffer.BackgroundColor:=clwhite;   GLSceneViewers[ id ].Buffer.Lighting:=false;   GLSceneViewers[ id ].OnMouseDown:=GLSceneViewer1.OnMouseDown;   GLSceneViewers[ id ].OnMouseMove:=GLSceneViewer1.OnMouseMove;   GLSceneViewers[ id ].RecreateWnd; end; procedure TForm1.GLSceneViewer1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin    mx:=x; my:=y; end; procedure TForm1.GLSceneViewer1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); begin    if Shift<>[] then begin       (sender as  TGLSceneViewer).Camera.MoveAroundTarget(my-y, mx-x);       mx:=x; my:=y;    end; end;            the glsceneviewer screen flashes ( becomes black and white while rotating and stays black ). any ideas to solve this strange behaviour? Moreover, it is not possible to create a frame which has a Glsceneviewer. It is giving "control frame1 has no parent window" error. Is this normal? Thanks in advance ---------------------------------------------------------------------- mrBrown · 2010-12-01 07:34 You are creating an array of GLScene viewers with the same parent. So you have multiple viewers at the same location your screen. I do not know what you are trying to do, but this might well be the source of the flashing. ---------------------------------------------------------------------- mmab · 2010-12-04 19:53 It happens with a single GLscene also. Any idea about the frame problem? Thanks ---------------------------------------------------------------------- Laksen · 2010-12-05 02:43 I think that problem appeared in an old release of glscene. Try the trunk version of glscene and lazarus