예제 #1
0
        VBO GetVBOFor(Texture tex)
        {
            for (int i = 0; i < VBOs.Count; i++)
            {
                if (VBOs[i].Tex.Original_InternalID == tex.Original_InternalID)
                {
                    return(VBOs[i]);
                }
            }
            VBO vbo = new VBO();

            vbo.Tex = tex;
            vbo.Prepare();
            VBOs.Add(vbo);
            return(vbo);
        }
예제 #2
0
 public override void Recalculate()
 {
     Position = ((Maxes - Mins) / 2) + Mins;
     PrimaryEditor.ContextView.Control.MakeCurrent();
     if (MyVBO != null)
     {
         MyVBO.Destroy();
     }
     MyVBO = new VBO();
     MyVBO.Prepare();
     MyVBO.Tex = PrimaryEditor.ContextView.Textures.GetTexture(Texture);
     MyVBO.AddSide(new Location(0, 0, 1), Coords[0]);
     MyVBO.AddSide(new Location(0, 0, -1), Coords[1]);
     MyVBO.AddSide(new Location(1, 0, 0), Coords[2]);
     MyVBO.AddSide(new Location(-1, 0, 0), Coords[3]);
     MyVBO.AddSide(new Location(0, 1, 0), Coords[4]);
     MyVBO.AddSide(new Location(0, -1, 0), Coords[5]);
     MyVBO.GenerateVBO();
 }