Skip to content

Commit

Permalink
refactor PlatformSetup() (#2193)
Browse files Browse the repository at this point in the history
  • Loading branch information
nkast authored Jan 17, 2025
1 parent 7fd9852 commit e874ccc
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions Platforms/Graphics/.GL/ConcreteGraphicsContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,19 +89,17 @@ public override void PlatformSetup()
{
this._newEnabledVertexAttributes = new bool[base.Capabilities.MaxVertexBufferSlots];

if (((ConcreteGraphicsCapabilities)base.Capabilities).SupportsFramebufferObjectARB
|| ((ConcreteGraphicsCapabilities)base.Capabilities).SupportsFramebufferObjectEXT)
{
this._supportsBlitFramebuffer = GL.BlitFramebuffer != null;
this._supportsInvalidateFramebuffer = GL.InvalidateFramebuffer != null;
}
else
if (!((ConcreteGraphicsCapabilities)base.Capabilities).SupportsFramebufferObjectARB
&& !((ConcreteGraphicsCapabilities)base.Capabilities).SupportsFramebufferObjectEXT)
{
throw new PlatformNotSupportedException(
"GraphicsDevice requires either ARB_framebuffer_object or EXT_framebuffer_object." +
"Try updating your graphics drivers.");
}

this._supportsBlitFramebuffer = GL.BlitFramebuffer != null;
this._supportsInvalidateFramebuffer = GL.InvalidateFramebuffer != null;

this._bufferBindingInfos = new BufferBindingInfo[base.Capabilities.MaxVertexBufferSlots];
for (int i = 0; i < this._bufferBindingInfos.Length; i++)
this._bufferBindingInfos[i] = new BufferBindingInfo(null, null, IntPtr.Zero, 0);
Expand Down

0 comments on commit e874ccc

Please sign in to comment.