Ver a proveniência

* some linux fixes

master
Bergmann89 há 9 anos
ascendente
cometimento
f6e073e222
2 ficheiros alterados com 996 adições e 991 eliminações
  1. +21
    -16
      uglcContextGtk2GLX.pas
  2. +975
    -975
      uglcShader.pas

+ 21
- 16
uglcContextGtk2GLX.pas Ver ficheiro

@@ -60,10 +60,7 @@ type
{$region messages -fold}
procedure TRenderControl.WndProc(var Message: TLMessage);
var
handled: Boolean;
begin
handled := false;
case Message.msg of
//LM_ACTIVATEITEM,
//LM_CHANGED,
@@ -269,10 +266,8 @@ begin
CN_SYSCHAR,
CN_NOTIFY:
begin
if Assigned(fTarget) then begin
if Assigned(fTarget) then
Message.Result := fTarget.Perform(Message.msg, Message.wParam, Message.lParam);
handled := true;
end;
end;
end;
inherited WndProc(Message);
@@ -422,6 +417,7 @@ procedure TglcContextGtk2GLX.OpenContext;
var
Attribs: array of GLint;
tmpContext: GLXContext;
glxID: GLXDrawable;
begin
inherited OpenContext;
@@ -453,7 +449,8 @@ begin
SetLength(Attribs, 1);
Attribs[High(Attribs)] := 0;
glXMakeCurrent(FDisplay, GDK_DRAWABLE_XID(GTK_WIDGET(FWidget)^.window), tmpContext);
glxID := GDK_DRAWABLE_XID(GTK_WIDGET(FWidget)^.window);
glXMakeCurrent(FDisplay, glxID, tmpContext);
ReadImplementationProperties;
if not Assigned(glXCreateContextAttribsARB) or not GLX_ARB_create_context then begin
glXDestroyContext(FDisplay, tmpContext);
@@ -500,6 +497,8 @@ begin
end;
procedure TglcContextGtk2GLX.Activate;
var
glxID: GLXDrawable;
begin
if not Assigned(FWidget) then exit;
// make sure the widget is realized
@@ -507,30 +506,36 @@ begin
if not GTK_WIDGET_REALIZED(FWidget) then exit;
// make current
glXMakeCurrent(FDisplay, GDK_DRAWABLE_XID(GTK_WIDGET(FWidget)^.window), FContext);
glxID := GDK_DRAWABLE_XID(GTK_WIDGET(FWidget)^.window);
glXMakeCurrent(FDisplay, glxID, FContext);
end;
procedure TglcContextGtk2GLX.Deactivate;
var
glxID: GLXDrawable;
begin
if not Assigned(FWidget) then exit;
glXMakeCurrent(FDisplay, GDK_DRAWABLE_XID(GTK_WIDGET(FWidget)^.window), nil);
glxID := GDK_DRAWABLE_XID(GTK_WIDGET(FWidget)^.window);
glXMakeCurrent(FDisplay, glxID, nil);
end;
function TglcContextGtk2GLX.IsActive: boolean;
var
glxID: GLXDrawable;
begin
glxID := GDK_DRAWABLE_XID(GTK_WIDGET(FWidget)^.window);
Result:= (FContext = glXGetCurrentContext()) and
Assigned(FWidget) and
(GDK_DRAWABLE_XID(GTK_WIDGET(FWidget)^.window) = glXGetCurrentDrawable());
(glxID = glXGetCurrentDrawable());
end;
procedure TglcContextGtk2GLX.SwapBuffers;
var
drawable: PGdkDrawable;
glxID: GLXDrawable;
begin
if not Assigned(FWidget) then exit;
drawable:= GTK_WIDGET(FWidget)^.window;
glXSwapBuffers(FDisplay, GDK_DRAWABLE_XID(drawable));
glxID := GDK_DRAWABLE_XID(GTK_WIDGET(FWidget)^.window);
glXSwapBuffers(FDisplay, glxID);
end;
procedure TglcContextGtk2GLX.SetSwapInterval(const aInterval: GLint);
@@ -547,7 +552,7 @@ begin
raise Exception.Create('not yet implemented');
end;
class function TglcContextGtk2GLX.ChangeDisplaySettings(const aWidth, aHeight,
class function TglcContextGtk2GLX.{%H-}ChangeDisplaySettings(const aWidth, aHeight,
aBitPerPixel, aFreq: Integer; const aFlags: TglcDisplayFlags): Boolean;
begin
raise Exception.Create('not yet implemented');
@@ -559,4 +564,4 @@ begin
end;
end.

+ 975
- 975
uglcShader.pas
A apresentação das diferenças no ficheiro foi suprimida por ser demasiado grande
Ver ficheiro


Carregando…
Cancelar
Guardar