00001 #region --- License ---
00002
00003
00004
00005
00006
00007 #endregion
00008
00009 using System;
00010 using System.Collections.Generic;
00011 using System.Text;
00012 using OpenTK.Graphics;
00013
00014 namespace OpenTK.Platform.Dummy
00015 {
00021 internal sealed class DummyGLContext : DesktopGraphicsContext
00022 {
00023
00024 bool vsync;
00025 static int handle_count;
00026
00027 #region --- Constructors ---
00028
00029 public DummyGLContext()
00030 : this(new ContextHandle(new IntPtr(++handle_count)))
00031 {
00032 Mode = new GraphicsMode(new IntPtr(2), 32, 16, 0, 0, 0, 2, false);
00033 }
00034
00035 public DummyGLContext(ContextHandle handle)
00036 {
00037 Handle = handle;
00038 }
00039
00040 #endregion
00041
00042 #region --- IGraphicsContext Members ---
00043
00044 public void CreateContext(bool direct, IGraphicsContext source)
00045 {
00046 if (Handle == ContextHandle.Zero)
00047 {
00048 ++handle_count;
00049 Handle = new ContextHandle((IntPtr)handle_count);
00050 }
00051 }
00052
00053 public override void SwapBuffers() { }
00054 public override void MakeCurrent(IWindowInfo info) { }
00055 public override bool IsCurrent { get { return true; } }
00056
00057 public override IntPtr GetAddress(string function) { return IntPtr.Zero; }
00058
00059 public override bool VSync { get { return vsync; } set { vsync = value; } }
00060
00061 public override void Update(IWindowInfo window)
00062 { }
00063
00064 #endregion
00065
00066 #region IGraphicsContextInternal Members
00067
00068 public override void LoadAll()
00069 {
00070 }
00071
00072 #endregion
00073
00074 #region --- IDisposable Members ---
00075
00076 public override void Dispose() { IsDisposed = true; }
00077
00078 #endregion
00079 }
00080 }