示例#1
0
文件: Mesh.cs 项目: prepare/SharpBgfx
        public unsafe void Submit (byte viewId, Program program, Matrix4x4* transform, RenderStateGroup renderStateGroup, IUniformGroup uniforms, Texture texture, Uniform textureSampler) {
            foreach (var group in groups) {
                if (uniforms != null)
                    uniforms.SubmitPerDrawUniforms();

                if (texture != null)
                    Bgfx.SetTexture(0, textureSampler, texture);

                Bgfx.SetTransform((float*)transform);
                Bgfx.SetIndexBuffer(group.IndexBuffer);
                Bgfx.SetVertexBuffer(group.VertexBuffer);
                Bgfx.SetRenderState(renderStateGroup.State, (int)renderStateGroup.BlendFactorRgba);
                Bgfx.SetStencil(renderStateGroup.FrontFace, renderStateGroup.BackFace);
                Bgfx.Submit(viewId, program);
            }
        }
示例#2
0
        public unsafe void Submit(byte viewId, Program program, Matrix4x4 *transform, RenderStateGroup renderStateGroup, IUniformGroup uniforms, Texture texture, Uniform textureSampler)
        {
            foreach (var group in groups)
            {
                if (uniforms != null)
                {
                    uniforms.SubmitPerDrawUniforms();
                }

                if (texture != null)
                {
                    Bgfx.SetTexture(0, textureSampler, texture);
                }

                Bgfx.SetTransform((float *)transform);
                Bgfx.SetIndexBuffer(group.IndexBuffer);
                Bgfx.SetVertexBuffer(0, group.VertexBuffer);
                Bgfx.SetRenderState(renderStateGroup.State, (int)renderStateGroup.BlendFactorRgba);
                Bgfx.SetStencil(renderStateGroup.FrontFace, renderStateGroup.BackFace);
                Bgfx.Submit(viewId, program);
            }
        }