Esempio n. 1
0
 public void Draw2dQuad(int textureid, float dx, float dy, float dw, float dh)
 {
     Mat4.Identity_(mvMatrix);
     Mat4.Translate(mvMatrix, mvMatrix, Vec3.FromValues(dx, dy, 0));
     Mat4.Scale(mvMatrix, mvMatrix, Vec3.FromValues(dw, dh, 0));
     Mat4.Scale(mvMatrix, mvMatrix, Vec3.FromValues(one / 2, one / 2, 0));
     Mat4.Translate(mvMatrix, mvMatrix, Vec3.FromValues(one, one, 0));
     SetMatrixUniforms();
     if (cubeModel == null)
     {
         cubeModel = p.CreateModel(QuadModelData.GetQuadModelData());
     }
     p.BindTexture2d(textureid);
     p.GLDisableAlphaTest();
     p.DrawModel(cubeModel);
     p.GLEnableAlphaTest();
 }