Original Post
So I'm trying to put a naive implementation of a 2D sprite-based library for Direct3D 8 together and am starting to get my head round vertex buffers. I am happy to lock buffers and manipulate them in code at the moment, although I understand it is more efficient to move objects round with matricies, and that locking and unlocking the buffers is expensive. Would I be better off having a seperate vertex buffer for each sprite so I only have to lock it to alter the alpha or colours, and call SetStreamSource before each drawing operation, or is this not a good way to approach it? The alternative I suppose would to just have one four-point vertex buffer that is used to draw any quad and locked and altered before each draw operation. Bit new to all this, as you can probably tell. Also, while I am here, I was wondering about texture co-ordinates. If I had, say, a 500x500 image sat on a 512x512 texture and I just wanted to use the 500x500 bit, the u value would have to be (I think) 500/512, which is, according to by desk calculator, 0.9765625... etc. What level of floating point precision do you need to specify texture co-ords to and how much does floating point inaccuracy become a problem? Appreciate I could just test this to find out but am at work at the moment just mulling it over in my mind. Ta.