Beispiel #1
0
        public TextureFont(String name, Texture t, int charTextureSize, int size, int offset = 0)
            : base(name, size)
        {
            myCharTextureSize = charTextureSize;
            myLetteroffset    = offset;
            texture           = t;
            buildFont();

            //set shader
            List <ShaderDescriptor> desc = new List <ShaderDescriptor>();

            desc.Add(new ShaderDescriptor(ShaderType.VertexShader, "..\\src\\Graphics\\shaders\\font-vs.glsl", ShaderDescriptor.Source.File));
            desc.Add(new ShaderDescriptor(ShaderType.FragmentShader, "..\\src\\Graphics\\shaders\\font-ps.glsl", ShaderDescriptor.Source.File));
            ShaderProgramDescriptor shDesc = new ShaderProgramDescriptor(desc);

            myShader = Renderer.resourceManager.getResource(shDesc) as ShaderProgram;
            myVao.bindVertexFormat(myShader, V3T2.bindings());
        }
Beispiel #2
0
        public TTFFont(String name, String filename, int size)
            : base(name, size)
        {
            for (int i = 0; i < 128; i++)
            {
                myGlyphs.Add(new Glyph());
            }

            myFilename = filename;
            buildFont();

            //set shader
            List <ShaderDescriptor> desc = new List <ShaderDescriptor>();

            desc.Add(new ShaderDescriptor(ShaderType.VertexShader, "..\\src\\Graphics\\shaders\\font-vs.glsl", ShaderDescriptor.Source.File));
            desc.Add(new ShaderDescriptor(ShaderType.FragmentShader, "..\\src\\Graphics\\shaders\\font-ps.glsl", ShaderDescriptor.Source.File));
            ShaderProgramDescriptor shDesc = new ShaderProgramDescriptor(desc);

            myShader = Renderer.resourceManager.getResource(shDesc) as ShaderProgram;
            myVao.bindVertexFormat(myShader, V3T2.bindings());
        }