|
|
@ -27,7 +27,7 @@ namespace Avalonia.OpenGL.Controls |
|
|
_context.GlInterface.BindFramebuffer(GL_FRAMEBUFFER, _fb); |
|
|
_context.GlInterface.BindFramebuffer(GL_FRAMEBUFFER, _fb); |
|
|
EnsureTextureAttachment(); |
|
|
EnsureTextureAttachment(); |
|
|
EnsureDepthBufferAttachment(_context.GlInterface); |
|
|
EnsureDepthBufferAttachment(_context.GlInterface); |
|
|
if(!CheckFramebufferStatus(_context.GlInterface)) |
|
|
if(!OpenGlControlBase.CheckFramebufferStatus(_context.GlInterface)) |
|
|
return; |
|
|
return; |
|
|
|
|
|
|
|
|
OnOpenGlRender(_context.GlInterface, _fb); |
|
|
OnOpenGlRender(_context.GlInterface, _fb); |
|
|
@ -38,7 +38,7 @@ namespace Avalonia.OpenGL.Controls |
|
|
base.Render(context); |
|
|
base.Render(context); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void CheckError(GlInterface gl) |
|
|
private static void CheckError(GlInterface gl) |
|
|
{ |
|
|
{ |
|
|
int err; |
|
|
int err; |
|
|
while ((err = gl.GetError()) != GL_NO_ERROR) |
|
|
while ((err = gl.GetError()) != GL_NO_ERROR) |
|
|
@ -186,7 +186,7 @@ namespace Avalonia.OpenGL.Controls |
|
|
EnsureDepthBufferAttachment(gl); |
|
|
EnsureDepthBufferAttachment(gl); |
|
|
EnsureTextureAttachment(); |
|
|
EnsureTextureAttachment(); |
|
|
|
|
|
|
|
|
return CheckFramebufferStatus(gl); |
|
|
return OpenGlControlBase.CheckFramebufferStatus(gl); |
|
|
} |
|
|
} |
|
|
catch(Exception e) |
|
|
catch(Exception e) |
|
|
{ |
|
|
{ |
|
|
@ -197,7 +197,7 @@ namespace Avalonia.OpenGL.Controls |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private bool CheckFramebufferStatus(GlInterface gl) |
|
|
private static bool CheckFramebufferStatus(GlInterface gl) |
|
|
{ |
|
|
{ |
|
|
var status = gl.CheckFramebufferStatus(GL_FRAMEBUFFER); |
|
|
var status = gl.CheckFramebufferStatus(GL_FRAMEBUFFER); |
|
|
if (status != GL_FRAMEBUFFER_COMPLETE) |
|
|
if (status != GL_FRAMEBUFFER_COMPLETE) |
|
|
|