aboutsummaryrefslogtreecommitdiffstatsci
path: root/src
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2015-12-11 10:32:33 +0100
committerjpbruyere <jp.bruyere@hotmail.com>2015-12-11 10:32:33 +0100
commitb23b66e6da5f4d355a0424997b4b40e06c078c6c (patch)
treefd7bc90cf7203b96185223bded7e4681534bd937 /src
parent45ff312aa9b439678731a4a8b3462a3adea57133 (diff)
parentf9a309949cb86c4556ac32e3f1734843f1bd0cac (diff)
Merge branch 'master' of https://github.com/jpbruyere/GOLib
Diffstat (limited to 'src')
-rw-r--r--src/GraphicObjects/IGOLibHost.cs1
-rw-r--r--src/GraphicObjects/Popper.cs1
-rwxr-xr-xsrc/OpenTKGameWindow.cs59
3 files changed, 33 insertions, 28 deletions
diff --git a/src/GraphicObjects/IGOLibHost.cs b/src/GraphicObjects/IGOLibHost.cs
index a76500c7..cdf94282 100644
--- a/src/GraphicObjects/IGOLibHost.cs
+++ b/src/GraphicObjects/IGOLibHost.cs
@@ -12,6 +12,7 @@ namespace go
GraphicObject FocusedWidget { get; set; }
void AddWidget (GraphicObject g);
void DeleteWidget(GraphicObject g);
+ void PutOnTop (GraphicObject g);
void Quit ();
}
}
diff --git a/src/GraphicObjects/Popper.cs b/src/GraphicObjects/Popper.cs
index 2ec4396f..381b6281 100644
--- a/src/GraphicObjects/Popper.cs
+++ b/src/GraphicObjects/Popper.cs
@@ -164,6 +164,7 @@ namespace go
Content.Visible = true;
if (Content.Parent == null)
tc.AddWidget (Content);
+ tc.PutOnTop (Content);
}
Pop.Raise (this, e);
}
diff --git a/src/OpenTKGameWindow.cs b/src/OpenTKGameWindow.cs
index c23acbe3..0329250a 100755
--- a/src/OpenTKGameWindow.cs
+++ b/src/OpenTKGameWindow.cs
@@ -27,7 +27,7 @@ namespace go
public OpenTKGameWindow(int _width, int _height, string _title="golib")
: base(_width, _height, new OpenTK.Graphics.GraphicsMode(32, 24, 0, 1),
_title,GameWindowFlags.Default,DisplayDevice.GetDisplay(DisplayIndex.Second),
- 3,2,OpenTK.Graphics.GraphicsContextFlags.Debug|OpenTK.Graphics.GraphicsContextFlags.ForwardCompatible)
+ 3,3,OpenTK.Graphics.GraphicsContextFlags.Debug)
// public OpenTKGameWindow(int _width, int _height, string _title="golib")
// : base(_width, _height, new OpenTK.Graphics.GraphicsMode(32, 24, 0, 8), _title)
{
@@ -59,6 +59,7 @@ namespace go
Rectangles _redrawClip = new Rectangles();//should find another way to access it from child
List<GraphicObject> _gobjsToRedraw = new List<GraphicObject>();
+ #region IGOLibHost implementation
public Rectangles redrawClip {
get {
return _redrawClip;
@@ -89,15 +90,13 @@ namespace go
g.ClearBinding();
GraphicObjects.Remove (g);
}
- /// <summary> Remove all Graphic objects from top container </summary>
- public void ClearInterface()
+ public void PutOnTop(GraphicObject g)
{
- int i = 0;
- while (GraphicObjects.Count>0) {
- GraphicObject g = GraphicObjects [i];
- g.Visible = false;
- g.ClearBinding ();
- GraphicObjects.RemoveAt (0);
+ if (GraphicObjects.IndexOf(g) > 0)
+ {
+ GraphicObjects.Remove(g);
+ GraphicObjects.Insert(0, g);
+ g.registerClipRect ();
}
}
public void Quit ()
@@ -105,15 +104,6 @@ namespace go
this.Exit ();
}
- #region Events
- //those events are raised only if mouse isn't in a graphic object
- public event EventHandler<MouseWheelEventArgs> MouseWheelChanged;
- public event EventHandler<MouseButtonEventArgs> MouseButtonUp;
- public event EventHandler<MouseButtonEventArgs> MouseButtonDown;
- public event EventHandler<MouseButtonEventArgs> MouseClick;
- public event EventHandler<MouseMoveEventArgs> MouseMove;
- #endregion
-
#region focus
GraphicObject _activeWidget; //button is pressed on widget
GraphicObject _hoverWidget; //mouse is over
@@ -148,6 +138,29 @@ namespace go
}
#endregion
+ #endregion
+
+ /// <summary> Remove all Graphic objects from top container </summary>
+ public void ClearInterface()
+ {
+ int i = 0;
+ while (GraphicObjects.Count>0) {
+ GraphicObject g = GraphicObjects [i];
+ g.Visible = false;
+ g.ClearBinding ();
+ GraphicObjects.RemoveAt (0);
+ }
+ }
+
+ #region Events
+ //those events are raised only if mouse isn't in a graphic object
+ public event EventHandler<MouseWheelEventArgs> MouseWheelChanged;
+ public event EventHandler<MouseButtonEventArgs> MouseButtonUp;
+ public event EventHandler<MouseButtonEventArgs> MouseButtonDown;
+ public event EventHandler<MouseButtonEventArgs> MouseClick;
+ public event EventHandler<MouseMoveEventArgs> MouseMove;
+ #endregion
+
#region graphic contexte
Context ctx;
Surface surf;
@@ -416,16 +429,6 @@ namespace go
}
#endregion
- public void PutOnTop(GraphicObject g)
- {
- if (GraphicObjects.IndexOf(g) > 0)
- {
- GraphicObjects.Remove(g);
- GraphicObjects.Insert(0, g);
- g.registerClipRect ();
- }
- }
-
#region Mouse Handling
void Mouse_Move(object sender, MouseMoveEventArgs e)
{