Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

- Code Cleanups

- changed DrawBuffer reset to Back as almost no application will use single buffering in practise.
  For doublebuffers GL defaults the drawbuffer to Back
  • Loading branch information...
commit 25a5ac5a90ba988221bc0efed3e226a13c84a2b0 1 parent ce6f595
@WolfgangSt WolfgangSt authored
Showing with 5 additions and 5 deletions.
  1. +5 −5 IIS.SLSharp.Bindings.OpenTK/Textures/RenderToTexture.cs
View
10 IIS.SLSharp.Bindings.OpenTK/Textures/RenderToTexture.cs
@@ -18,7 +18,7 @@ public sealed class RenderToTexture : IDisposable
private readonly RenderbufferObject _rbo;
- private readonly Bindings.OpenTK.Textures.Texture2D[] _textures;
+ private readonly Texture2D[] _textures;
private readonly DrawBuffersEnum[] _bufs;
@@ -27,7 +27,7 @@ public sealed class RenderToTexture : IDisposable
/// </summary>
/// <param name="index">The output channel index to retrieve</param>
/// <returns></returns>
- public Bindings.OpenTK.Textures.Texture2D this[int index]
+ public Texture2D this[int index]
{
get { return _textures[index]; }
}
@@ -44,7 +44,7 @@ public sealed class RenderToTexture : IDisposable
public RenderToTexture(int width, int height, bool depth, int components = 3, Type format = null, int buffers = 1)
{
_fbo = new FramebufferObject();
- _textures = new Bindings.OpenTK.Textures.Texture2D[buffers];
+ _textures = new Texture2D[buffers];
_bufs = new DrawBuffersEnum[buffers];
for (var i = 0; i < buffers; i++)
@@ -55,12 +55,12 @@ public RenderToTexture(int width, int height, bool depth, int components = 3, Ty
Utilities.CheckGL();
_fbo.Finish();
- GL.DrawBuffer(DrawBufferMode.Front);
+ GL.DrawBuffer(DrawBufferMode.Back);
Utilities.CheckGL();
for (var i = 0; i < buffers; i++)
{
- _textures[i] = new Bindings.OpenTK.Textures.Texture2D(width, height, components, format ?? typeof(Half));
+ _textures[i] = new Texture2D(width, height, components, format ?? typeof(Half));
_fbo.SetTexture(_textures[i], i);
}
Please sign in to comment.
Something went wrong with that request. Please try again.