Skip to content

Commit

Permalink
fix crashing on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
LeNitrous committed Jul 30, 2023
1 parent fc98797 commit 146d5e6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions source/Sekai.OpenGL/GLGraphicsDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public GLGraphicsDevice(GLContext source)
{
GL = GL.GetApi((this.source = source).GetProcAddress);

MakeCurrent();
source.MakeCurrent();

GL.GetInteger(GetPName.MajorVersion, out int major);
GL.GetInteger(GetPName.MinorVersion, out int minor);
Expand All @@ -53,6 +53,8 @@ public GLGraphicsDevice(GLContext source)

GL.GenVertexArrays(1, out vao);
GL.BindVertexArray(vao);

source.Clear();
}

public override void MakeCurrent()
Expand Down Expand Up @@ -149,8 +151,6 @@ public override void Dispose()
return;
}

MakeCurrent();

GL.BindVertexArray(0);
GL.DeleteVertexArray(vao);
source.Clear();
Expand Down

0 comments on commit 146d5e6

Please sign in to comment.