Example #1
0
 private void SetupAttributeBindings(AttributeBindings attributeBindings)
 {
     if (
         RenderStack.Graphics.Configuration.mustUseVertexArrayObject ||
         (
             RenderStack.Graphics.Configuration.canUseVertexArrayObject &&
             RenderStack.Graphics.Configuration.useVertexArrayObject
         )
         )
     {
         attributeBindings.Use();
         if (attributeBindings.Dirty)
         {
             attributeBindings.VertexBufferRange.Buffer.Use();
             attributeBindings.IndexBufferRange.Buffer.Use();
             attributeBindings.SetupAttributePointers();
             attributeBindings.Dirty = false;
         }
     }
     else
     {
         attributeBindings.VertexBufferRange.Buffer.Use();
         attributeBindings.IndexBufferRange.Buffer.Use();
         attributeBindings.SetupAttributePointers();
     }
 }
Example #2
0
 public State(State old)
 {
     Camera            = old.Camera;
     Viewport          = old.Viewport;
     Model             = old.Model;
     Frame             = old.Frame;
     Mesh              = old.Mesh;
     Material          = old.Material;
     Program           = old.Program;
     MeshMode          = old.MeshMode;
     VertexBuffer      = old.VertexBuffer;
     IndexBuffer       = old.IndexBuffer;
     AttributeBindings = old.AttributeBindings;
 }
Example #3
0
 private void DisableAttributeBindings(AttributeBindings attributeBindings)
 {
     if (
         RenderStack.Graphics.Configuration.mustUseVertexArrayObject ||
         (
             RenderStack.Graphics.Configuration.canUseVertexArrayObject &&
             RenderStack.Graphics.Configuration.useVertexArrayObject
         )
         )
     {
         //  NOP
     }
     else
     {
         attributeBindings.DisableAttributes();
     }
 }