aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/OpenTKGameWindow.cs
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2016-02-11 17:01:00 +0100
committerjpbruyere <jp.bruyere@hotmail.com>2016-02-12 10:33:24 +0100
commit0f813f1c3d1bc3e4deeee089d771eb0443949e3f (patch)
treeedd60eedf4e78439bb04bd906f5bc5f2ca46f99f /src/OpenTKGameWindow.cs
parent44caf51048bde7e9daf78acc779278642c798748 (diff)
temp save to make test in master
Diffstat (limited to 'src/OpenTKGameWindow.cs')
-rw-r--r--src/OpenTKGameWindow.cs46
1 files changed, 20 insertions, 26 deletions
diff --git a/src/OpenTKGameWindow.cs b/src/OpenTKGameWindow.cs
index 16362c6c..e6fc9681 100644
--- a/src/OpenTKGameWindow.cs
+++ b/src/OpenTKGameWindow.cs
@@ -90,7 +90,7 @@ namespace Crow
{
GraphicObjects.Remove(g);
GraphicObjects.Insert(0, g);
- g.registerClipRect ();
+ //g.registerClipRect ();
}
}
public void Quit ()
@@ -282,14 +282,15 @@ namespace Crow
gobjsToRedraw.Clear ();
foreach (GraphicObject p in gotr) {
p.IsQueuedForRedraw = false;
- p.registerClipRect ();
+ p.RegisterClip (p.LastPaintedSlot);
+ p.RegisterClip (p.getSlot());
}
#if MEASURE_TIME
updateTime.Stop ();
drawingTime.Start ();
#endif
-
+ Debug.WriteLine (redrawClip.ToString ());
lock (redrawClip) {
if (redrawClip.count > 0) {
#if DEBUG_CLIP_RECTANGLE
@@ -299,17 +300,18 @@ namespace Crow
//Link.draw (ctx);
foreach (GraphicObject p in invGOList) {
- if (p.Visible) {
+ if (!p.Visible)
+ continue;
+
+ ctx.Save ();
+
+ Rectangles clip = redrawClip.intersectingRects (p.Slot);
- ctx.Save ();
- if (redrawClip.count > 0) {
- Rectangles clip = redrawClip.intersectingRects (p.Slot);
+ if (clip.count > 0)
+ p.Paint (ref ctx);
+
+ ctx.Restore ();
- if (clip.count > 0)
- p.Paint (ref ctx, clip);
- }
- ctx.Restore ();
- }
}
ctx.ResetClip ();
#if DEBUG_CLIP_RECTANGLE
@@ -549,6 +551,9 @@ namespace Crow
#endregion
#region ILayoutable implementation
+ public void RegisterClip(Rectangle r){
+ redrawClip.AddRectangle (r);
+ }
public int LayoutingTries {
get { throw new NotImplementedException (); }
set { throw new NotImplementedException (); }
@@ -559,17 +564,13 @@ namespace Crow
}
public void RegisterForLayouting (LayoutingType layoutType) { throw new NotImplementedException (); }
public bool UpdateLayout (LayoutingType layoutType) { throw new NotImplementedException (); }
- public Rectangle ContextCoordinates (Rectangle r)
- {
- return r;
- }
+ public Rectangle ContextCoordinates (Rectangle r) => r;
public Rectangle ScreenCoordinates (Rectangle r) => r;
public ILayoutable Parent {
get { return null; }
set { throw new NotImplementedException (); }
}
-
public ILayoutable LogicalParent {
get { return null; }
set { throw new NotImplementedException (); }
@@ -581,15 +582,8 @@ namespace Crow
public IGOLibHost HostContainer {
get { return this; }
}
-
- public Rectangle getSlot ()
- {
- return ClientRectangle;
- }
- public Rectangle getBounds ()//redundant but fill ILayoutable implementation
- {
- return ClientRectangle;
- }
+ public Rectangle getSlot () => ClientRectangle;
+ public Rectangle getBounds () => ClientRectangle;
#endregion
}
} \ No newline at end of file