provide support for automatically setting up OpenTK's gl context when creating an instance of SDLGL20

This commit is contained in:
Gered 2013-08-17 18:31:49 -04:00
parent 052d4b1db4
commit b777445c2b

View file

@ -1,10 +1,20 @@
using System;
using OpenTK.Graphics;
using OpenTK.Graphics.OpenGL;
namespace PortableGL.SDL
{
public class SDLGL20 : GL20
{
public SDLGL20(IntPtr glContext)
{
if (glContext == IntPtr.Zero)
throw new ArgumentNullException("glContext");
GraphicsContext.CurrentContext = glContext;
GL.LoadAll();
}
public override void glActiveTexture(int texture)
{
GL.ActiveTexture((TextureUnit)texture);