extended openglcontext example for idle

git-svn-id: trunk@8461 -
This commit is contained in:
mattias 2006-01-07 14:14:41 +00:00
parent 4b11686705
commit 84914a1149
2 changed files with 6 additions and 2 deletions

View File

@ -23,6 +23,7 @@ interface
uses uses
Classes, SysUtils, LCLProc, LCLType, X, XUtil, XLib, gl, InterfaceBase, Classes, SysUtils, LCLProc, LCLType, X, XUtil, XLib, gl, InterfaceBase,
WSLCLClasses,
{$IFDEF LCLGTK2} {$IFDEF LCLGTK2}
gdk2x, glib2, gdk2, gtk2, Gtk2Int, gdk2x, glib2, gdk2, gtk2, Gtk2Int,
{$ENDIF} {$ENDIF}
@ -128,6 +129,7 @@ procedure LOpenGLViewport(Left, Top, Width, Height: integer);
procedure LOpenGLSwapBuffers(Handle: HWND); procedure LOpenGLSwapBuffers(Handle: HWND);
function LOpenGLMakeCurrent(Handle: HWND): boolean; function LOpenGLMakeCurrent(Handle: HWND): boolean;
function LOpenGLCreateContext(AWinControl: TWinControl; function LOpenGLCreateContext(AWinControl: TWinControl;
WSPrivate: TWSPrivateClass;
SharedControl: TWinControl; AttrList: PInteger): HWND; SharedControl: TWinControl; AttrList: PInteger): HWND;
const const
@ -706,11 +708,13 @@ const
); );
function LOpenGLCreateContext(AWinControl: TWinControl; function LOpenGLCreateContext(AWinControl: TWinControl;
SharedControl: TWinControl; AttrList: PInteger): HWND; WSPrivate: TWSPrivateClass; SharedControl: TWinControl;
AttrList: PInteger): HWND;
var var
NewWidget: PGtkWidget; NewWidget: PGtkWidget;
SharedArea: PGtkGLArea; SharedArea: PGtkGLArea;
begin begin
if WSPrivate=nil then ;
if AttrList=nil then if AttrList=nil then
AttrList:=@InitAttrList; AttrList:=@InitAttrList;
if SharedControl<>nil then begin if SharedControl<>nil then begin

View File

@ -384,7 +384,7 @@ begin
AttrList:=OpenGlControl.SharedControl.OpenGLInitAttrList AttrList:=OpenGlControl.SharedControl.OpenGLInitAttrList
else else
AttrList:=OpenGlControl.OpenGLInitAttrList; AttrList:=OpenGlControl.OpenGLInitAttrList;
Result:=LOpenGLCreateContext(OpenGlControl,OpenGlControl.SharedControl, Result:=LOpenGLCreateContext(OpenGlControl,WSPrivate,OpenGlControl.SharedControl,
AttrList); AttrList);
end; end;
end; end;