# DX11 I need to learn DirectX. The examples for Introduction to 3D Programming with DirectX 11 by Frank D Luna does not work. Can anyone help me

## Recommended Posts

I have to learn DirectX for a course I am studying. This book https://www.amazon.co.uk/Introduction-3D-Game-Programming-Directx/dp/1936420228 I felt would be great for me to learn from.

The trouble is the examples which are all offered here http://www.d3dcoder.net/d3d11.htm . They do not work for me. This is a known issue as there is a link on the examples page saying how to fix it. I'm having difficulty with doing this though. This is the page with the solution http://www.d3dcoder.net/Data/Book4/d3d11Win10.htm.

The reason why this problem is happening, the book was released before Windows 10 was released. Now when the examples are run they need slight fixes in order for them to even work. I just can't get these examples working at all.

Would anyone be able to help me get the examples working please. I am running Windows 10 also just to make this clear, so this is why the examples are experiencing the not so desired behaviour. I just wish they would work straight away but there seems to be issues with the examples from this book mainly because of it trying to run from a Windows 10 OS.

On top of this, if anyone has any suggestions with how I can learn DirectX 11 i would be most grateful. Thanks very much. I really would like to get them examples working to though from the book I mentioned.

GameDevCoder.

PS - If anyone has noticed. I asked this about 1 year ago also but this was when I was dabbling in it. Now I am actually needing to produce some stuff with DirectX so I have to get my head round this now. I felt at the time that I sort of understood what was being written to me in response to my thread back then. I had always been a little unsure though of being absolutely sure of what was happening with these troublesome examples. So I am really just trying to get to the bottom of this now. If anyone can help me work these examples out so I can see them working then hopefully I can learn DirectX 11 from them.

*SOLUTION* - I was able to get the examples running thanks to the gamedev.net community. Great work guys. I'm so please now that I can learn from this book now I have the examples running.

Edited by GameDevCoder

##### Share on other sites

What's not working?

##### Share on other sites

Thanks for the reply. So, In order to getting these examples to work there needs to be some tweaks so they run normally again.

From stuff in a topic I made about the same thing last year actually as I was just looking into this (preparation work) just then but am now needing to actually use DirectX so am really trying to get these examples working fine now.

I have tried using some knowledge of which I acquired when I made a similar topic about a year ago now. Last night I was able to get working examples for chapter 1, 2, there isn't any for 3, chapter 4. One of the four examples in Chapter 6 I have working now to. If I can talk about an issue I'm having with one example for chapter 6.

Here is what is stopping me run the Box example for chapter 6 right now. https://ibb.co/mQbPvw

Prior to this like I have done similarly with the examples before to get them working for me:

-Clicking in properties I go on VC++ Directories and change the include and library directories to include $(DXSDK_DIR), or where a 'common' folder is located that all the examples rely on. - In Linker - Input. I remove d3dx11d.lib (in debug config), d3dx11.lib (in release), dxerr.lib (for both). - Lastly I right click on the project and add existing item - I select from common folder 'dxerr.h and dxerr.cpp. These steps allow for some examples to work. I'm having a problem with this box example though now and am not sure what to do. Lastly, in some cases I might reconfigure so the common folder can be found like in c/c++ property page include directory. In the end I just try many ways in the hope I can get the examples working, I was given some instructions in the past how to get them working although I wasn't so confident that they worked flawlessly (i mean, it worked for one example but I wasn't sure they would work for other examples) or that I understood properly how they worked. I hope this helps with explaining my predicament a bit more. Any help would be so very much appreciated from the community. Thank you. #### Share this post ##### Link to post ##### Share on other sites 15 hours ago, GameDevCoder said: On top of this, if anyone has any suggestions with how I can learn DirectX 11 i would be most grateful. I dont know anything about that book, but you can learn dx11 directly from MSDN and their dx11 samples work on windows 10 (I just checked them) Direct3D Tutorial Win32 Sample - https://code.msdn.microsoft.com/Direct3D-Tutorial-Win32-829979ef This is the classic tutorials 1-7 that take you from setting up a window to displaying a rotating textured cube. The download button is at the top of that page. The zip file contains: 1. description.html this has links for all 7 tutorial step by step descriptions. You should read all of these 2. A folder called c++ You can open this "Tutorials.sln" solution in visual studio (I use visual studio 2017), and let it update them all to the latest version of visual studio. Or you can open the projects in the folders which seems to also open all of them. The sample contains all 7 tutorials. Compile them. To run a particular sample (as the solution contains all), in the solution explorer of visual studio right click on the one you want eg "Tutorial07" and select "set as startup project". Then from the top menu select debug - start debugging. I just checked it and it does work on windows 10, with visual studio 2017 ******** After these 7 tutorials I recommend MSDN: Direct3D 11 Graphics - https://msdn.microsoft.com/en-us/library/windows/desktop/ff476080(v=vs.85).aspx Read each of those sections links HLSL - https://msdn.microsoft.com/en-us/library/windows/desktop/bb509561(v=vs.85).aspx Read each of those sections links Edited by CortexDragon #### Share this post ##### Link to post ##### Share on other sites I think you need to download and install the legacy june 2010 directx SDK, because the bewerkt SDK's dont include d3dx11, which is used in luna's book and examples. You can find it on github, might need to build the libs (debug and release) yourself. Which should be relatively easy with some googling (if you've never did this before). #### Share this post ##### Link to post ##### Share on other sites 16 minutes ago, cozzie said: I think you need to download and install the legacy june 2010 directx SDK, because the bewerkt SDK's dont include d3dx11, which is used in luna's book and examples. You can find it on github, might need to build the libs (debug and release) yourself. Which should be relatively easy with some googling (if you've never did this before). Hi. thank you. Yeah, I have installed the june 2010 directx sdk. I have had to do things with the debug and release also like removing some libraries that someone mentioned to me in the past. I appreciate your post. If anyone can see the issue I'm having at the moment with the BOX example that isn't working. If anyone knows how them errors can be fixed? It was in regards to this https://ibb.co/mQbPvw . Thanks forum. #### Share this post ##### Link to post ##### Share on other sites If you install and use the june 2010 SDK then you won't need to change anything. edit - code that is. Edited by Infinisearch #### Share this post ##### Link to post ##### Share on other sites 1 minute ago, Infinisearch said: If you install and use the june 2010 SDK then you won't need to change anything. Interesting. I am just working through these examples now as it goes. Will see how I get on. Thanks for these post. Food for thought. #### Share this post ##### Link to post ##### Share on other sites Ok. I have removed a couple errors and am just left with one issue for the BOX example in chapter 6. Does anyone know how I can fix this please? https://ibb.co/gstKvw I've no idea what to do about this problem. Edited by GameDevCoder #### Share this post ##### Link to post ##### Share on other sites Not overly familiar with DirectXMath, and it has been quite a while since I was digging through the Luna DX11 book, but it looks like you probably need to use the constructor for XMFLOAT4, rather than rely on an implicit conversion #### Share this post ##### Link to post ##### Share on other sites 7 hours ago, GameDevCoder said: Ok. I have removed a couple errors and am just left with one issue for the BOX example in chapter 6. Does anyone know how I can fix this please? https://ibb.co/gstKvw I've no idea what to do about this problem. Put the code back to its original state. It was not trying to use a pointer to a color. You can't use pointer as vertex data. #### Share this post ##### Link to post ##### Share on other sites 11 hours ago, Infinisearch said: Put the code back to its original state. It was not trying to use a pointer to a color. You can't use pointer as vertex data. Thanks for the post. I haven't altered the original code in anyway. I have only tinkered with the project settings/properties. Any chance you can elaborate on for me please? If you might know how I can solve this issue? Edited by GameDevCoder #### Share this post ##### Link to post ##### Share on other sites My mistake, I thought you had been messing around with the code and assumed. Follow what ericrrichards22 mentions. Basically this is to just manually stick some xmfloat4's in there with what ever values you find for RGBA whereever "Colors::" is defined. edit - you can also use Colors:: in the same way.... sorry I edited my post and made it confusing. Edited by Infinisearch #### Share this post ##### Link to post ##### Share on other sites 2 hours ago, Infinisearch said: My mistake, I thought you had been messing around with the code and assumed. Follow what ericrrichards22 mentions. Basically this is to just manually stick some xmfloat4's in there with what ever values you find for RGBA whereever "Colors::" is defined. edit - you can also use Colors:: in the same way.... sorry I edited my post and made it confusing. it's ok. Thanks for the post Infinsearch. I will be trying out some stuff with getting these examples to work over the weekend I plan too. Will see if I can get this BOX example working. #### Share this post ##### Link to post ##### Share on other sites BTW what version of Visual Studio are you using? #### Share this post ##### Link to post ##### Share on other sites 2015 i'm using #### Share this post ##### Link to post ##### Share on other sites I've been working on the example from scratch again. Have made developments but have this left to solve. Any ideas? #### Share this post ##### Link to post ##### Share on other sites 7 hours ago, GameDevCoder said: 2015 i'm using Then I take back what I said about not having to change anything. IIRC If you want to make things real easy just use VS2013 and the 2010 SDK. It will get you up and running with the demo's from the book... and once you feel comfortable with the basics you can either move past using the legacy libraries or use their replacements. On 11/9/2017 at 10:46 PM, ericrrichards22 said: Not overly familiar with DirectXMath, and it has been quite a while since I was digging through the Luna DX11 book, but it looks like you probably need to use the constructor for XMFLOAT4, rather than rely on an implicit conversion This really should work for you in your older version. You should try it. #### Share this post ##### Link to post ##### Share on other sites Before I carry on. I just want to say how I over came this issue https://ibb.co/gstKvw . Like people suggested it was regarding the constructor. So like this https://ibb.co/f0vXHb that part of the code is now working. It's just https://ibb.co/hG0gSb being my last hurdle now. I will download VS13 and give that a shot. Thanks for this suggestion. I totally agree with what you say to that if this goes well I can then become familiar with it all then later I can move onto using VS15 for DirectX when I have built up my confidence more from learning it. PS - it's a bit annoying to really as I was able to remove this error in one version of me trying to get the example to work. It has appeared again though this error and now I'm not sure how to remove it. I will start downloading VS13 also now. Edit - Finding it hard to download VS13. Where I should be able to get it, this page won't let me download it. Where I scroll down to the download I need something to load and it just isn't loading. It's like they aren't fussed with older content being viewed by anyone now. Edit 2- I can download the express version I think, I was trying to download the community version. I'll try the express version and see how it goes.... I think getting VS13 is going to be a struggle too. I've tried doing this and I'm just getting webpages thrown at me saying error and to get in touch with Microsoft. I had this pop up on my screen when I tried downloading VS13 express "We are sorry, but our system is detecting a problem with your account and we are unable to validate access to your subscription". Such a pain in the backside to get anything done :l . I just tried going on live chat with support but they only open Mon-Fri :(. I'll see if I can download VS13 still otherwise I'll have to try and get it working using VS15 that I am currently using. I've emailed the support team also now to see why I can't download VS13. Hopefully they show me a fix for this. Edited by GameDevCoder #### Share this post ##### Link to post ##### Share on other sites I know you want to stick with Luna but just so you know there are some tutorials here: Oh and why did you delete the older version you were working on? edit - BTW on the front page of d3dcoder.net is frank luna's email address. Edited by Infinisearch #### Share this post ##### Link to post ##### Share on other sites I have to pop out right now so can't reply properly. I will write a full response in a number of hours. May be sometime as am about to work a shift then it will be almost sleep time. Thanks for the post, I will reply later when I have the time to. #### Share this post ##### Link to post ##### Share on other sites Just so you know I took some time and tried this out myself on VS2013. It worked. This is what I did to setup the project to with the June 2010 SDK: Then I built the effects library in VS2013, on my computer it is found in C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Samples\C++\Effects11 edit - Section 6.8 in the book tells you to do this. After I compiled it in debug and release mode I copied (you might have to rename the files according to the section in the book titled effects) them to the common directory of the downloaded source file. I also copied the header file from the \inc subdirectory of the above directory to the common directory of the downloaded source file. eg something like - C:\book3dluna\DVD\Code\Common where the box project would be located in C:\book3dluna\DVD\Code\Chapter 6 Drawing in Direct3D\Box You should be able to compile from there, (I might have left out one step, but you should be able to figure it out) Good Luck. edit - VS2013 can be downloaded here: edit2 - I compiled a few other projects from that chapter and they all worked. Then I skipped ahead to Chapter 25 and that compiled and ran as well. So the above technique should work for all examples in the book. Edited by Infinisearch #### Share this post ##### Link to post ##### Share on other sites I just checked out your first thread on this topic... there was a solution in it and you said it worked. In fact its basically what I posted above. Why did you open a new thread? I kinda feel like I've been robbed of an hour or so of my life. #### Share this post ##### Link to post ##### Share on other sites Hi. Just got in from a shift. I have had a couple of private messages to which I will have to read after I write this. Thanks for your posts. Should help me greatly. I did mention stuff in my first few messages, sorry if you overlooked them but I did say. Also, the point I tried to make was that although I did have some help with this already in the past. I did not quite feel like I was equipped to have this work for all the examples. As I feel some examples can work by doing somethings. But other examples might need a little extra something being done too. As examples can be different to one another as you might expect. I was just after if anyone was kind enough to offer any assistance with me trying to get these examples working. I appreciate all the posts that this thread has received so far. I am sorry though Infinisearch if you feel like I have costed you some of your time. Apologese, I am just in such a bind with this. Just wishing these examples would work and as this topic shows. I am still having trouble getting them working. Hence me asking if anyone from gamedev.net would be able to offer any tips. I really do appreciate your last post. I will certainly be using it and following as much as I am able to, hopefully I can carry out every bit. It will be using VS15 as I cant download VS13 for some reason, that site is just not letting me saying something like I cant download it for some reason or another (an error message). I have sent the support team a query saying i want to download VS13 and how I can so I will see what they say too. Apparently they are only around Mon-Friday. Thanks for the post again. I shall follow what you carried out and see how it goes for me. Edited by GameDevCoder #### Share this post ##### Link to post ##### Share on other sites No need for an apology. It just that a solution appears to be in that thread since you yourself said it worked... why not just try that again? If you wanted to know exactly what it is that you were doing thats a different question. But anyway just so you know the Luna book's code builds on each previous chapter and seeing as how I tested the last chapter too, they all should work. In case that link goes dead I'll post whats in it here: Setting up a Visual Studio project to use the DirectX SDK Right click on the project and select properties. Choose the VC++ directories page under Configuration properties. Under the configuration dropdown select All Configurations. Add the following entries under their appropriate section. executable:$(DXSDK_DIR)Utilities\bin\x86
Include: $(DXSDK_DIR)Include Library:$(DXSDK_DIR)Lib\x86

edit - Oh and to get the Luna samples up and running on VS2015 using the DXSDK you need to follow the link I put in an above post about dxerr.lib... there's a file there you need to download and compile.

Edited by Infinisearch

## Create an account

Register a new account

• ### Similar Content

• Hi, can somebody please tell me in clear simple steps how to debug and step through an hlsl shader file?
I already did Debug > Start Graphics Debugging > then captured some frames from Visual Studio and
double clicked on the frame to open it, but no idea where to go from there.

I've been searching for hours and there's no information on this, not even on the Microsoft Website!
They say "open the  Graphics Pixel History window" but there is no such window!
Then they say, in the "Pipeline Stages choose Start Debugging"  but the Start Debugging option is nowhere to be found in the whole interface.
Also, how do I even open the hlsl file that I want to set a break point in from inside the Graphics Debugger?

All I want to do is set a break point in a specific hlsl file, step thru it, and see the data, but this is so unbelievably complicated

• I finally ported Rastertek's tutorial # 42 on soft shadows and blur shading. This tutorial has a ton of really useful effects and there's no working version anywhere online.
Unfortunately it just draws a black screen. Not sure what's causing it. I'm guessing the camera or ortho matrix transforms are wrong, light directions, or maybe texture resources not being properly initialized.  I didnt change any of the variables though, only upgraded all types and functions DirectX3DVector3 to XMFLOAT3, and used DirectXTK for texture loading. If anyone is willing to take a look at what might be causing the black screen, maybe something pops out to you, let me know, thanks.

Also, for reference, here's tutorial #40 which has normal shadows but no blur, which I also ported, and it works perfectly.

• By xhcao
Is Direct3D 11 an api function like glMemoryBarrier in OpenGL? For example, if binds a texture to compute shader, compute shader writes some values to texture, then dispatchCompute, after that, read texture content to CPU side. I know, In OpenGL, we could call glMemoryBarrier before reading to assure that texture all content has been updated by compute shader.
How to handle incoherent memory access in Direct3D 11? Thank you.
• By _Engine_
Atum engine is a newcomer in a row of game engines. Most game engines focus on render
techniques in features list. The main task of Atum is to deliver the best toolset; that’s why,
as I hope, Atum will be a good light weighted alternative to Unity for indie games. Atum already
has fully workable editor that has an ability to play test edited scene. All system code has
simple ideas behind them and focuses on easy to use functionality. That’s why code is minimized
as much as possible.
Currently the engine consists from:
- Scene Editor with ability to play test edited scene;
- Powerful system for binding properties into the editor;
- Render system based on DX11 but created as multi API; so, adding support of another GAPI
is planned;
- Controls system based on aliases;
- Font system based on stb_truetype.h;
- Support of PhysX 3.0, there are samples in repo that use physics;
- Network code which allows to create server/clinet; there is some code in repo which allows
to create a simple network game
I plan to use this engine in multiplayer game - so, I definitely will evolve the engine. Also
I plan to add support for mobile devices. And of course, the main focus is to create a toolset
that will ease games creation.
Link to repo on source code is - https://github.com/ENgineE777/Atum
Video of work process in track based editor can be at follow link:

• tldr: This is a community project to help aspiring solo game developers and designers, through small assignment projects, gain the knowledge and skills required to make a video game. If you are interested in contributing to the discussion, head to https://github.com/Neoflash1979/learn-gamedev/issues.
The problem with tutorials
With the number of great courses, tutorials and other learning resources found online, more and more people teach themselves programming. Many will do so with the intent of making video games. But there is much more to designing and making video games than mere programming.
Animation, anthropology, architecture, brainstorming, business, cinematography, communication, creative writing, economics, engineering, games, history, management, mathematics, music, psychology, public speaking, sound design, technical writing, visual arts AND programming; knowledge and skills in these areas can be invaluable to a game designer/developer. Thankfully, there is an abundance of resources available online that can help one acquire knowledge and skills in each of these areas individually. But for the aspiring solo dev, it’s not just a matter of acquiring knowledge in these areas, it’s also important to understand how to use all of that together, for the express purpose of making a video game.
There is a plethora of tutorials available online that will guide you from A to Z on how to make such or such a game. In the process you will acquire a certain amount of technical knowledge, and that’s great. But you won’t really learn about the process of designing and developing a video game. The same can be said about the numerous lists that tells you the type of games you should be making, and in what order, in order to learn gaming making; first you make a Breakout clone, then you make a Tetris clone, then you make a Mario clone, then you make Wolfenstein 3D clone, etc. Again, this kind of advice will help you progress in certain technical skills, but you won’t have learned all that much about the process of designing and developing a video game.
Making a video game is about making decisions. When you follow tutorials, or clone an existing game, the decisions are largely already made for you. To really learn to design and develop video games, you have to build them, from scratch, on your own (or with a friend or two). All aspiring game dev/designer realizes this at some point and so sets out to build their first game. Their REAL first game. One where THEY have to decide, design and build EVERYTHING. And that’s where everything goes to sh*t.
Making video games is hard
You see, making a video game is hard. I mean, REALLY making a game, from scratch. It is a daunting task and it can be overwhelming. So naturally, you turn to Google, and you learn expressions like “scope”, “minimum viable product”, “rapid prototyping”, “find the fun” and “start small”. All those two minutes videos and articles are very enlightening but in the end, it’s still very hard to understand how to keep a small scope when you have never REALLY made a game and you are invariably imbued with grand game-making aspirations. How small is small? What aspects of game making should I focus on? How many hours should I invest in making that first game? Those are just a few of the questions that an aspiring game dev/designer might have.
Despite all the great resources out there for learning all the bits and pieces involved in designing and making a game, there is a complete void in terms of helping aspiring dev learning to put it all together in a progressive, manageable, way. What we, aspiring self-taught devs, are missing is a guide. Something that will guide us, progressively, on our game making path. Something that will help us focus on the right things, at the right time, while we progress on our learning journey – “yeah, maybe you should leave researching the use of Octrees in collision avoidance AI for later and first focus on figuring out how to make that white ball go from point A to point B, Phil”.
What we really need are assignments, with deadlines and requirements. Oddly enough, if your Google “game making assignments” you will find a few examples of exactly what we need, but only for board games, or children Phys Ed games. Here is an example: http://www.cobblearning.net/kentblog/files/2015/11/Project-27w5me1.pdf
This is exactly what we need. Exercises that help us focus our creativity and give us a set of guidelines, requirements and constraints. Allowing us to make MOST or at least MANY of the creative and technical decisions that go into making a game, while at the same time ensuring that we keep the scope small and that we focus on a few new concepts/skills. Every assignment would, gradually, expose the learner to new and more advanced concepts/skills, expanding the scope a little, culminating in a final, 2 to 6-month-long assignment where the learner is really making a game he can be proud of and call his own. Alas, this resource does not exist. At least I have found it. So, let’s do something about it.
I propose that we create an open-source project on Github and create a “Game development and design self-education” curriculum. Basically, a list of game making assignments that would guide an aspiring game dev through the process of learning the required skills, methods and processes required to put a game together. The onus would be on the aspiring game dev to find the resources needed to learn the creative and technical skills required to meet each assignment’s requirements. If you are interested in contributing to the discussion, head to https://github.com/Neoflash1979/learn-gamedev/issues.

• 9
• 9
• 14
• 16
• 10