[solved] OpenGL: Could not find FB config. lazarus / 70-OpenGL ---------------------------------------------------------------------- Ocye · 2012-06-12 16:20 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 ---------------------------------------------------------------------- Ocye · 2012-06-16 12:49 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); ---------------------------------------------------------------------- zamtmn · 2012-06-25 14:24 Hi. Perhaps this patch solves the problem? ---------------------------------------------------------------------- Ocye · 2012-06-25 15:54 No, FBConfigsCount is still 0 (rev 37777 with patch). ---------------------------------------------------------------------- zamtmn · 2012-08-21 20:41 I also get this error when dynamically creating OpenGLContext in OnCreate form handler. If moved it to OnShow all starts working ---------------------------------------------------------------------- User137 · 2012-08-22 23:03 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 · 2012-08-22 23:24 Quote from: User137 on August 23, 2012, 01:03:09 amIs 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. ---------------------------------------------------------------------- zamtmn · 2012-09-13 03:48 http://bugs.freepascal.org/view.php?id=22868 ---------------------------------------------------------------------- zamtmn · 2012-09-18 07:33 Ocye it work after rev38678? ---------------------------------------------------------------------- Ocye · 2012-09-27 10:21 Yes, it works perfectly. (tested with revision 38851)