Beginning DirectX 10 Game Programming By Wendy Jones – Review


A search of amazon.com in regards to directx10 books yields only three entries: Wendy Jones’ book, a book by peter Walsh which by all account is just a basic update of his previous directx9 book and recently a new book by frank luna which also seems just like an update of a previous book.

I purchased Wendy Jones’ book: Beginning DirectX 10 Game Programming in January of this year and have only recently had the time to sit and go through it. In brief I wasn’t very impressed. This book is nothing more than a rehash of the tutorials available in the DX10 sdk, and to make matters worse you would think that she’d make an effort to improve upon the tutorials, that there would perhaps be more depth and clarity,  unfortunately she doesn’t.

What she’s done is taken clear concise tutorials and made them overly long, convoluted and tedious. All the problems in regards to explanation and presentation that are present in the SDK tutorial are present in her book. For example in one tutorial, they just show the instantiation of an object but never specify the object type name, so you have to dig around a little bit to get it, in her book the exact same thing occurs for the exact same section.

The only unique section she has is a chapter dealing with sprites which is not covered in the sdk tutorials and that could have been the only redeeming feature of the book but even that is written badly. What should be a short simple chapter gets dragged out, that chapter is nearly the length of the entire 3d section of the book.

Moving onto the 3D chapters, apart from the generic 3D primer and the cut and paste sections from the tutorials, there is practically no in depth information about what makes directx 10 different from directx 9 or even openGL. Lets not even get started on the quality of code present in the tutorials, i don’t understand why she even attempted to rewrite the tutorials, she may as well have included the sdk examples. She does created a “modelObject” structure but this is not exactly a major change.

Also this book is entitled “beginning directx10 game programming” but should rather have been called “rendering 2 cubes and a basic mesh in directx10” as this is the depth in which the text goes into. I’m not sure what the target audience is but having less than a 100 pages of a 350 page book dedicated to 3D graphics is plain unacceptable. The rest of the chapters cover directinput, and xinput.

Her explanations in these 100 pages are unclear, and the only depth covered is an explanation of input parameters which any beginner can get from the sdk docs anyways, there is absolutely no explanation of what functions actually do, why they do them and give the reader a basic intro into the dx10 pipeline and API. A lot of important information is missing and i had to end up digging up myself, especially in regards to displaying multiple objects.

Let me try explain how bad the source code examples are: in the triangle example she calls an initTriangle function to initialize the triangle, this now goes and creates an input layout. Now for a beginner, they might assume that for every object you make you need to create an input layout, seeing as the modelObject structure has that as a member. When in reality you only need to create one input layout for a specific vertex type, and only swap it if you pass through different types of vertices. The same goes for effects and techniques. Also she never really mentions how you would handle multiple objects properly, especially with the lack of a fixed function pipeline.

The just for a low blow, in the example where she renders a 3d cube, the initialization function is called and wait for it: initTriangle… You can see a lot of effort went into this book. (sarcasm!)

I feel the author herself doesn’t have a solid grasp of DX10 and has ended up just writing a book for the hell of it, her tutorials don’t convey any level of understanding but rather just say: want a vertex run this function call.

UPDATE: I’m now sure the author has very little understanding of dx10, in her book she implies that you need to create a vertex buffer for every object you wish to draw! This is a bad practice especially in regards to performance. The vertexbuffer is a block of memory which you fill prior with vertices prior to sending it to IA. You’ll have a list of vertices stored in an object container, and you would load up the vertex buffer with the vertices from the object and then draw it. Seeing as there is no way to change the size of the buffer once created nor is there a way to delete it, all you can do is update the data stored within the buffer. That is the reason the draw call takes the number of vertices and the offset as a parameters.

So why cant we just create a buffer for each object, imagine we have a scene with 1000 objects, each object has 1000 vertices, so now we have 1 000 000 vertices stored in memory, the swapping of vertex buffers is a slow operation and having to swap out the vertex buffer 100 times each frame has a major performance impact.

I’ve gone through her book thoroughly and then started to do a very basic b-spline demo in dx10 and quickly realized how much information i was missing, how badly things were explained and how she’d simply ripped off the sdk tutorials. I also ran into a major problem trying to organize and store my objects never mind draw them, I’ve spent two weeks messing around until i finally ended up slapping together a very basic DX manager class with a polymorphic object container hierarchy.

My advice is avoid this book,  don’t waste your money, rather download the dx10 sdk and go through their tutorials, you’ll find them more useful and better explained.

Oh and speaking of ripping off tutorials: there is this jackass ( http://www.kevindonde.com/ ) that is ripping off her tutorials and putting them up on the net as his own.

I’ve spent the better part of two weeks now digging in the SDK docs and browsing the web for solutions to my very basic problems and so forgive my frustration. I will hopefully write my own tutorials on directx 10 in the upcoming weeks and i do hope that they might actually be more useful than hers. I’ll also try and get hold of frank luna’s book and see if that is any better.

23 thoughts on “Beginning DirectX 10 Game Programming By Wendy Jones – Review

  1. I just bought the book last week and have pretty much the same impression as you. After comparing the code samples to the SDK in 6th chapter (halfway through the book and JUST NOW doing a simple triangle) I was blown away at how much of my time this book was already wasting.

  2. I’m only just starting directx using this book, but I was under the impression you pass a pointer to your vertices to the vertex buffer? As in the D3D10_SUBRESOURCE_DATA field called pSysMem points to your data and the vertex buffer uses that? Or does the createVertexBuffer function COPY the data from pSysMem?

  3. this is directly from the DX SDK: “D3D10_BUFFER_DESC describes the vertex buffer object to be created, and D3D10_SUBRESOURCE_DATA describes the actual data that will be copied to the vertex buffer during creation”

    when a vertex buffer is created, the data is copied to it, though where the vertex buffer ends up being stored (vidMem, sysMem) is what I’m unsure of, I’d hazard a guess and say that it’s also stored in system memory and the create buffer function just reformats the data.

  4. Humm.. So the idea would be to create one big buffer and store everything in one go in that single buffer? Or create a small buffer and copy vertices of object A into the buffer, draw, copy in the vertices of object B into the buffer, draw, etc? Just clarifying if the problem with multiple vertex buffers is the time taken to switch between buffers?

    As for Wendy Jones’ awful book, anyone have any feedback on Frank Luna’s DirectX 10 book?
    http://www.amazon.com/Introduction-3D-Game-Programming-DirectX/dp/1598220535/ref=sr_1_1?ie=UTF8&s=books&qid=1233730897&sr=1-1

  5. this is a matter of debate, what commonly happens is that you’d create a large buffer and start filling it, once its full you’d send it through to the graphics pipeline and while the buffer is being sent via the pipeline, you’d start refilling the buffer using the CPU.

    There is a way to do this, so that you send it to the pipeline and start writing to the same buffer without overwriting the old data but i cant remember of the top of my head. I’m pretty sure it had something to do with the flag used when creating the buffer… I’ll check up on that and get back to you if you want, otherwise google a bit.

    the thing is that if you have a lot of objects using the same vertexes then have a single buffer for all of them makes sense. When rendering them all you’d do is rerender the same buffer with different transformations and shaders as needed. Its all very application dependent…

  6. Ah ha, the CPU flags I suspect? Yeah obviously if I have enemies with the same mesh but a different texture, or even the same texture, just use transformations to instance them all over the game.

  7. yeh, if I remember the flag was something to do with “discard”, I’m planning my next tutorial where I’m gonna cover some more in depth buffer usage. In the tutorial after that I’ll cover meshes.

    Planning the damn tutorials is harder than actually writing them😦

  8. Cheers for all your help, I’ve now got a couple of buffers set up and am successfully copying data into them using Map and Unmap.

    One potential issue I have is that generally I’m making one draw call per object that’s drawn, and it would be cool to actually fill the buffers with data before making a draw call.. Only thing is, for that I need the objects to use the same textures and stuff, which could only happen realistically if it was two of the same model, but surely then I’d just change the matrices. I guess it might work with multiple of the same model but different stages of an animation or something.. I dunno, optimisation seems such a mindfuck given all these things you’re meant to do, like sorting by depth, grouping objects drawn with the same shader or settings in general, etc etc… Ahhh isnt life fun! /ramble

  9. I totally agree with you! I’m busy designing a basic little 3d engine and I’m starting to tear my hair out😦

    There is so much stuff you need to keep me in mind:/ I’m gonna be writing more tutorials to try and help out, the tutorials are basically short version of the things I’ve been playing around with.

  10. I guess one solution is to have several passes for a shader which do the same thing but use different resources, would just have to watch out for i < technique.passes of course, but there’s potential for it at least.. Though like any of these optimisation tricks it’s extremely content dependant..

  11. Unfortunately I bought this book. I haven’t even been able to figure out how to display an image let alone do anything with sprites. Even the example problems on the book’s CD would not work initially and it took me hours to find out what the problem was with them. The book leaves me feeling so discouraged after trying to use it that I often go for about a month between attempts. Today I spent about 4 or 5 hours trying to get my code (almost entirely from examples in the book) to work. This was just a code to display a single image, most of which had been previously completed. I found various problems which the book had not told me about nor even implied what to do. After the time spent making the code able to compile and build, I ran the program, only to find to my horror that THERE WAS STILL NO IMAGE.

  12. As the author of the book, I have to say that there are some things you’ve point out that are valid. Most of the examples were updated from my DX9 book but you also have to remind yourself that this is a book for “Beginners”. Yes, there is no need to create a new vertex buffer or vertex declaration for every object, but people just starting out will have no idea how to index multiple objects from a single buffer. It gets seriously confusing very quickly. Optimizations were not a part of this text, these things come later with experience. The point is to get people up and running with something they can get their heads around and then have a basis to learn from there.

    The starting point for anyone just getting into DX is to get a single triangle running, followed by more complicated geometry. Tossing someone into generating a 3D terrain or FPS is just going to confuse them. Sure, would I have loved to add more complicated samples, but that wasn’t what this book was about.

    My email address is listed in the book if people have any questions.

    Thanks. I’ll take any suggestions to improve any addtional texts.

  13. Hi wendy,

    Thanks for the response, what you say makes sense about the scope and audience of the book. I still feel that the book offers nothing more than the SDK tutorials.

    Though writing tutorials is not easy, but i still feel some more imaginative examples were warranted. After reading through nearly 350 page just to be shown how to create a dx10 mesh was extremely frustrating. You could have left out the xinput and those chapters out. I ordered the book from amazon to supplement the sdk docs and as so was horrified to see them duplicated in the book.

    For example I have Dave Astle’s beginning opengl game programming book from the same publisher and its targeted at the same audience but he covers more examples and more content.

    Also its a bit disappointing that for a beginner text on DX10, there is no proper intro to HLSL which is absolutely necessary. The DX10 API is tiny, there are like 17 global function calls. The bulk of the work of the API is done in HLSL now.

    What I would recommend for future editions if you find the time:

    remove the xInput section, directInput and sound section, which make up the bulk of the book. Reorder and add sections as such:

    1. the what, why, how…
    2. your first directx …
    3. 3d primer
    4. 3d introduction
    4. HLSL introduction
    5. Texturing
    6. More advanced Shaders and effects (cover stuff like lighting, multi texturing – maybe even show how to use the pixel shader to color terrain depending on vertex height, also maybe mention the point of constant buffers and effect pools)
    7. More Advanced Direct3d (cover meshes and instancing)
    8. Final Project (maybe do an outdoor scene with terrain, grass and a few objects)
    9. Further Reading

    This made me realize that you never mentioned instancing in your DX10 book, this is probably one of the most highly marketed features of DX10. Its not a very high level concept and can be explained for beginners.

    Maybe you can write a follow up book in this format.

  14. Hello,Nice to meet you,I’m a chinese studnt,I cry for this book! But I can’t found it in china,Could you help me?I need you help,thank you very much.(E-mail:xieyifei5201314@126.com)

  15. Thanks for the discussion of this book. I bought it primarily to
    try my hand at creating 2d games. I have been unable to get the chapter3 demos which use sprites to work. This may be the one of the problems Alway described above. Was anybody able to
    get example2 or 4 from chapter 3 to work?

    I have read the above comments, but the problems discussed seem to relate to 3D concepts later in the book.

    In Chapter 3 example 4, my texture is being successfully loaded in function GetTexture2DFromFile.
    Function D3DX10CreateSprite is being called successfully. In function MoveSprites, visible attribute of sprites is on, Update function is being entered and then Render. pD3DDevice is not NULL . The only thing being displayed is the black background produced by but the only thing displaying is a black screen produced by ClearRenderTargetView.

    Any ideas anyone?

  16. I found my answer on another blog. The last two arguments passed into function D3DXMatrixOrthoOffCenterLH should be 0.0f and 1.0f, not 0.1f and 10 as in the book.

  17. For a comprehensive graphics text there isn’t a better book than “realtime rendering” by akenine/moller, the only thing is that the book doesn’t feature any sort of API tutorials or source code, and to be honest i prefer that. An API is just a tool and graphics programming is more about the techniques and theory behind it…

    if you use the DX10 DSK, the tutorials and documentation that come with it are more than you would need especially if you have a basic grasp of the theory.

    Otherwise there is the Frank Luna book: Introduction to game programming with Directx10, but from all the reviews, its also a very basic beginner text.

  18. You failed to comment on her MANY spelling errors along with (most importantly) Inconsistent and faulty coding. I lost the cd, and realized without prior knowledge you CAN NOT run her second tutorial.

    • haha dude you think thats bad, her and the author of the other worst graphics book ever are joining forces to release a new DX11 book. I’m gonna buy it just to see how utterly atrocious it’s gonna be.

  19. A great book to try is 3D Game Design 2E by David Eberly or his newer version, you can visit his website http://www.geometrictools.com/ for more information. His book describes all the steps involved with most of the mathematics involved as well, he wrote his own API called WildMagic which can be run on various platforms and architectures, and you can use his API to work with either DirectX or OpenGL. Great Book!!!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s