Subversion Repositories AndroidProjects

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1452 chris 1
#region License
2
//
3
// The Open Toolkit Library License
4
//
5
// Copyright (c) 2006 - 2009 the Open Toolkit library.
6
//
7
// Permission is hereby granted, free of charge, to any person obtaining a copy
8
// of this software and associated documentation files (the "Software"), to deal
9
// in the Software without restriction, including without limitation the rights to 
10
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
11
// the Software, and to permit persons to whom the Software is furnished to do
12
// so, subject to the following conditions:
13
//
14
// The above copyright notice and this permission notice shall be included in all
15
// copies or substantial portions of the Software.
16
//
17
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
19
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24
// OTHER DEALINGS IN THE SOFTWARE.
25
//
26
#endregion
27
 
28
using System;
29
using System.Collections.Generic;
30
using System.Text;
31
using OpenTK.Platform;
32
 
33
namespace OpenTK.Graphics
34
{
35
    // Provides the foundation for all IGraphicsContext implementations.
36
    abstract class GraphicsContextBase : IGraphicsContext, IGraphicsContextInternal
37
    {
38
        #region Fields
39
 
40
        bool disposed;
41
 
42
        protected ContextHandle Handle;
43
        protected GraphicsMode Mode;
44
 
45
        #endregion
46
 
47
        #region IGraphicsContext Members
48
 
49
        public abstract void SwapBuffers();
50
 
51
        public abstract void MakeCurrent(IWindowInfo window);
52
 
53
        public abstract bool IsCurrent { get; }
54
 
55
        public bool IsDisposed
56
        {
57
            get { return disposed; }
58
            protected set { disposed = value; }
59
        }
60
 
61
        public abstract bool VSync { get; set; }
62
 
63
        public virtual void Update(IWindowInfo window) { }
64
 
65
        public GraphicsMode GraphicsMode { get { return Mode; } }
66
 
67
        public bool ErrorChecking
68
        {
69
            get { throw new NotImplementedException(); }
70
            set { throw new NotImplementedException(); }
71
        }
72
 
73
        #endregion
74
 
75
        #region IGraphicsContextInternal Members
76
 
77
        public IGraphicsContext Implementation { get { return this; } }
78
 
79
        public abstract void LoadAll();
80
 
81
        public ContextHandle Context { get { return Handle; } }
82
 
83
        public abstract IntPtr GetAddress(string function);
84
 
85
        #endregion
86
 
87
        #region IDisposable Members
88
 
89
        public abstract void Dispose();
90
 
91
        #endregion
92
    }
93
}