Remove last OpenGL call outside of OpenGLApi class.

This commit is contained in:
UnknownShadow200 2015-01-06 10:54:52 +11:00
parent 04ba5b9a0f
commit b1690d75ab
3 changed files with 6 additions and 2 deletions

View File

@ -10,7 +10,6 @@ using ClassicalSharp.Particles;
using ClassicalSharp.Renderers; using ClassicalSharp.Renderers;
using ClassicalSharp.Selections; using ClassicalSharp.Selections;
using OpenTK; using OpenTK;
using OpenTK.Graphics.OpenGL;
using OpenTK.Input; using OpenTK.Input;
namespace ClassicalSharp { namespace ClassicalSharp {
@ -328,7 +327,7 @@ namespace ClassicalSharp {
protected override void OnResize( EventArgs e ) { protected override void OnResize( EventArgs e ) {
base.OnResize( e ); base.OnResize( e );
GL.Viewport( ClientRectangle ); Graphics.OnWindowResize( Width, Height );
UpdateProjection(); UpdateProjection();
if( activeScreen != null ) { if( activeScreen != null ) {
activeScreen.OnResize( width, height, Width, Height ); activeScreen.OnResize( width, height, Width, Height );

View File

@ -196,6 +196,8 @@ namespace ClassicalSharp.GraphicsAPI {
public virtual void PrintApiSpecificInfo() { public virtual void PrintApiSpecificInfo() {
} }
public abstract void OnWindowResize( int newWidth, int newHeight );
public virtual void Draw2DQuad( float x, float y, float width, float height, FastColour col ) { public virtual void Draw2DQuad( float x, float y, float width, float height, FastColour col ) {
VertexPos3fCol4b[] vertices = { VertexPos3fCol4b[] vertices = {
new VertexPos3fCol4b( x + width, y, 0, col ), new VertexPos3fCol4b( x + width, y, 0, col ),

View File

@ -618,6 +618,9 @@ namespace ClassicalSharp.GraphicsAPI {
} }
} }
public override void OnWindowResize( int newWidth, int newHeight ) {
GL.Viewport( 0, 0, newWidth, newHeight );
}
public Color4 GetCol() { public Color4 GetCol() {
float[] col = new float[4]; float[] col = new float[4];