Exemplo n.º 1
0
		public Mesh (string name, Material mat, VertexFormat format, float[] vertices, int[] indices, Bone[] bones) {
			_name = name;
			_material = mat;
			_vbuffer = new VertexBuffer(format, vertices);
			_ibuffer = new IndexBuffer(indices, BeginMode.Triangles);
			_bones = bones;
			if(_bones != null)
				_boneTransforms = new Matrix4[_bones.Length];
		}
Exemplo n.º 2
0
 public Mesh(string name, Material mat, VertexFormat format, float[] vertices, int[] indices, Bone[] bones)
 {
     _name     = name;
     _material = mat;
     _vbuffer  = new VertexBuffer(format, vertices);
     _ibuffer  = new IndexBuffer(indices, BeginMode.Triangles);
     _bones    = bones;
     if (_bones != null)
     {
         _boneTransforms = new Matrix4[_bones.Length];
     }
 }
Exemplo n.º 3
0
		public VertexBuffer (VertexFormat format, float[] vertices = null) {
			ThreadContext.Current.EnsureGLContext();
			_format = format;
			_data = vertices;

			var buffers = new uint[1];
			GL.GenBuffers(1, buffers);
			_handle = buffers[0];

			if (_data != null)
				this.Commit();
		}
Exemplo n.º 4
0
        public VertexBuffer(VertexFormat format, float[] vertices = null)
        {
            _format = format;
            _data   = vertices;

            var buf = new int[1];

            GL.GenBuffers(1, buf);
            _handle = buf[0];
                        #if __DESKTOP__
            _vao = GL.GenVertexArray();
            GL.BindVertexArray(_vao);
                        #endif

            if (_data != null)
            {
                this.Commit();
            }
        }