2006-11-05 11:50:08 +00:00
#region - - - License - - -
/ * This source file is released under the MIT license . See License . txt for more information .
* Coded by Stephen Apostolopoulos and Erik Ylvisaker .
2006-10-09 22:35:25 +00:00
* /
#endregion
using System ;
using System.Collections.Generic ;
using System.Text ;
using System.Windows.Forms ;
using System.Drawing ;
using System.Threading ;
using OpenTK.Platform.Windows ;
using System.Runtime.InteropServices ;
2006-11-05 11:50:08 +00:00
2006-10-11 21:42:22 +00:00
using OpenTK.OpenGL.Platform ;
2006-10-11 22:10:29 +00:00
using OpenTK.OpenGL ;
2006-10-09 22:35:25 +00:00
2006-11-05 11:50:08 +00:00
namespace OpenTK
2006-10-09 22:35:25 +00:00
{
2006-11-02 21:40:36 +00:00
public class Framework : IDisposable
{
2006-11-05 11:50:08 +00:00
#region - - - Private variables - - -
2006-11-02 21:40:36 +00:00
private Form activeForm ;
private GLContext activeContext ;
private PlatformSpecific platform ;
2006-11-05 11:50:08 +00:00
private OpenGL . ColorDepth colorDepth ;
private int zDepth ;
private int stencilDepth ;
2006-11-02 21:40:36 +00:00
2006-11-05 11:50:08 +00:00
private string text = "OpenTK application" ;
#endregion
Application . MessageLoopCallback MessageLoop ;
2006-11-02 21:40:36 +00:00
#region - - - Public Properties - - -
public Form ActiveForm
{
get { return activeForm ; }
}
2006-11-05 11:50:08 +00:00
2006-11-02 21:40:36 +00:00
public GLContext ActiveContext
{
get { return activeContext ; }
private set { activeContext = value ; }
}
2006-11-05 11:50:08 +00:00
2006-11-02 21:40:36 +00:00
public string Text
{
get { return text ; }
set
{
text = value ;
if ( activeForm ! = null )
activeForm . Text = value ;
}
}
2006-11-05 11:50:08 +00:00
2006-11-02 21:40:36 +00:00
public Size ClientSize
{
get { return ActiveForm . ClientSize ; }
set { activeForm . ClientSize = value ; }
}
2006-11-05 11:50:08 +00:00
2006-11-02 21:40:36 +00:00
public int Width
{
get { return ClientSize . Width ; }
set { ClientSize = new Size ( value , ClientSize . Height ) ; }
}
2006-11-05 11:50:08 +00:00
2006-11-02 21:40:36 +00:00
public int Height
{
get { return ClientSize . Height ; }
set { ClientSize = new Size ( ClientSize . Width , value ) ; }
}
2006-11-05 11:50:08 +00:00
2006-11-02 21:40:36 +00:00
public bool IsFullscreen
{
get
{
return ActiveContext . IsFullscreen ;
}
}
public OpenGL . ColorDepth ColorDepth
{
2006-11-05 11:50:08 +00:00
get { return colorDepth ; }
private set { colorDepth = value ; }
2006-11-02 21:40:36 +00:00
}
2006-11-05 11:50:08 +00:00
2006-11-02 21:40:36 +00:00
public int ZDepth
{
2006-11-05 11:50:08 +00:00
get { return zDepth ; }
set { zDepth = value ; }
2006-11-02 21:40:36 +00:00
}
2006-11-05 11:50:08 +00:00
2006-11-02 21:40:36 +00:00
public int StencilDepth
{
2006-11-05 11:50:08 +00:00
get { return stencilDepth ; }
set { stencilDepth = value ; }
2006-11-02 21:40:36 +00:00
}
#endregion
#region - - - Creation and Destruction - - -
/// <summary>
2006-11-05 11:50:08 +00:00
/// Constructs a Framework object with default (safe) parameters.
2006-11-02 21:40:36 +00:00
/// </summary>
public Framework ( )
2006-11-05 11:50:08 +00:00
: this ( null , 640 , 480 , new OpenTK . OpenGL . ColorDepth ( 8 , 8 , 8 , 8 ) , 16 , 0 , false )
2006-11-02 21:40:36 +00:00
{ }
2006-11-05 11:50:08 +00:00
/// <summary>
/// Construcs a Framework object with the given parameters.
/// </summary>
/// <param name="title">The Title of the Form.</param>
/// <param name="width">The Width of the Form.</param>
/// <param name="height">The Height of the Form.</param>
/// <param name="color">The ColorDepth of the OpenGL Context.</param>
/// <param name="depth">The ZDepth of the OpenGL Context.</param>
/// <param name="stencil">The StencilDepth of the OpenGL Context.</param>
/// <param name="fullscreen">The Fullscreen property of the Form.</param>
2006-11-02 21:40:36 +00:00
public Framework ( string title , int width , int height , OpenTK . OpenGL . ColorDepth color ,
int depth , int stencil , bool fullscreen )
{
platform = PlatformSpecific . CreatePlatformMethods ( ) ;
Setup ( title , width , height , color , depth , stencil , fullscreen ) ;
}
~ Framework ( )
{
Dispose ( false ) ;
}
public void Dispose ( )
{
Dispose ( true ) ;
GC . SuppressFinalize ( this ) ;
}
protected void Dispose ( bool disposing )
{
if ( disposing )
{
}
if ( activeContext ! = null )
{
activeContext . Dispose ( ) ;
activeContext = null ;
}
2006-11-05 11:50:08 +00:00
2006-11-02 21:40:36 +00:00
if ( activeForm ! = null )
{
activeForm . Dispose ( ) ;
activeForm = null ;
}
}
#endregion
#region - - - Creation and setup of windows - - -
private void Setup ( string title , int width , int height , OpenTK . OpenGL . ColorDepth color ,
int depth , int stencil , bool fullscreen )
{
System . Console . WriteLine ( "Created Framework." ) ;
// Initialise components.
ColorDepth = color ;
ZDepth = depth ;
StencilDepth = stencil ;
if ( string . IsNullOrEmpty ( title ) = = false )
Text = title ;
if ( fullscreen )
CreateFullScreenDisplay ( width , height ) ;
else
CreateWindowedDisplay ( width , height ) ;
2006-11-05 11:50:08 +00:00
//Application.Idle += this.OnIdle;
//MessageLoop = new Application.MessageLoopCallback(MainLoop);
//Application.RegisterMessageLoop(MessageLoop);
2006-11-02 21:40:36 +00:00
System . Console . WriteLine ( "Done Initializing." ) ;
}
private void CreateWindowedDisplay ( int width , int height )
{
DisposeForm ( ) ;
activeForm = new WindowedForm ( ) ;
activeForm . Text = Text ;
activeContext = GLContext . Create ( activeForm ,
this . ColorDepth , this . ZDepth , this . StencilDepth ) ;
AttachEvents ( activeForm ) ;
activeForm . ClientSize = new Size ( width , height ) ;
2006-11-05 11:50:08 +00:00
activeForm . TopMost = true ;
activeForm . Enabled = true ;
activeForm . Show ( ) ;
2006-11-02 21:40:36 +00:00
}
private void CreateFullScreenDisplay ( int width , int height )
{
DisposeForm ( ) ;
activeForm = new FullScreenForm ( ) ;
activeForm . Text = Text ;
activeContext = GLContext . Create ( activeForm ,
this . ColorDepth , this . ZDepth , this . StencilDepth ) ;
AttachEvents ( activeForm ) ;
2006-11-05 11:50:08 +00:00
activeForm . FormBorderStyle = FormBorderStyle . None ;
2006-11-02 21:40:36 +00:00
activeForm . ClientSize = new Size ( width , height ) ;
activeForm . Location = Point . Empty ;
2006-11-05 11:50:08 +00:00
activeForm . TopMost = true ;
activeForm . Enabled = true ;
2006-11-02 21:40:36 +00:00
2006-11-05 11:50:08 +00:00
activeForm . Show ( ) ;
activeContext . SetFullScreen ( width , height , ColorDepth ) ;
2006-11-02 21:40:36 +00:00
}
private void AttachEvents ( Form frm )
{
2006-11-05 11:50:08 +00:00
frm . Load + = this . OnLoad ;
frm . Resize + = this . OnResize ;
frm . Paint + = this . OnPaint ;
frm . KeyDown + = this . OnKeyDown ;
frm . KeyUp + = this . OnKeyUp ;
frm . KeyPress + = this . OnKeyPress ;
frm . Click + = this . OnClick ;
frm . MouseDown + = this . OnMouseDown ;
frm . MouseEnter + = this . OnMouseEnter ;
frm . MouseHover + = this . OnMouseHover ;
frm . MouseLeave + = this . OnMouseLeave ;
frm . MouseMove + = this . OnMouseMove ;
frm . MouseUp + = this . OnMouseUp ;
frm . MouseWheel + = this . OnMouseWheel ;
2006-11-02 21:40:36 +00:00
}
#endregion
2006-11-05 11:50:08 +00:00
#region - - - Events - - -
virtual protected void OnIdle ( object sender , EventArgs e )
{
while ( ActiveForm ! = null & & platform . IsIdle ( ) )
{
if ( ! ActiveForm . Focused )
{
Thread . Sleep ( 100 ) ;
}
this . OnPaint ( ) ;
}
}
2006-11-02 21:40:36 +00:00
virtual protected void OnMouseWheel ( object sender , MouseEventArgs e )
{
if ( MouseWheel ! = null )
MouseWheel ( sender , e ) ;
}
2006-11-05 11:50:08 +00:00
2006-11-02 21:40:36 +00:00
virtual protected void OnMouseUp ( object sender , MouseEventArgs e )
{
if ( MouseUp ! = null )
MouseUp ( sender , e ) ;
}
2006-11-05 11:50:08 +00:00
2006-11-02 21:40:36 +00:00
virtual protected void OnMouseMove ( object sender , MouseEventArgs e )
{
if ( MouseMove ! = null )
MouseMove ( sender , e ) ;
}
2006-11-05 11:50:08 +00:00
2006-11-02 21:40:36 +00:00
virtual protected void OnMouseLeave ( object sender , EventArgs e )
{
if ( MouseLeave ! = null )
MouseLeave ( sender , e ) ;
}
2006-11-05 11:50:08 +00:00
2006-11-02 21:40:36 +00:00
virtual protected void OnMouseHover ( object sender , EventArgs e )
{
if ( MouseHover ! = null )
MouseHover ( sender , e ) ;
}
2006-11-05 11:50:08 +00:00
2006-11-02 21:40:36 +00:00
virtual protected void OnMouseEnter ( object sender , EventArgs e )
{
if ( MouseEnter ! = null )
MouseEnter ( sender , e ) ;
}
2006-11-05 11:50:08 +00:00
2006-11-02 21:40:36 +00:00
virtual protected void OnMouseDown ( object sender , MouseEventArgs e )
{
if ( MouseDown ! = null )
MouseDown ( sender , e ) ;
}
2006-11-05 11:50:08 +00:00
2006-11-02 21:40:36 +00:00
virtual protected void OnClick ( object sender , EventArgs e )
{
if ( Click ! = null )
Click ( sender , e ) ;
}
2006-11-05 11:50:08 +00:00
2006-11-02 21:40:36 +00:00
virtual protected void OnKeyPress ( object sender , KeyPressEventArgs e )
{
if ( KeyPress ! = null )
KeyPress ( sender , e ) ;
}
2006-11-05 11:50:08 +00:00
2006-11-02 21:40:36 +00:00
virtual protected void OnKeyUp ( object sender , KeyEventArgs e )
{
if ( KeyUp ! = null )
KeyUp ( sender , e ) ;
}
2006-11-05 11:50:08 +00:00
2006-11-02 21:40:36 +00:00
virtual protected void OnKeyDown ( object sender , KeyEventArgs e )
{
if ( KeyDown ! = null )
KeyDown ( sender , e ) ;
}
2006-11-05 11:50:08 +00:00
2006-11-02 21:40:36 +00:00
private void OnPaint ( object sender , PaintEventArgs e )
{
OnPaint ( ) ;
if ( Paint ! = null )
Paint ( sender , e ) ;
}
2006-11-05 11:50:08 +00:00
2006-11-02 21:40:36 +00:00
virtual protected void OnPaint ( )
{
}
virtual protected void OnResize ( object sender , EventArgs e )
{
if ( Resize ! = null )
Resize ( sender , e ) ;
}
2006-11-05 11:50:08 +00:00
2006-11-02 21:40:36 +00:00
virtual protected void OnLoad ( object sender , EventArgs e )
{
if ( Load ! = null )
Load ( sender , e ) ;
}
public event EventHandler Load ;
public event EventHandler Resize ;
public event PaintEventHandler Paint ;
public event KeyEventHandler KeyDown ;
public event KeyEventHandler KeyUp ;
public event KeyPressEventHandler KeyPress ;
public event EventHandler Click ;
public event MouseEventHandler MouseDown ;
public event EventHandler MouseEnter ;
public event EventHandler MouseHover ;
public event EventHandler MouseLeave ;
public event MouseEventHandler MouseMove ;
public event MouseEventHandler MouseUp ;
public event MouseEventHandler MouseWheel ;
#endregion
2006-11-05 11:50:08 +00:00
#region - - - Window Management - - -
2006-11-02 21:40:36 +00:00
private void DisposeForm ( )
{
if ( activeContext ! = null )
activeContext . Dispose ( ) ;
if ( activeForm ! = null )
activeForm . Dispose ( ) ;
2006-11-05 11:50:08 +00:00
2006-11-02 21:40:36 +00:00
activeContext = null ;
activeForm = null ;
}
public void SetResolution ( int width , int height , OpenGL . ColorDepth color , bool fullscreen )
{
ColorDepth = color ;
if ( fullscreen & & IsFullscreen )
{
activeForm . ClientSize = new Size ( width , height ) ;
activeContext . SetFullScreen ( width , height , color ) ;
}
else if ( fullscreen & & ! IsFullscreen )
{
CreateFullScreenDisplay ( width , height ) ;
}
else
{
CreateWindowedDisplay ( width , height ) ;
}
}
#endregion
2006-11-05 11:50:08 +00:00
#region - - - Main Loop - - -
2006-11-02 21:40:36 +00:00
2006-11-05 11:50:08 +00:00
/// <summary>
/// Enters the Framework's main loop, updating state and rendering.
/// </summary>
2006-11-02 21:40:36 +00:00
public void Run ( )
{
2006-11-05 11:50:08 +00:00
// TODO: Find a better main loop. This is evil! (Probably a custom main loop or something based on the Idle event).
2006-11-02 21:40:36 +00:00
while ( ActiveForm ! = null & & ActiveForm . IsDisposed = = false )
{
OnPaint ( this , null ) ;
2006-11-05 11:50:08 +00:00
2006-11-02 21:40:36 +00:00
if ( platform . IsIdle ( ) = = false )
Application . DoEvents ( ) ;
}
}
2006-11-05 11:50:08 +00:00
2006-11-02 21:40:36 +00:00
#endregion
}
2006-11-05 11:50:08 +00:00
#region Old Code
2006-11-02 21:40:36 +00:00
/ *
2006-10-15 20:28:57 +00:00
public partial class Framework : Form , IDisposable
2006-10-09 22:35:25 +00:00
{
2006-10-15 20:28:57 +00:00
#region Public properties
2006-10-09 22:35:25 +00:00
#region Context
2006-10-15 20:28:57 +00:00
2006-10-09 22:35:25 +00:00
private GLContext _context ;
public GLContext Context
{
get { return _context ; }
2006-11-02 21:40:36 +00:00
internal set { _context = value ; }
2006-10-15 20:28:57 +00:00
}
#endregion
#region Fullscreen property
private bool _fullscreen ;
public bool Fullscreen
{
get { return _fullscreen ; }
2006-11-02 21:40:36 +00:00
internal set { _fullscreen = value ; }
2006-10-15 23:31:37 +00:00
}
#endregion
#region ColorDepth property
private OpenTK . OpenGL . ColorDepth _color_depth ;
public OpenTK . OpenGL . ColorDepth ColorDepth
{
get { return _color_depth ; }
2006-11-02 21:40:36 +00:00
internal set { _color_depth = value ; }
2006-10-15 23:31:37 +00:00
}
#endregion
#region ZDepth property
private int _z_depth ;
public int ZDepth
{
get { return _z_depth ; }
2006-11-02 21:40:36 +00:00
internal set { _z_depth = value ; }
2006-10-15 23:31:37 +00:00
}
#endregion
#region StencilDepth property
private int _stencil_depth ;
public int StencilDepth
{
get { return _stencil_depth ; }
2006-11-02 21:40:36 +00:00
internal set { _stencil_depth = value ; }
2006-10-15 20:28:57 +00:00
}
#endregion
#region DesktopResolution property
private Size _desktop_resolution ;
public Size DesktopResolution
{
get { return _desktop_resolution ; }
2006-11-02 21:40:36 +00:00
internal set { _desktop_resolution = value ; }
2006-10-15 20:28:57 +00:00
}
#endregion
#region DesktopRefreshRate property
private float _desktop_refresh_rate ;
public float DesktopRefreshRate
{
get { return _desktop_refresh_rate ; }
2006-11-02 21:40:36 +00:00
internal set { _desktop_refresh_rate = value ; }
2006-10-17 19:34:49 +00:00
}
#endregion
#region DesktopColorDepth property
private OpenTK . OpenGL . ColorDepth _desktop_color_depth ;
public OpenTK . OpenGL . ColorDepth DesktopColorDepth
{
get { return _desktop_color_depth ; }
2006-11-02 21:40:36 +00:00
internal set { _desktop_color_depth = value ; }
2006-10-09 22:35:25 +00:00
}
2006-10-15 20:28:57 +00:00
#endregion
2006-10-09 22:35:25 +00:00
#endregion
2006-10-15 20:28:57 +00:00
FrameworkImplementation Implementation ;
2006-10-11 21:42:22 +00:00
2006-10-09 22:35:25 +00:00
#region Constructors
2006-10-11 21:42:22 +00:00
public Framework ( )
2006-10-09 22:35:25 +00:00
{
2006-10-17 19:34:49 +00:00
Setup ( null , 800 , 600 , new OpenTK . OpenGL . ColorDepth ( 8 , 8 , 8 , 8 ) , 16 , 0 , false ) ;
2006-10-09 22:35:25 +00:00
}
2006-10-11 21:42:22 +00:00
2006-10-15 23:31:37 +00:00
public Framework ( string title , int width , int height , OpenTK . OpenGL . ColorDepth color , int depth , int stencil , bool fullscreen )
2006-10-11 21:42:22 +00:00
{
2006-10-15 23:31:37 +00:00
Setup ( title , width , height , color , depth , stencil , fullscreen ) ;
2006-10-11 21:42:22 +00:00
}
2006-10-11 22:10:29 +00:00
2006-10-09 22:35:25 +00:00
#endregion
2006-10-17 19:34:49 +00:00
#region Setup ( string title , int width , int height , OpenTK . OpenGL . ColorDepth color , int depth , int stencil , bool fullscreen )
private void Setup ( string title , int width , int height , OpenTK . OpenGL . ColorDepth color , int depth , int stencil , bool fullscreen )
2006-10-11 21:42:22 +00:00
{
2006-11-02 21:40:36 +00:00
System . Console . WriteLine ( "Created Framework." ) ;
2006-10-15 20:28:57 +00:00
// Set platform.
2006-10-11 21:42:22 +00:00
try
{
2006-11-02 21:40:36 +00:00
PlatformID platform = Environment . OSVersion . Platform ;
if ( platform = = PlatformID . Win32NT | |
platform = = PlatformID . Win32Windows )
2006-10-11 21:42:22 +00:00
{
2006-11-02 21:40:36 +00:00
System . Console . Write ( "Instantiating Windows Implementation..." ) ;
2006-10-15 20:28:57 +00:00
Implementation = new WindowsImplementation ( this ) ;
2006-11-02 21:40:36 +00:00
System . Console . WriteLine ( "success." ) ;
2006-10-11 21:42:22 +00:00
}
2006-11-02 21:40:36 +00:00
else if ( platform = = PlatformID . Unix | |
platform = = ( PlatformID ) 128 ) // older versions of Mono report 128.
2006-10-11 21:42:22 +00:00
{
2006-11-02 21:40:36 +00:00
System . Console . Write ( "Instantiating X11 Implementation..." ) ;
Implementation = new X11Implementation ( this ) ;
System . Console . WriteLine ( "success." ) ;
2006-10-11 21:42:22 +00:00
}
else
{
throw new PlatformNotSupportedException ( "The platform on which you are trying to run this program is not currently supported. Sorry for the inconvenience." ) ;
}
}
catch ( Exception e )
{
MessageBox . Show ( e . ToString ( ) ) ;
2006-10-15 20:28:57 +00:00
throw e ;
2006-10-11 21:42:22 +00:00
}
2006-10-15 20:28:57 +00:00
this . HandleCreated + = new EventHandler ( Implementation . OnHandleCreated ) ;
//Type xplatui = Type.GetType("System.Windows.Forms.XplatUIX11, System.Windows.Forms");
//if (xplatui != null)
//{
// Context = GLContext.Create(this, 8, 8, 8, 8, 16, 0);
// //Context.MakeCurrent();
//}
2006-10-15 23:31:37 +00:00
2006-10-17 19:34:49 +00:00
// Initialise components.
ColorDepth = color ;
ZDepth = depth ;
StencilDepth = stencil ;
2006-11-02 21:40:36 +00:00
System . Console . WriteLine ( "Creating Context." ) ;
2006-10-15 23:31:37 +00:00
Context = GLContext . Create ( this , color , depth , stencil ) ;
2006-10-15 20:28:57 +00:00
// Code taken from NeHe tutorials
2006-11-02 21:40:36 +00:00
this . CreateParams . Style | = ( int ) WinApi . WindowClassStyle . HRedraw | ( int ) WinApi . WindowClassStyle . VRedraw | ( int ) WinApi . WindowClassStyle . OwnDC ;
2006-10-15 20:28:57 +00:00
this . SetStyle ( ControlStyles . AllPaintingInWmPaint , true ) ; // No Need To Erase Form Background
this . SetStyle ( ControlStyles . Opaque , true ) ; // No Need To Draw Form Background
//this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); // Buffer Control
2006-10-15 23:31:37 +00:00
//this.SetStyle(ControlStyles.ResizeRedraw, true); // Redraw On Resize
2006-10-15 20:28:57 +00:00
this . SetStyle ( ControlStyles . UserPaint , true ) ; // We'll Handle Painting Ourselves
2006-10-11 22:48:39 +00:00
2006-11-02 21:40:36 +00:00
System . Console . WriteLine ( "Setting Resolution." ) ;
2006-10-17 19:34:49 +00:00
Implementation . SetResolution ( width , height , color , fullscreen ) ;
2006-10-15 23:31:37 +00:00
2006-11-02 21:40:36 +00:00
if ( string . IsNullOrEmpty ( title ) )
2006-10-11 22:48:39 +00:00
title = "OpenTK Windows application" ;
2006-10-09 22:35:25 +00:00
this . Text = title ;
2006-10-15 20:28:57 +00:00
Application . Idle + = new EventHandler ( OnIdle ) ;
2006-11-02 21:40:36 +00:00
System . Console . WriteLine ( "Done Initializing." ) ;
2006-10-09 22:35:25 +00:00
}
2006-10-17 19:34:49 +00:00
#endregion
2006-10-11 21:42:22 +00:00
#region Event Handlers
2006-10-09 22:35:25 +00:00
/// <summary>
/// Called when all pending messages have been processed, this is where the application 'Main Loop' resides.
/// </summary>
/// <param name="sender">Not used.</param>
/// <param name="e">Not used.</param>
2006-11-02 21:40:36 +00:00
protected internal void OnIdle ( object sender , EventArgs args )
2006-10-09 22:35:25 +00:00
{
2006-10-15 20:28:57 +00:00
while ( Implementation . IsIdle ( ) )
2006-10-11 21:42:22 +00:00
{
2006-10-17 19:34:49 +00:00
//if (ActiveForm != this)
// Thread.Sleep(100);
2006-10-11 21:42:22 +00:00
OnPaint ( null ) ;
}
2006-10-09 22:35:25 +00:00
}
#endregion
2006-10-11 22:48:39 +00:00
2006-11-02 21:40:36 +00:00
internal new void SetTopLevel ( bool topLevel )
{
base . SetTopLevel ( topLevel ) ;
}
2006-10-17 19:34:49 +00:00
#region Public member functions
/// <summary>
/// Requests mode change. The parameters are hints for the mode, which may or may not be
/// possible according to the hardware.
/// </summary>
/// <param name="width">The horizontal resolution in pixels.</param>
/// <param name="height">The vertical resolution in pixels.</param>
/// <param name="color">The color depth.</param>
/// <param name="fullscreen">Set to true to set a fullscreen mode or false to set a windowed mode.</param>
/// <returns>True if the mode set was fullscreen, false otherwise.</returns></returns>
public void SetResolution ( int width , int height , OpenTK . OpenGL . ColorDepth color , bool fullscreen )
{
Implementation . SetResolution ( width , height , color , fullscreen ) ;
}
#endregion
2006-10-11 22:48:39 +00:00
#region IDisposable Members
void IDisposable . Dispose ( )
{
//GC.SuppressFinalize(true);
Application . Idle - = OnIdle ;
}
#endregion
2006-10-09 22:35:25 +00:00
}
2006-11-02 21:40:36 +00:00
* * /
2006-11-05 11:50:08 +00:00
#endregion
2006-10-09 22:35:25 +00:00
}