Recent

Author Topic: [solved] OpenGL: Could not find FB config.  (Read 8789 times)

Ocye

  • Hero Member
  • *****
  • Posts: 518
    • Scrabble3D
[solved] OpenGL: Could not find FB config.
« on: June 12, 2012, 06:20:50 pm »
I use LazOpenGLContext successfully for some time. But after one of the recent LCL updates, I get the mentioned error when the context becomes visible. The example runs perfectly. However, I don't do any advanced stuff. Just standard Gl and Glu. Any idea where to look for the problem?

Lazarus 1.1 r37618 FPC 2.6.0 x86_64-linux-qt (compile target is gtk2)
Linux version 3.3.8-1-ARCH (tobias@T-POWA-LX) (gcc version 4.7.0 20120505 (prerelease) (GCC) ) #1 SMP PREEMPT Tue Jun 5 15:20:32 CEST 2012
« Last Edit: September 27, 2012, 12:19:55 pm by Ocye »
Lazarus 1.7 (SVN) FPC 3.0.0

Ocye

  • Hero Member
  • *****
  • Posts: 518
    • Scrabble3D
Re: OpenGL: Could not find FB config.
« Reply #1 on: June 16, 2012, 02:49:51 pm »
It works if I replace changes in gdk_gl_context_share_new() with rev 37115. Is attrList[] really assigned to valid data?

Code: [Select]
{$IFDEF UseFPGLX}
  FBConfig: TGLXFBConfig;
  FBConfigs: PGLXFBConfig;
  FBConfigsCount: Integer;

  { Attributes to choose context with glXChooseFBConfig.
    Similar to Attr, but not exactly compatible. }
  AttrFB: Array[0..10] of integer = (
            GLX_X_RENDERABLE, 1 { true },
            GLX_RED_SIZE, 1,
            GLX_GREEN_SIZE, 1,
            GLX_BLUE_SIZE, 1,
      GLX_DOUBLEBUFFER, 1 { true },
      none);
{$ENDIF}
...
FBConfigs:=glXChooseFBConfig(dpy, DefaultScreen(dpy), AttrFB, FBConfigsCount);
Lazarus 1.7 (SVN) FPC 3.0.0

zamtmn

  • Hero Member
  • *****
  • Posts: 509
Re: OpenGL: Could not find FB config.
« Reply #2 on: June 25, 2012, 04:24:44 pm »
Hi.
Perhaps this patch solves the problem?
« Last Edit: June 25, 2012, 04:36:53 pm by zamtmn »

Ocye

  • Hero Member
  • *****
  • Posts: 518
    • Scrabble3D
Re: OpenGL: Could not find FB config.
« Reply #3 on: June 25, 2012, 05:54:11 pm »
No, FBConfigsCount is still 0 (rev 37777 with patch).
Lazarus 1.7 (SVN) FPC 3.0.0

zamtmn

  • Hero Member
  • *****
  • Posts: 509
Re: OpenGL: Could not find FB config.
« Reply #4 on: August 21, 2012, 10:41:14 pm »
I also get this error when dynamically creating OpenGLContext in OnCreate form handler. If moved it to OnShow all starts working

User137

  • Hero Member
  • *****
  • Posts: 1791
    • Nxpascal home
Re: OpenGL: Could not find FB config.
« Reply #5 on: August 23, 2012, 01:03:09 am »
My little game engine nxPascal has like forever now created LazOpenGLContext dynamically at FormCreate, but i use win32.

Is this gtk related, or are you creating it with nil owner?

Ocye

  • Hero Member
  • *****
  • Posts: 518
    • Scrabble3D
Re: OpenGL: Could not find FB config.
« Reply #6 on: August 23, 2012, 01:24:22 am »
Is this gtk related, or are you creating it with nil owner?

function gdk_gl_context_share_new() is defined in GLGtkGlxContext which is switched on/off in OpenGLContext
Code: [Select]
{$IFDEF UseGtk2GLX}
  GLGtkGlxContext;
{$ENDIF}
{$IFDEF UseCarbonAGL}
  GLCarbonAGLContext;
{$ENDIF}
{$IFDEF UseWin32WGL}
  GLWin32WGLContext;
{$ENDIF}

As far as I remember it was/is a Gtk2 issue only.

The Gl context is created dynamically.
Code: [Select]
TScrabbleCube=class(TOpenGLControl)
public
  constructor Create(aOwner:TComponent);override;
end;

constructor TScrabbleCube.Create(aOwner: TComponent);
begin
  inherited Create(aOwner);
  Parent:=aOwner as TWinControl;
...

TMain.OnSomething()
  ScrabbleCube:=TScrabbleCube.Create(pn3D);

The code runs well with my patch.
Lazarus 1.7 (SVN) FPC 3.0.0

zamtmn

  • Hero Member
  • *****
  • Posts: 509
Re: OpenGL: Could not find FB config.
« Reply #7 on: September 13, 2012, 05:48:25 am »

zamtmn

  • Hero Member
  • *****
  • Posts: 509
Re: OpenGL: Could not find FB config.
« Reply #8 on: September 18, 2012, 09:33:27 am »
Ocye
it work after rev38678?

Ocye

  • Hero Member
  • *****
  • Posts: 518
    • Scrabble3D
Re: [solved] OpenGL: Could not find FB config.
« Reply #9 on: September 27, 2012, 12:21:18 pm »
Yes, it works perfectly.
(tested with revision 38851)
Lazarus 1.7 (SVN) FPC 3.0.0

 

TinyPortal © 2005-2018