Recent

Author Topic: Problems with TOpenGLControl  (Read 2648 times)

MorbidFractal

  • Jr. Member
  • **
  • Posts: 97
Problems with TOpenGLControl
« on: March 01, 2015, 06:37:28 pm »
I cannot be certain that the title matches the problem.

I have a TOpenGLControl on a TFrame. The Frame is created at the time the program starts up and parented to a Panel on the Main Form..

From the Main Form Unit..

Code: [Select]
procedure TPanelForm.FormCreate(Sender: TObject);
begin
  OGLUnit00.ProduceFrame();
  ActiveFrame := -01;
  UserName := 'panelcad';
  PassWord := 'panelcad';
  DBUnit00.LoadAll();
  ComboBox01.ItemIndex := 00;
  ComboBox01CloseUp(Nil);
end;

From the Frame that contains the TOpenGlcontrol..

Code: [Select]
procedure ProduceFrame();
begin
  OGLFrame := TOGLFrame.Create(nil);
  With OGLFrame do
  begin
    Parent := PanelForm.Panel4;
    Align  := alClient;
    OGLControl.DoubleBuffered := True;
  end;
end;

Code: [Select]
constructor TOGLFrame.Create(TheOwner: TComponent);
begin
  inherited Create(TheOwner);
  MyObj := TObject.Create;
end;

I'm collecting data from another Frame parented to a separate Panel on the main form which is then used to redraw things on the TOpenGLControl.

I am sure it is going to be consistent but in many respects it is not. I can spend a while changing the data and things carry through with the TOpenGLControl updating itself but... 'occasionally' when moving the mouse into the TOpenGLControl the program falls over with one of two different complaints.

I should mention that most times it has no problems with moving the mouse into the control and that when the mouse is in the control the screen is being redrawn on the MouseMove event to display a drawn rather than system cursor.

Moans and Assembler attached.  Hopefully I have picked the right pictures.

I should also mention that there is a distinct possibility that the problem exists elsewhere but I cannot get my head around why that should be the case...

Any suggestions?

Oh...

Version #: 1.0.10+dfsg-1
Date: 2015-02-13
FPC Version: 2.6.2
SVN Revision: 41613
i386-linux-gtk 2

Linux Mint Mate 17.0

« Last Edit: March 01, 2015, 06:54:30 pm by MorbidFractal »

Ocye

  • Hero Member
  • *****
  • Posts: 518
    • Scrabble3D
Re: Problems with TOpenGLControl
« Reply #1 on: March 02, 2015, 12:53:46 pm »
I don't have any problem with TOpenGLControl, especially under Gtk (Qt makes trouble). When I get a sigsev it's usually related to my procedure, e.g. when I try to pick an object's ID on move.

If you suspect the frame to be responsible for the sigsev you could try alternatives.

You are running 2.6.2, the recent version is 2.6.4 (3.x is work in progress). But that should not influence OpenGL as a feature of LCL.

When you create OGLFrame you set the owner to nil. Doesn't make self/application.x more sense?
Lazarus 1.7 (SVN) FPC 3.0.0

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Problems with TOpenGLControl
« Reply #2 on: March 02, 2015, 03:51:53 pm »
Any suggestions?
Use the debugger, get a stacktrace, recompile LCL and OpenGLControl with debug info if needed. I can't see anything from what you describe.

MorbidFractal

  • Jr. Member
  • **
  • Posts: 97
Re: Problems with TOpenGLControl
« Reply #3 on: March 02, 2015, 07:02:53 pm »
Thanks for the replies.

Appreciated.

End of day finds me being very tired and useless with other stuff elsewhere.

@Ocye

I regularly generate SIGSEV errors by trying to reference something that did not exist and it is usually down to trying to write or read from the wrong part of an 'array' somewhere. If and when the light bulb goes on that sort of mistake gets fixed.

This one may be the same but it strikes me as being slightly different . I am not trying to write or read things. I am just waggling the mouse about the place.

@Leledumbo

You speak beyond my lack of experience. I have only just learned the blue dots are possible 'break points' and having set one and reached it I can move forward with F7 until it says it cannot load some particular resource.


 

TinyPortal © 2005-2018