Recent

Author Topic: GLScene Linux bug?  (Read 6094 times)

dicepd

  • Full Member
  • ***
  • Posts: 163
GLScene Linux bug?
« on: August 28, 2017, 10:46:42 am »
I cannot get a GLSceneViewer to display on a tabbed pagecontrol at runtime. In design time I can see the scene, switch between tabs and all looks fine.
However running the app all I get is a blank tabsheet.
The navigator is reporting fps when I try to 'spin' the view, so it would appear to be rendering somewhere, but not getting drawn to to screen.
This works fine in Win64.


Linux version Mint 17.2 64bit
fpc 3.0.4rc1
Laz  1.8.0rc4 x64_gtk

Attached is the most basic of test app that shows the bug.

This is what it should look like when run (screenshot from win64)

Peter
Lazarus 1.8rc5 Win64 / Linux gtk2 64 / FreeBSD qt4

BeanzMaster

  • Sr. Member
  • ****
  • Posts: 268
Re: GLScene Linux bug?
« Reply #1 on: August 28, 2017, 11:47:29 pm »
Hi Peter, I don't have Linux. I'm really need to install a version.

I take a look in the code, and it seems the possible error provide from :
1st : It is internal to the LCL and the Tab component (but why ?)
2nd :  the problem can provide from GLWidgetContext.pas in "procedure TGLWidgetContext.DoGetHandles(outputDevice: HWND; out XWin: HWND);"  around line 143. The Handle may not be valid.

It's all i can do at this time. Sorry to not be able to do more.

Cheers
« Last Edit: August 28, 2017, 11:51:49 pm by BeanzMaster »

dicepd

  • Full Member
  • ***
  • Posts: 163
Re: GLScene Linux bug?
« Reply #2 on: August 30, 2017, 05:06:34 pm »
Quote
2nd :  the problem can provide from GLWidgetContext.pas in "procedure TGLWidgetContext.DoGetHandles(outputDevice: HWND; out XWin: HWND);"  around line 143. The Handle may not be valid.

Jerome I had a dig around this area and it would appear that the GTKWidget does not have a valid window as seen from the variable evaluation in a debug of this routine. There looks to be a valid input to the outputdevice parameter.

so the call

Code: Pascal  [Select][+][-]
  1. XWin := GDK_WINDOW_XWINDOW(PGdkDrawable(vGTKWidget^.window));  

is always going to return 0 if vGTKWidget^.window has a zero value.

Peter

Code: [Select]
<TGTKWIDGET> = {
  ANOBJECT = {
    PARENT_INSTANCE = {
      G_TYPE_INSTANCE = {
        G_CLASS = $1209ef0},
      REF_COUNT = 1,
      QDATA = $120a9e0},
    FLAGS = 2100768},
  PRIVATE_FLAGS = 15744,
  STATE = 0,
  SAVED_STATE = 0,
  NAME = $0,
  STYLE = $1122020,
  REQUISITION = {
    WIDTH = 0,
    HEIGHT = 0},
  ALLOCATION = {
    X = 48,
    Y = 132,
    WIDTH = 302,
    HEIGHT = 176},
  WINDOW = $0,
  PARENT = $11fc490}

« Last Edit: August 30, 2017, 05:08:07 pm by dicepd »
Lazarus 1.8rc5 Win64 / Linux gtk2 64 / FreeBSD qt4

BeanzMaster

  • Sr. Member
  • ****
  • Posts: 268
Re: GLScene Linux bug?
« Reply #3 on: August 31, 2017, 10:25:16 pm »
Hi, Peter, I've dig too. But not found anything. I don't understand well GTK2Widgets. And i can't test. The better will be ask in the Unix forum here. I'll do some deep search.

In Waiting,  perhaps, try  changing vGTKWidget^.window to vGTKWidget^.parent^.Window

One thing else you can try to add a TPanel on the tab and TGLViewer on this TPanel to see.

jérôme.

dicepd

  • Full Member
  • ***
  • Posts: 163
Re: GLScene Linux bug?
« Reply #4 on: September 02, 2017, 11:10:12 am »
In Waiting,  perhaps, try  changing vGTKWidget^.window to vGTKWidget^.parent^.Window

It would seem that none of the parents have a window attribute which is not $0.


One thing else you can try to add a TPanel on the tab and TGLViewer on this TPanel to see.

Similar to above except I now have an extra parent with a null for the window atrribute.

It would seem this is getting called before the GTKWidgets are properly initialised. I also am not very conversant with GTK window handling and the gtk model of doing things. None of the parents have thier positions or sizes set at the point this call is made, pos is -1,-1 and size is 1,1 for all parent widgets. Pos and size are set according to the properties set in the ide for the scene viewer though.

Peter
« Last Edit: September 02, 2017, 11:20:29 am by dicepd »
Lazarus 1.8rc5 Win64 / Linux gtk2 64 / FreeBSD qt4

 

TinyPortal © 2005-2018