Skip to content

Commit

Permalink
Replace glNamedFramebufferDrawBuffer with glDrawBuffer in Framebuffer…
Browse files Browse the repository at this point in the history
….cs (#206)
  • Loading branch information
notgiven688 authored Nov 30, 2024
1 parent d358ce6 commit c105bc3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/JitterDemo/Renderer/OpenGL/Native/GL.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ private delegate void glFramebufferTexture2DDelegate(uint target, uint attachmen

private static glFramebufferTexture2DDelegate glFramebufferTexture2D;

private delegate void glNamedFramebufferDrawBufferDelegate(uint framebuffer, uint buf);
private delegate void glDrawBufferDelegate(uint buf);

private static glNamedFramebufferDrawBufferDelegate glNamedFramebufferDrawBuffer;
private static glDrawBufferDelegate glDrawBuffer;

private delegate void glBindBufferDelegate(uint target, uint buffer);

Expand Down Expand Up @@ -338,7 +338,7 @@ public static void Load()
glDebugMessageCallback = GetDelegate<glDebugMessageCallbackDelegate>();
glGenerateMipmap = GetDelegate<glGenerateMipmapDelegate>();
glBindBuffer = GetDelegate<glBindBufferDelegate>();
glNamedFramebufferDrawBuffer = GetDelegate<glNamedFramebufferDrawBufferDelegate>();
glDrawBuffer = GetDelegate<glDrawBufferDelegate>();
glFramebufferTexture2D = GetDelegate<glFramebufferTexture2DDelegate>();
glBindFramebuffer = GetDelegate<glBindFramebufferDelegate>();
glGenBuffers = GetDelegate<glGenBuffersDelegate>();
Expand Down Expand Up @@ -547,9 +547,9 @@ public static void BindBuffer(uint target, uint buffer)
glBindBuffer(target, buffer);
}

public static void NamedFramebufferDrawBuffer(uint framebuffer, uint buf)
public static void DrawBuffer(uint buf)
{
glNamedFramebufferDrawBuffer(framebuffer, buf);
glDrawBuffer(buf);
}

public static void FramebufferTexture2D(uint target, uint attachment, uint textarget, uint texture, int level)
Expand Down
2 changes: 1 addition & 1 deletion src/JitterDemo/Renderer/OpenGL/Objects/Framebuffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ public void AttachDepthTexture(Texture2D texture)
{
Bind();
GL.FramebufferTexture2D(GLC.FRAMEBUFFER, GLC.DEPTH_ATTACHMENT, GLC.TEXTURE_2D, texture.Handle, 0);
GL.NamedFramebufferDrawBuffer(Handle, GLC.NONE);
GL.DrawBuffer(GLC.NONE);
}
}

0 comments on commit c105bc3

Please sign in to comment.