Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internalise FrameBuffer and expose via IFrameBuffer #5326

Merged
merged 10 commits into from
Aug 1, 2022

Conversation

smoogipoo
Copy link
Contributor

@smoogipoo smoogipoo commented Jul 29, 2022

Prereqs:

vNext

FrameBuffer is no longer exposed

Frame buffers may be created via the IRenderer and stored as an IFrameBuffer. Be aware that the parameter types have also changed!

class MyDrawNode : DrawNode
{
-   private readonly FrameBuffer myFrameBuffer = new FrameBuffer(new[] { RenderbufferInternalFormat.DepthComponent16 }, All.Nearest);
+   private IFrameBuffer myFrameBuffer;

    public override void Draw(IRenderer renderer)
    {
        base.Draw(renderer);

+       myFrameBuffer ??= renderer.CreateFrameBuffer(new[] { RenderBufferFormat.D16 }, TextureFilteringMode.Nearest);
    }

    protected override void Dispose(bool disposing)
    {
        base.Dispose(disposing);
        myFrameBuffer?.Dispose();
    }
}

Only a 16-bit depth format is supported for the time being, but more formats can be provided upon request.

@peppy peppy requested a review from frenzibyte July 30, 2022 03:24
@smoogipoo smoogipoo removed the blocked label Jul 31, 2022
frenzibyte
frenzibyte previously approved these changes Aug 1, 2022
@peppy
Copy link
Member

peppy commented Aug 1, 2022

Applied a bit of conflict resolution, but I don't think I broke anything. Changes look sane.

@peppy peppy enabled auto-merge August 1, 2022 14:23
@smoogipoo smoogipoo deleted the irenderer-fbo branch September 11, 2023 02:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants