2009-02-22 10:43:35 +00:00
|
|
|
|
#region --- License ---
|
|
|
|
|
/* Licensed under the MIT/X11 license.
|
|
|
|
|
* Copyright (c) 2006-2008 the OpenTK Team.
|
|
|
|
|
* This notice may not be removed from any source distribution.
|
|
|
|
|
* See license.txt for licensing detailed licensing details.
|
|
|
|
|
*/
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using OpenTK.Graphics;
|
|
|
|
|
|
|
|
|
|
namespace OpenTK.Platform.Dummy
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// An empty IGraphicsContext implementation to be used inside the Visual Studio designer.
|
|
|
|
|
/// This class supports OpenTK, and is not intended for use by OpenTK programs.
|
|
|
|
|
/// </summary>
|
2009-08-17 10:23:16 +00:00
|
|
|
|
internal sealed class DummyGLContext : DesktopGraphicsContext
|
2009-02-22 10:43:35 +00:00
|
|
|
|
{
|
2009-08-11 21:45:32 +00:00
|
|
|
|
// This mode is not real. To receive a real mode we'd have to create a temporary context, which is not desirable!
|
2009-02-22 10:43:35 +00:00
|
|
|
|
bool vsync;
|
|
|
|
|
static int handle_count;
|
|
|
|
|
|
|
|
|
|
#region --- Constructors ---
|
|
|
|
|
|
2009-05-30 19:27:52 +00:00
|
|
|
|
public DummyGLContext()
|
|
|
|
|
{
|
2009-08-17 10:23:16 +00:00
|
|
|
|
Handle = new ContextHandle(new IntPtr(++handle_count));
|
|
|
|
|
Mode = new GraphicsMode(new IntPtr(2), 32, 16, 0, 0, 0, 2, false);
|
2009-05-30 19:27:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public DummyGLContext(ContextHandle handle)
|
|
|
|
|
{
|
2009-08-17 10:23:16 +00:00
|
|
|
|
Handle = handle;
|
2009-05-30 19:27:52 +00:00
|
|
|
|
}
|
2009-02-22 10:43:35 +00:00
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region --- IGraphicsContext Members ---
|
|
|
|
|
|
|
|
|
|
public void CreateContext(bool direct, IGraphicsContext source)
|
|
|
|
|
{
|
2009-08-17 10:23:16 +00:00
|
|
|
|
if (Handle == ContextHandle.Zero)
|
2009-02-22 10:43:35 +00:00
|
|
|
|
{
|
|
|
|
|
++handle_count;
|
2009-08-17 10:23:16 +00:00
|
|
|
|
Handle = new ContextHandle((IntPtr)handle_count);
|
2009-02-22 10:43:35 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2009-08-17 10:23:16 +00:00
|
|
|
|
public override void SwapBuffers() { }
|
|
|
|
|
public override void MakeCurrent(IWindowInfo info) { }
|
|
|
|
|
public override bool IsCurrent { get { return true; } }
|
2009-02-22 10:43:35 +00:00
|
|
|
|
|
2009-08-17 10:23:16 +00:00
|
|
|
|
public override IntPtr GetAddress(string function) { return IntPtr.Zero; }
|
2009-02-22 10:43:35 +00:00
|
|
|
|
|
2009-08-17 10:23:16 +00:00
|
|
|
|
public override bool VSync { get { return vsync; } set { vsync = value; } }
|
2009-02-22 10:43:35 +00:00
|
|
|
|
|
2009-08-17 10:23:16 +00:00
|
|
|
|
public override void Update(IWindowInfo window)
|
|
|
|
|
{ }
|
2009-02-22 10:43:35 +00:00
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region IGraphicsContextInternal Members
|
|
|
|
|
|
2009-08-17 10:23:16 +00:00
|
|
|
|
public override void LoadAll()
|
2009-03-07 10:36:51 +00:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2009-08-17 10:23:16 +00:00
|
|
|
|
#endregion
|
2009-02-22 10:43:35 +00:00
|
|
|
|
|
2009-08-17 10:23:16 +00:00
|
|
|
|
#region --- IDisposable Members ---
|
|
|
|
|
|
2009-09-03 12:23:11 +00:00
|
|
|
|
public override void Dispose() { IsDisposed = true; }
|
2009-02-22 10:43:35 +00:00
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
}
|