diff --git a/components/opengl/example/imguimain.pas b/components/opengl/example/imguimain.pas index 9867012404..12cd34e37f 100644 --- a/components/opengl/example/imguimain.pas +++ b/components/opengl/example/imguimain.pas @@ -474,7 +474,7 @@ begin glGetIntegerv(GL_SAMPLE_BUFFERS,@samplebuffers); glGetIntegerv(GL_SAMPLES,@samples); DebugLn(['SampleBuffers: ',samplebuffers]); - debugln(['Samples: ',samples]); + Debugln(['Samples: ',samples]); first:=false; end; //setup 2D projection diff --git a/components/opengl/glgtkglxcontext.pas b/components/opengl/glgtkglxcontext.pas index e2d157d2e2..4c9cce2685 100644 --- a/components/opengl/glgtkglxcontext.pas +++ b/components/opengl/glgtkglxcontext.pas @@ -147,6 +147,10 @@ function gtk_gl_area_make_current(glarea: PGtkGLArea): boolean; function gtk_gl_area_begingl(glarea: PGtkGLArea): boolean; procedure gtk_gl_area_swap_buffers(gl_area: PGtkGLArea); +{$IFDEF lclgtk} +function gdk_x11_get_default_xdisplay:PDisplay;cdecl;external; +function gdk_x11_get_default_screen:gint;cdecl;external; +{$ENDIF} procedure LOpenGLViewport(Left, Top, Width, Height: integer); procedure LOpenGLSwapBuffers(Handle: HWND); @@ -775,9 +779,14 @@ begin ColorMap:=gdk_colormap_get_system; Visual:=gdk_colormap_get_visual(ColorMap); - if GDK_VISUAL_XVISUAL(Visual)^.visualid<>XVInfo^.visualid then begin + if XVisualIDFromVisual( + GDK_VISUAL_XVISUAL({$IFDEF LCLGTK}PGdkVisualPrivate(visual) + {$ELSE}visual + {$ENDIF})) + <>XVInfo^.visualid + then begin Visual:=gdkx_visual_get(XVInfo^.visualid); - ColorMap:=gdk_colormap_new(Visual, gFALSE); + ColorMap:=gdk_colormap_new(Visual, {$IFDEF LCLGTK2}gFALSE{$ELSE}0{$ENDIF}); end; GLArea:=gtk_type_new(gtk_gl_area_get_type);