Exemplo n.º 1
0
        // Begins clipping part of the scene
        public virtual void beginClip(Rectangle clipBounds)
        {
            // Variables
            int[]	data=	new int[4];

            GL.GetInteger(GetPName.Viewport, data);
            clipBounds.yi=	data[3]-(clipBounds.yi+clipBounds.heighti);
            GL.Scissor(clipBounds.xi, clipBounds.yi, clipBounds.widthi, clipBounds.heighti);
            GL.Enable(EnableCap.ScissorTest);
        }
Exemplo n.º 2
0
 public Border()
 {
     bounds=	Rectangle.EMPTY;
     colors=	new GUIColorPacket
     (
         new Color(0, 0, 0),
         new Color(0, 0, 0),
         new Color(0, 0, 0),
         new Color(0, 0, 0)
     );
     secondSetColors=	new GUIColorPacket
     (
         new Color(255, 255, 255),
         new Color(255, 255, 255),
         new Color(255, 255, 255),
         new Color(255, 255, 255)
     );
     borderSize=	1f;
     style=	BorderStyle.SOLID;
 }
Exemplo n.º 3
0
 // Renders the border given the game to render it on, state 0 is normal, state 1 is disabled, state 2 is hovered, and state 3 is pressed
 public void render(Game game, Rectangle prevClipRegion, byte state)
 {
     game.graphics.endClip();
     switch((int)(style))
     {
         case 0:	return;
         case 1:	renderSolid(ref game, state);	break;
         case 2:	renderDashed(ref game, state);	break;
         case 3:	renderDotted(ref game, state);	break;
         case 4:	renderDouble(ref game, state);	break;
         case 5:	renderGroove(ref game, state);	break;
         case 6:	renderRidge(ref game, state);	break;
         case 7:	renderInset(ref game, state);	break;
         case 8:	renderOutset(ref game, state);	break;
     }
     game.graphics.beginClip(prevClipRegion);
 }
Exemplo n.º 4
0
 public Curve(Rectangle pmBounds, CurveFunc pmFunc)
     : this(pmBounds, 1f, pmFunc)
 {
 }
Exemplo n.º 5
0
 public Curve(Rectangle pmBounds, float pmSegmentSize, CurveFunc pmFunc)
 {
     func=	pmFunc;
     bounds=	pmBounds;
     segmentSize=	Math.Abs(pmSegmentSize);
 }
Exemplo n.º 6
0
        // Renders the outline of a rectangle with the given rectangle, color, and line width
        public virtual void outlineRect(Rectangle bounds, Color color, float lineWidth)
        {
            // Variables
            Point3[]	endpoints=	bounds.getEndpoints();

            GL.Disable(EnableCap.Texture2D);
            GL.LineWidth(lineWidth);

            GL.Begin(PrimitiveType.Lines);
            {
                GL.Color4(color.red, color.green, color.blue, color.alpha);

                for(int i= 0; i< endpoints.Length; i++)
                {
                    GL.Vertex3(endpoints[i].x, endpoints[i].y, endpoints[i].z);
                    if(i== endpoints.Length-1)
                        GL.Vertex3(endpoints[0].x, endpoints[0].y, endpoints[0].z);
                    else
                    GL.Vertex3(endpoints[i+1].x, endpoints[i+1].y, endpoints[i+1].z);
                }
            }
            GL.End();

            GL.LineWidth(1f);
            GL.Enable(EnableCap.Texture2D);

            renderEndpoints(endpoints, color, lineWidth);
        }
Exemplo n.º 7
0
 public virtual void renderRectEndpoints(Rectangle bounds, float pointSize)
 {
     renderRectEndpoints(bounds, defaultColor, pointSize);
 }
Exemplo n.º 8
0
 public virtual void renderRectEndpoints(Rectangle bounds)
 {
     renderRectEndpoints(bounds, defaultColor, 1f);
 }
Exemplo n.º 9
0
 // Renders the endpoints of a rectangle with the given rectangle, color, and point size
 public virtual void renderRectEndpoints(Rectangle bounds, Color color, float pointSize)
 {
     renderEndpoints(bounds.getEndpoints(), color, pointSize);
 }
Exemplo n.º 10
0
 public virtual void renderRectEndpoints(Rectangle bounds, Color color)
 {
     renderRectEndpoints(bounds, color, 1f);
 }
Exemplo n.º 11
0
 public virtual void renderRect(Rectangle bounds)
 {
     renderRect(bounds, defaultColor);
 }
Exemplo n.º 12
0
        // Renders a rectangle with the given rectangle and color
        public virtual void renderRect(Rectangle bounds, Color color)
        {
            // Variables
            Point3[]	endpoints=	bounds.getEndpoints();

            GL.Disable(EnableCap.Texture2D);

            GL.Begin(PrimitiveType.Quads);
            {
                GL.Color4(color.red, color.green, color.blue, color.alpha);

                // Rectangle ABCD
                GL.Vertex3(endpoints[0].x, endpoints[0].y, endpoints[0].z);
                GL.Vertex3(endpoints[1].x, endpoints[1].y, endpoints[1].z);
                GL.Vertex3(endpoints[2].x, endpoints[2].y, endpoints[2].z);
                GL.Vertex3(endpoints[3].x, endpoints[3].y, endpoints[3].z);
            }
            GL.End();

            GL.Enable(EnableCap.Texture2D);
        }
Exemplo n.º 13
0
 public virtual void outlineRect(Rectangle bounds)
 {
     outlineRect(bounds, defaultColor, 1f);
 }
Exemplo n.º 14
0
 public virtual void outlineRect(Rectangle bounds, float lineWidth)
 {
     outlineRect(bounds, defaultColor, lineWidth);
 }
Exemplo n.º 15
0
 public virtual void outlineRect(Rectangle bounds, Color color)
 {
     outlineRect(bounds, color, 1f);
 }