コード例 #1
0
ファイル: debugCanvas.cs プロジェクト: an87li/gameEngine
        public void init()
        {
            myVbo = new VertexBufferObject <V3T2B4>(BufferUsageHint.DynamicDraw);
            myIbo = new IndexBufferObject(BufferUsageHint.DynamicDraw);
            myVao = new VertexArrayObject();

            List <ShaderDescriptor> desc = new List <ShaderDescriptor>();

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

            myShader = Renderer.resourceManager.getResource(sd) as ShaderProgram;

            myVao.bindVertexFormat <V3T2B4>(myShader);

            myTexture = Graphics.Util.getEmbeddedTexture("Graphics.data.debugFont.png");
            myTexture.setMinMagFilters(TextureMinFilter.NearestMipmapNearest, TextureMagFilter.Nearest);
            myTexture.setWrapping(TextureWrapMode.ClampToEdge, TextureWrapMode.ClampToEdge);
            myFont = FontManager.findFont("DEFAULT");
        }
コード例 #2
0
ファイル: debugCanvas.cs プロジェクト: bholcomb/gameEngine
        public void init()
        {
            myVbo = new VertexBufferObject(BufferUsageHint.DynamicDraw);
            myIbo = new IndexBufferObject(BufferUsageHint.DynamicDraw);
            myVao = new VertexArrayObject();

            List <ShaderDescriptor> desc = new List <ShaderDescriptor>();

            desc.Add(new ShaderDescriptor(ShaderType.VertexShader, "Graphics.shaders.debug-vs.glsl"));
            desc.Add(new ShaderDescriptor(ShaderType.FragmentShader, "Graphics.shaders.debug-ps.glsl"));
            ShaderProgramDescriptor sd = new ShaderProgramDescriptor(desc);

            myShader = Renderer.resourceManager.getResource(sd) as ShaderProgram;

            myVao.bindVertexFormat(myShader, V3T2B4.bindings());

            myTexture = Graphics.Util.getEmbeddedTexture("Graphics.data.debugFont.png");
            //myTexture = Util.getEmbeddedTexture("Graphics.data.proggy12.png");
            myTexture.setMinMagFilters(TextureMinFilter.NearestMipmapNearest, TextureMagFilter.Nearest);
            myTexture.setWrapping(TextureWrapMode.ClampToEdge, TextureWrapMode.ClampToEdge);
            myFont = new TextureFont("Debug", myTexture, 16, 16, 32);
        }