provide support for automatically setting up OpenTK's gl context when creating an instance of SDLGL20
This commit is contained in:
parent
052d4b1db4
commit
b777445c2b
|
@ -1,10 +1,20 @@
|
||||||
using System;
|
using System;
|
||||||
|
using OpenTK.Graphics;
|
||||||
using OpenTK.Graphics.OpenGL;
|
using OpenTK.Graphics.OpenGL;
|
||||||
|
|
||||||
namespace PortableGL.SDL
|
namespace PortableGL.SDL
|
||||||
{
|
{
|
||||||
public class SDLGL20 : GL20
|
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)
|
public override void glActiveTexture(int texture)
|
||||||
{
|
{
|
||||||
GL.ActiveTexture((TextureUnit)texture);
|
GL.ActiveTexture((TextureUnit)texture);
|
||||||
|
|
Reference in a new issue