Explorar el Código

* [glcContext] check return value from wglShareLists

* [glcFrameBufferObject] fixed bug with glDrawBuffer/glReadBuffer
master
Bergmann89 hace 11 años
padre
commit
861226e1af
Se han modificado 2 ficheros con 6 adiciones y 8 borrados
  1. +2
    -1
      uglcContextWGL.pas
  2. +4
    -7
      uglcFrameBufferObject.pas

+ 2
- 1
uglcContextWGL.pas Ver fichero

@@ -399,7 +399,8 @@ end;

procedure TglcContextWGL.Share(const aContext: TglcContext);
begin
wglShareLists(FRC, (aContext as TglcContextWGL).FRC);
if not wglShareLists(FRC, (aContext as TglcContextWGL).FRC) then
raise EGLError.Create('wglShareLists failed: ' + IntToStr(GetLastError()));
end;

class function TglcContextWGL.ChangeDisplaySettings(const aWidth, aHeight,


+ 4
- 7
uglcFrameBufferObject.pas Ver fichero

@@ -322,7 +322,6 @@ constructor TglcTextureBuffer.Create(const aFormat: TglcFormat; const aInternalF
begin
inherited Create;
fBufferType := btTextureBuffer;

glGenTextures(1, @fID);
Bind(false);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, {$IFNDEF OPENGL_ES}GL_CLAMP{$ELSE}GL_CLAMP_TO_EDGE{$ENDIF});
@@ -330,7 +329,6 @@ begin
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
Unbind(false);

fFormat := aFormat;
fInternalFormat := aInternalFormat;
SetSize(64, 64);
@@ -495,11 +493,11 @@ procedure TglcFrameBufferObject.UpdateAndCheckFBO;

var
buff: array of GLenum;
{$IFNDEF OPENGL_ES}
b: GLboolean;
{$ENDIF}
i: Integer;
{$IFNDEF OPENGL_ES}DoubleBuffered: GLboolean;{$ENDIF}
begin
{$IFNDEF OPENGL_ES}glGetBooleanv(GL_DOUBLEBUFFER, @DoubleBuffered);{$ENDIF}

if (fBuffers.Count = 0) then
exit;
Bind(false);
@@ -525,8 +523,7 @@ begin
end else begin
glDrawBuffers(Length(buff), @buff[0]);
{$IFNDEF OPENGL_ES}
glGetBooleanv(GL_DOUBLEBUFFER, @b);
if b then
if DoubleBuffered then
glReadBuffer(GL_BACK)
else
glReadBuffer(GL_FRONT);


Cargando…
Cancelar
Guardar