mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-02 08:20:39 +01:00
extended openglcontext example for idle
git-svn-id: trunk@8461 -
This commit is contained in:
parent
4b11686705
commit
84914a1149
@ -23,6 +23,7 @@ interface
|
||||
|
||||
uses
|
||||
Classes, SysUtils, LCLProc, LCLType, X, XUtil, XLib, gl, InterfaceBase,
|
||||
WSLCLClasses,
|
||||
{$IFDEF LCLGTK2}
|
||||
gdk2x, glib2, gdk2, gtk2, Gtk2Int,
|
||||
{$ENDIF}
|
||||
@ -128,6 +129,7 @@ procedure LOpenGLViewport(Left, Top, Width, Height: integer);
|
||||
procedure LOpenGLSwapBuffers(Handle: HWND);
|
||||
function LOpenGLMakeCurrent(Handle: HWND): boolean;
|
||||
function LOpenGLCreateContext(AWinControl: TWinControl;
|
||||
WSPrivate: TWSPrivateClass;
|
||||
SharedControl: TWinControl; AttrList: PInteger): HWND;
|
||||
|
||||
const
|
||||
@ -706,11 +708,13 @@ const
|
||||
);
|
||||
|
||||
function LOpenGLCreateContext(AWinControl: TWinControl;
|
||||
SharedControl: TWinControl; AttrList: PInteger): HWND;
|
||||
WSPrivate: TWSPrivateClass; SharedControl: TWinControl;
|
||||
AttrList: PInteger): HWND;
|
||||
var
|
||||
NewWidget: PGtkWidget;
|
||||
SharedArea: PGtkGLArea;
|
||||
begin
|
||||
if WSPrivate=nil then ;
|
||||
if AttrList=nil then
|
||||
AttrList:=@InitAttrList;
|
||||
if SharedControl<>nil then begin
|
||||
|
||||
@ -384,7 +384,7 @@ begin
|
||||
AttrList:=OpenGlControl.SharedControl.OpenGLInitAttrList
|
||||
else
|
||||
AttrList:=OpenGlControl.OpenGLInitAttrList;
|
||||
Result:=LOpenGLCreateContext(OpenGlControl,OpenGlControl.SharedControl,
|
||||
Result:=LOpenGLCreateContext(OpenGlControl,WSPrivate,OpenGlControl.SharedControl,
|
||||
AttrList);
|
||||
end;
|
||||
end;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user