-
Notifications
You must be signed in to change notification settings - Fork 1
/
RenderBuffer.cs
34 lines (30 loc) · 1.08 KB
/
RenderBuffer.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using OpenTK.Graphics.OpenGL4;
using System;
using System.Collections.Generic;
using System.Text;
namespace GLGraphics
{
public class RenderBuffer : GraphicsResource
{
public RenderBuffer() : base(GLObjectType.RenderBuffer)
{
}
public int Width { get; private set; }
public int Height { get; private set; }
public RenderbufferStorage RenderbufferStorage { get; private set; }
public void Init(int width, int height, RenderbufferStorage renderbufferStorage)
{
Width = width;
Height = height;
RenderbufferStorage = renderbufferStorage;
GL.NamedRenderbufferStorage(Handle, renderbufferStorage, width, height);
}
public void InitMultiSample(int width, int height, RenderbufferStorage renderbufferStorage, int samples = 1)
{
Width = width;
Height = height;
RenderbufferStorage = renderbufferStorage;
GL.NamedRenderbufferStorageMultisample(Handle, samples, renderbufferStorage, width, height);
}
}
}