예제 #1
0
        public CoordinateSystem()
        {
            // Load shader
            sdr = new GLShader(new string[] { COORDINATE_SYSTEM_SHADER.VS }, new string[] { COORDINATE_SYSTEM_SHADER.FS });
            sdr_colorModeParam = sdr.GetUniformLocation("ColorMode");

            // Load texture
            tex = GLTexture2D.FromFile(Global.EXE_DIR + "arrow.png");
        }
예제 #2
0
        public GLTextFont(string filename, Vector2 charsize, GLMesh meshquad)
        {
            this.texture  = GLTexture2D.FromFile(filename);
            this.charsize = charsize;
            this.meshquad = meshquad;

            if (fontshader == null)
            {
                fontshader = new GLShader(new string[] { FONT_SHADER.VS }, new string[] { FONT_SHADER.FS });
                fontshader_coloruniform = fontshader.GetUniformLocation("Color");
            }
        }
예제 #3
0
        public GLNumberFont(string filename, FontDefinition fontDefinition, GLMesh meshquad, bool isFixedWidth)
        {
            this.texture    = GLTexture2D.FromFile(filename);
            this.fontdef    = fontDefinition;
            this.meshquad   = meshquad;
            this.fixedwidth = /*isFixedWidth ? fontdef[0][10] / 10 :*/ 0;

            if (fontshader == null)
            {
                fontshader = new GLShader(new string[] { FONT_SHADER.VS }, new string[] { FONT_SHADER.FS });
                fontshader_coloruniform = fontshader.GetUniformLocation("Color");
            }
        }
예제 #4
0
        public GLButton(string texfilename, Rectangle bounds, AnchorStyles anchor = AnchorStyles.Top | AnchorStyles.Left, string actionname = null, string actiondesc = null)
        {
            this.Anchor = anchor;

            this.tex = GLTexture2D.FromFile(texfilename, false);
            if (actionname != null)
            {
                clickAction = ActionManager.CreateAction(actiondesc == null ? "" : actiondesc, actionname, this, "ClickInternal");
            }

            if (bounds.Width <= 0)
            {
                bounds.Width = tex.width;
            }
            if (bounds.Height <= 0)
            {
                bounds.Height = tex.height;
            }
            this.Bounds = bounds;
        }