private void CreateBuffer()
 {
     BufferHandle = device.GenBuffer();
     device.BindBuffer(GlBufferType, BufferHandle);
     if (IsStructuredBuffer && internalFormat == BufferInternalFormat.None)
     {
         throw new Exception("You need to specify internal format for TextureBuffer");
     }
     if (IsUsingBufferTexture)
     {
         TextureBufferHandle = device.GenTexture();
         device.BindTexture(TextureTarget.TextureBuffer, TextureBufferHandle);
         device.TexBuffer(TextureBufferTarget.TextureBuffer, internalFormat == BufferInternalFormat.Float4 ? SizedInternalFormat.Rgba32f : (internalFormat == BufferInternalFormat.Byte4 ? SizedInternalFormat.Rgba8i : SizedInternalFormat.Rgba32i), BufferHandle);
     }
 }
 protected void BindTexture()
 {
     device.BindTexture(textureTarget, Handle);
 }