   Which is best?
  I am currently following a book at the moment, and it deals with creating a 2D tile-based game with DirectX 8.1.  I am using DirectX9, so I've been using different code for some of it.  The book uses surfaces for the tiles and every frame involves copying one surface to another (the backbuffer).  I already have my own Texture class, which has an IDirect3DTexture9 object in it.  It also has a Blit function, which draws it to the screen at a specified location.  This Blit function creates an ID3DXSprite object and calls its Draw function, passing in the texture and coordinates.What I would like to know is - can I use the texture method instead of using the surfaces method, for drawing tiles to the screen?  Because it seems easier to do so, but I was just wondering if there's any problems I may run into if I use one or the other?  I kept running into problems when copying surfaces.Thanks.   
  Using your current method is fine. But, does your Blit function actually create an ID3DXSprite interface each time it is called?   ;  Yes, it does, and I just realised that it's not too efficient to do that.  I was creating a new sprite pointer with each call of the Blit function, then setting it equal to the sprite which is contained in my Graphics class.  So, I have changed the code so that I'm using the sprite from the Graphics class directly, instead of needlessly creating new pointers.   ;  Good idea [wink].   ;  Copying surfaces to the backbuffer is a truly awful method.  What book is that?  If the other things it teaches are similarly suspect then you may be better off using it as a doorstop.;  It's probably The Zen of Direct3D Game Programming and if so you should take Drunken Hyena's advice. It's not the worst book out there, but it teaches some pretty awful things.   ;  It's "SAMs Teach Yourself Game Programming with DirectX in 21 Days."  I had heard about the SAMS books not being too great, but I find this book quite useful.  I already read a bit of "Programming Role Playing Games with DirectX, 2nd Edition", so I'm also using knowledge from that aswell, and it's going quite well so far.Thanks.   ;Quote:Original post by weegizzyIt's "SAMs Teach Yourself Game Programming with DirectX in 21 Days."  I had heard about the SAMS books not being too great, but I find this book quite useful.It is quite useful in a way.  It is useful for teaching the wrong way of doing things and insanely outdated techniques.  It's fine as long as you realize that the vast majority of what you are reading is utter crap that should be forgotten.   ;  I realise it's a bit outdated, but I just wanted to get started on a small project with DirectX and it has helped me do that (along with the other book I mentioned).  I found no other books that had a 2D tile project to work through, so I looked at the SAMS one and thought it'd be useful, and it is.  Even though it teaches outdated ways of doing things, it helps me in the way that I do more research to find other ways, like I've done.   