Implement resize event in GameWindow.

This commit is contained in:
kanato 2009-02-11 07:59:24 +00:00
parent b921bf95dd
commit b99e8c5829

View file

@ -175,14 +175,23 @@ namespace OpenTK
if ((options & GameWindowFlags.Fullscreen) != 0)
{
device.ChangeResolution(width, height, mode.ColorFormat.BitsPerPixel, 0);
//this.Fullscreen = true;
throw new NotImplementedException();
this.WindowState = WindowState.Fullscreen;
//throw new NotImplementedException();
}
this.VSync = VSyncMode.On; //VSyncMode.Adaptive;
glWindow.Resize += new ResizeEvent(glWindow_Resize);
}
void glWindow_Resize(object sender, ResizeEventArgs e)
{
Debug.Print("glWindow_Resize event fired.");
OnResizeInternal(e);
}
#endregion
/// <summary>
@ -1269,11 +1278,7 @@ namespace OpenTK
/// <summary>
/// Occurs when the GameWindow is resized. Derived classes should override the OnResize method for better performance.
/// </summary>
public event ResizeEvent Resize
{
add { if (disposed) throw new ObjectDisposedException("GameWindow"); glWindow.Resize += value; }
remove { if (disposed) throw new ObjectDisposedException("GameWindow"); glWindow.Resize -= value; }
}
public event ResizeEvent Resize;
/// <summary>
/// Raises the Resize event.
@ -1286,8 +1291,8 @@ namespace OpenTK
this.width = e.Width;
this.height = e.Height;
//if (this.Resize != null)
// this.Resize(this, e);
if (this.Resize != null)
this.Resize(this, e);
OnResize(e);
}