Original Post
Hi guys, I'm using Managed DX 9.0b and I'm having some trouble trying to use (Vertex/Index)Buffers that are created by declaring their size implicitly (in bytes) rather than passing it a Type and number of vertices. In other words using the following constructor: VertexBuffer (Device, Int32, Usage, VertexFormats, Pool) I have a setup that creates the vertexbuffer, hooks its created event and fills it with data etc. When it comes to rendering the data I have the following code: RenderState.Device3D.Indices = ib ; RenderState.Device3D.SetStreamSource(0, vbMatt, 0, DXHelp.GetTypeSize(typeof(CustomVertex.PositionColored))); RenderState.Device3D.VertexFormat = CustomVertex.PositionColored.Format; RenderState.Device3D.DrawIndexedPrimitives(PrimitiveType.TriangleList,0,0,8,0,12) ; Pretty standard stuff. It all works fine with VBs declared by specifying a Type and number of verts, but if I switch my VertexBuffer declaration over to the 'sizeInBytes' constructor, my DrawPrimitives call breaks. DX gives me the following error meesage: Stream 0 is not set and FVF vertex declaration is used. I checked and this is the error message recieved when u don't bind a VertexBuffer to a stream before you try to render. But... as you can see above I AM making that call. I get similiar problems when trying to declare IndexBuffers the same way. Anyone have any ideas? This is driving me nuts.