Exemple #1
0
 public DrawCall(DrawFunc drawfunc, PrimType mode, ElementType indextype, List <int> arg)
 {
     this.mode      = mode;
     this.indextype = indextype;
     // iBaseVertex, vBaseVertex, voStream, indirectPtr
     arg0 = arg.Count > 0 ? arg[0] : 0;
     // iBaseIndex, vVertexCount, indirectCount
     arg1 = arg.Count > 1 ? arg[1] :
            drawfunc == DrawFunc.TransformFeedback ||
            drawfunc == DrawFunc.ArraysIndirect ||
            drawfunc == DrawFunc.ElementsIndirect
         ? 1
         : 0;
     // iIndexCount, vBaseInstance, indirectStride
     arg2 = arg.Count > 2 ? arg[2] :
            drawfunc == DrawFunc.TransformFeedback
         ? 1
         : drawfunc == DrawFunc.ArraysIndirect
             ? 16
             : drawfunc == DrawFunc.ElementsIndirect
                 ? 32
                 : 0;
     // iBaseInstance, vInstanceCount
     arg3 = arg.Count > 3 ? arg[3] :
            drawfunc == DrawFunc.ArraysInstanced ? 1 : 0;
     // iInstanceCount
     arg4 = arg.Count > 4 ? arg[4] :
            drawfunc == DrawFunc.ElementsInstanced ? 1 : 0;
 }
Exemple #2
0
 /// <summary> Creates a LegacyPlayerLayer with the given mod name, identifier name, and drawing action. </summary>
 public VanillaPlayerDrawLayer(string name, DrawFunc drawFunc, Transformation transform = null, bool isHeadLayer = false, Condition condition = null, Position position = null)
 {
     _name          = name;
     this.drawFunc  = drawFunc;
     this.condition = condition;
     this.position  = position;
     _transform     = transform;
     _isHeadLayer   = isHeadLayer;
 }
Exemple #3
0
        public FuncDrawer(Action <T> drawFunc, Func <object> newFunc = null)
        {
            _drawFunc = (string label, ref T obj, RenderContext rc) =>
            {
                drawFunc(obj);
                return(false);
            };

            _newFunc = newFunc;
        }
 internal TacticalTextPopUp(String s, BaseCharacter p, Vector2 offSet, Point textBoxSize, int steps, UpdateFunc uf = null, DrawFunc df = null)
 {
     if (bInitialize)
     {
         Inititialize();
     }
     text     = s;
     parent   = p;
     location = p.trueMapSize().Location.ToVector2() + offSet;
     textBox  = new Rectangle(location.ToPoint(), textBoxSize);
     timer    = new TimingUtility(16, true, standardTimer);
     timer.SetStepTimer(steps, 0);
     updateFunction = uf;
     drawFunction   = df;
 }
Exemple #5
0
        public void DrawCurve(Graphics g, DrawFunc func, double x, double step = 0.1)
        {
            List <PointF> points = new List <PointF>();

            for (double i = -x; i < x; i += step)
            {
                var res = func.Invoke(i);
                if (!double.IsNaN(res) && !double.IsInfinity(res))
                {
                    points.Add(new PointF(II(i), JJ(res)));
                }
            }

            if (points.Count > 1)
            {
                g.DrawCurve(Pens.Black, points.ToArray());
            }
        }
Exemple #6
0
 public MultiDrawCall(
     DrawFunc drawfunc,
     GLVertinput vertexin,
     GLVertoutput vertout,
     GLBuffer indexbuf,
     GLBuffer indirect)
 {
     vertin        = vertexin;
     indbuf        = indexbuf;
     this.cmd      = new List <DrawCall>();
     this.drawfunc = drawfunc;
     this.vertexin = vertexin != null ? vertexin.glname : 0;
     this.indexbuf = indexbuf != null ? indexbuf.glname : 0;
     this.vertout  = vertout != null ? vertout.glname : 0;
     this.indirect = indirect != null ? indirect.glname : 0;
     if (drawfunc == DrawFunc.ArraysIndirect)
     {
         this.indirect = this.indexbuf;
         this.indexbuf = 0;
     }
 }
 public ProceduralImage(float width, float height, DrawFunc draw)
 {
     Width  = width;
     Height = height;
     Draw   = draw;
 }
		public ProceduralImage (float width, float height, DrawFunc draw)
		{
			Width = width;
			Height = height;
			Draw = draw;
		}
 public void RegisterDrawFunction(DrawFunc drawFunc)
 {
     drawList.Add(drawFunc);
 }
Exemple #10
0
 protected void PushScreen(DrawFunc screen)
 {
     _screenStack.Push(_currentScreen);
     _currentScreen = screen;
 }
Exemple #11
0
 protected void PopScreen()
 {
     _currentScreen = _screenStack.Pop();
 }
Exemple #12
0
 public FuncDrawer(DrawFunc <T> drawFunc, Func <object> newFunc = null)
 {
     _drawFunc = drawFunc;
     _newFunc  = newFunc;
 }
Exemple #13
0
 public Menu(float height, Skin skin) : base(height, skin)
 {
     _screenStack   = new Stack <DrawFunc>();
     _currentScreen = _initialScreen;
 }
Exemple #14
0
 private static extern bool set_draw_handler(IntPtr pp9k, DrawFunc func);
Exemple #15
0
 public static bool Button(Rect rect, DrawFunc func)
 {
     return Button(rect, func, true);
 }
 /// <summary>
 /// Create a default draw canvas with an optional draw function.
 /// </summary>
 /// <param name="func">Draw function</param>
 public DrawCanvas(DrawFunc func)
 {
     DrawFunction = func;
 }
Exemple #17
0
 public static bool Button(Rect rect, DrawFunc func, bool isEnabled)
 {
     func(rect);
     GUITool.DrawEmptyRect(rect, Color.black);
     if (isEnabled)
     {
         return GUI.Button(rect, string.Empty, GUIStyle.none);
     }
     else
     {
         GUI.Label(rect, string.Empty, GUIStyle.none);
         return false;
     }
 }
 public void ImplementDrawAction(DrawFunc func)
 {
     drawSomething = func;
 }