2007-09-09 18:07:39 +02:00
|
|
|
|
#region --- License ---
|
2008-03-24 14:25:38 +01:00
|
|
|
|
/* 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.
|
2007-09-09 18:07:39 +02:00
|
|
|
|
*/
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
using System;
|
2007-09-02 10:09:01 +02:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
2008-02-28 14:57:07 +01:00
|
|
|
|
using OpenTK.Graphics;
|
2007-09-02 10:09:01 +02:00
|
|
|
|
|
|
|
|
|
namespace OpenTK.Platform
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
2008-01-31 14:17:42 +01:00
|
|
|
|
/// An empty IGraphicsContext implementation to be used inside the Visual Studio designer.
|
2007-12-09 19:15:51 +01:00
|
|
|
|
/// This class supports OpenTK, and is not intended for use by OpenTK programs.
|
2007-09-02 10:09:01 +02:00
|
|
|
|
/// </summary>
|
2008-03-10 14:25:33 +01:00
|
|
|
|
internal sealed class DummyGLContext : IGraphicsContext, IGraphicsContextInternal
|
2007-09-02 10:09:01 +02:00
|
|
|
|
{
|
2008-02-28 16:26:13 +01:00
|
|
|
|
GraphicsMode format;
|
2007-10-15 13:16:20 +02:00
|
|
|
|
bool vsync;
|
2008-03-24 14:25:38 +01:00
|
|
|
|
ContextHandle handle;
|
|
|
|
|
static int handle_count;
|
2007-10-15 13:16:20 +02:00
|
|
|
|
|
|
|
|
|
#region --- Constructors ---
|
|
|
|
|
|
2008-03-24 14:25:38 +01:00
|
|
|
|
public DummyGLContext(GraphicsMode format) { this.format = format; }
|
2007-10-15 13:16:20 +02:00
|
|
|
|
|
|
|
|
|
#endregion
|
2007-09-09 17:10:21 +02:00
|
|
|
|
|
2008-01-31 14:17:42 +01:00
|
|
|
|
#region --- IGraphicsContext Members ---
|
2007-09-02 10:09:01 +02:00
|
|
|
|
|
2008-03-24 14:25:38 +01:00
|
|
|
|
public IntPtr Context { get { return (IntPtr)handle_count; } }
|
2008-02-28 16:28:40 +01:00
|
|
|
|
public GraphicsMode GraphicsMode { get { return format; } }
|
2007-09-02 10:09:01 +02:00
|
|
|
|
|
2008-03-24 14:25:38 +01:00
|
|
|
|
public void CreateContext(bool direct, IGraphicsContext source)
|
|
|
|
|
{
|
|
|
|
|
if (handle == null)
|
|
|
|
|
{
|
|
|
|
|
++handle_count;
|
|
|
|
|
handle = new ContextHandle((IntPtr)handle_count);
|
|
|
|
|
}
|
|
|
|
|
}
|
2007-09-02 10:09:01 +02:00
|
|
|
|
|
2007-09-09 17:10:21 +02:00
|
|
|
|
public void SwapBuffers() { }
|
2008-03-03 13:44:56 +01:00
|
|
|
|
public void MakeCurrent(IWindowInfo info) { }
|
2008-01-31 14:15:17 +01:00
|
|
|
|
public bool IsCurrent { get { return true; } set { } }
|
2007-12-09 19:15:51 +01:00
|
|
|
|
public IntPtr GetCurrentContext() { return IntPtr.Zero; }
|
|
|
|
|
|
2008-01-31 14:17:42 +01:00
|
|
|
|
public event DestroyEvent<IGraphicsContext> Destroy;
|
2008-01-20 20:29:42 +01:00
|
|
|
|
void OnDestroy() { if (Destroy != null) Destroy(this, EventArgs.Empty); }
|
2007-12-09 19:15:51 +01:00
|
|
|
|
|
|
|
|
|
public void RegisterForDisposal(IDisposable resource)
|
|
|
|
|
{
|
2008-01-31 15:39:54 +01:00
|
|
|
|
throw new NotImplementedException("Use the general GraphicsContext class instead.");
|
2007-12-09 19:15:51 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void DisposeResources()
|
|
|
|
|
{
|
2008-01-31 15:39:54 +01:00
|
|
|
|
throw new NotImplementedException("Use the general GraphicsContext class instead.");
|
2007-12-09 19:15:51 +01:00
|
|
|
|
}
|
2007-09-02 10:09:01 +02:00
|
|
|
|
|
2007-09-09 17:10:21 +02:00
|
|
|
|
public IntPtr GetAddress(string function) { return IntPtr.Zero; }
|
2008-04-13 18:38:22 +02:00
|
|
|
|
//public IEnumerable<DisplayMode> GetDisplayModes() { return null; }
|
2007-09-02 10:09:01 +02:00
|
|
|
|
|
2007-10-15 13:16:20 +02:00
|
|
|
|
public bool VSync { get { return vsync; } set { vsync = value; } }
|
2007-09-29 17:24:55 +02:00
|
|
|
|
|
2007-09-02 10:09:01 +02:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region --- IDisposable Members ---
|
|
|
|
|
|
2007-09-09 17:10:21 +02:00
|
|
|
|
public void Dispose() { }
|
2007-09-02 10:09:01 +02:00
|
|
|
|
|
|
|
|
|
#endregion
|
2008-03-10 14:25:33 +01:00
|
|
|
|
|
|
|
|
|
#region IGraphicsContextInternal Members
|
|
|
|
|
|
|
|
|
|
public void LoadAll()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ContextHandle IGraphicsContextInternal.Context
|
|
|
|
|
{
|
2008-03-24 14:25:38 +01:00
|
|
|
|
get { return handle; }
|
2008-03-10 14:25:33 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
2007-09-02 10:09:01 +02:00
|
|
|
|
}
|
|
|
|
|
}
|