# 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

Thanks very much Infinisearch. I know you have been inputting greatly on this thread I made so for this I am incredibly grateful. I shall work through the info I have here now and from what I've read. Things should work out for me. Can I ask. Just 1 other thing, might you know how I can fix this https://ibb.co/hG0gSb ? As it's the only thing stopping the BOX thing working for me.

##### Share on other sites

I've just been able to download VS13 now. I tried another web browser (edge). i think my chrome browser is showing some odd behaviour of late so this affected my ability to download VS13 before regrettably. So this will be nice to try getting the examples working too now using VS13 as I think that book was created with VS13 also. Just thought i'd share the kind of good news. Well, hopefully this makes things better for me :).

Edited by GameDevCoder

##### Share on other sites

The source from the book was made with VS2010.  BTW I found this: https://github.com/utilForever/DirectX

AS far as the errors in the picture goes, the first one should be included if d3dx is included.

edit - this has a more up to date version of effects11 than the above link: https://github.com/Microsoft/FX11/wiki/Effects-11

Edited by Infinisearch

##### Share on other sites
8 hours ago, GameDevCoder said:

8 hours ago, GameDevCoder said:

Well, hopefully this makes things better for me

So did you get things working?  Its been 8 hours, don't leave me hanging... I have a stake in getting you up and running.

##### Share on other sites

Sorry. I saw straight away when you posted (my phone i mean notified me that a post was made) but I was in a gaming sesh. Can I ask you have VS15 possibly?
VS13 or VS15 doesn't make too much difference maybe right? In order to getting it to work. I'm going to PM you something also now.

ps - i haven't got stuck in at the moment but tomorrow I will definitely be trying again. Not sure I'll be attempting it too much today. I aim to try a bit today but I'm not going to push myself like I have some evenings this week. It's just getting draining for myself. I will be 100% determined to try getting the BOX example working tomorrow though.

Edited by GameDevCoder

##### Share on other sites
1 hour ago, GameDevCoder said:

VS13 or VS15 doesn't make too much difference maybe right?

This makes all the difference in the world.  Trust me if you want simplicity just use VS2013 with the DXSDK.  It took me like 15minutes to get things working once I installed everything.

If you're gonna use VS2015 then follow the instructions on the page you linked in the OP.

Also you should download this: http://www.d3dcoder.net/Data/Book4/BlendDemo_win10_vs15.zip and see what changes were made to get it to work.

##### Share on other sites

Thanks InfiniSearch. That page gets me a bit lost though. I just get overwhelmed with what I need to do or just have no idea what is is I should be doing. As I don't think they give clear cut directions just guess work or vague directions. I'm not so confident with coding myself just yet. I'm a student also just to mention again if I hadn't done.

edit- re read your post and missed the 1st sentences. Wow, i will def try with VS13 then. thank you very much for saying. I hope I can get it working then. Will know tomorrow what I fall short on if I do that is. Won't be trying today now as is late for me.

edit2 - ive just been looking at that page again now that you linked about VS15 and windows 10. Which I knew of but haven't really followed for awhile as have just been trying to use stuff to get the examples working from posts by people from gamedev.net. I think I will have to give a go the stuff it says under the downloads section as I haven't attempted some of the things there. Like doing anything with the effect files etc. I will have an interesting day tomorrow.

For examples 1-6 that I have made work and am just sitting on this BOX example (example 6.1) before moving on. I have managed to get the examples working before this BOX one so I have been able to get them working without any changes to the effects files. I might be at the point now where I need to do something with the effects files.

Edited by GameDevCoder

##### Share on other sites

So, ...... I GOT THEM WORKING!!!!!!!!!!

edit - just wanted to say this. I will have to go to bed now but during the course of tomorrow i'll edit this post again and will write how I got them working so that this might help others in a similar position.

I know that over the course of 2 threads (One 12 months ago and this one made recently). There have been a number of people trying to help me get this working which I am very thankful to every person that offered help with trying to get this working for me.

I'd like to give two considerable mentions to community member Infinisearch who really helped me get this working. Over PM's that I started i'd like to say that from his guidance I have succeeded in getting the examples to work now. The other member Happy SDE who helped me in the past, a couple things from back then I used also which helped me get this working too. So was a culmination really.

I'll make a proper write up about the fix later today. I have to go to bed now.

Edited by GameDevCoder

##### Share on other sites

So this was how I got the Box example working. These actually works for the other examples for Introduction to 3d programming in directx 11 also so use this for other examples to that you wish to run.

Using Visual Studio 2013

1) Open the Box example. Right click on the project and click on properties. The screenshot will make this clear for you if not sure where this is. https://ibb.co/jfoKYG

2) At the top where it says configurations. Make sure that is set on 'All configurations'. Then click within configuration properties - VC++ Directories. You need to add some text into the exe directory, include directory and library directory. So select on each field one by one and paste inside of there, you can paste over anything that's already in there:

executable directory, paste in - $(DXSDK_DIR)Utilities\bin\x86;$(ExecutablePath)

include directory, paste in - $(DXSDK_DIR)Include; the location of your common folder for all these examples ;$(IncludePath)

libriary directory, paste in - $(DXSDK_DIR)Lib\x86; the location of your common folder for all these examples ;$(LibraryPath)

Then click 'apply' to keep all that has been entered.  Click 'ok' then play the project. It should now run.

In case the above fix does not work I have seen this myself where a tick box is not ticked for some reason so you should check they are ticked > In the Box example open properties for the Box project. In VC++ Directories where we were before. For each of the exe, incl and library directories click on the drop down and select edit. In this window you will see at the bottom a tick box with 'Inherit from parent or project defaults'. This should be ticked, so if the above steps aren't working check this is ticked for each of the three directories.

----------------

I created this guide from scratch as I was curious to see if a step had to be included which involves building an effects project and copy pasting files. I have seen now that many examples are working with the steps I have tried above only so maybe the effects procedure is not required (maybe its for the examples to work using VS15).

In case there is an example someone comes across that isn't working with the steps used above i'll include this other procedure (Only carry out these steps if the above does not work for you):

1) If you don't have download the directx sdk june 2010. https://www.microsoft.com/en-gb/download/details.aspx?id=6812 . You need to copy the effects11 folder found, on my computer it is in C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Samples\C++\Effects11. IMPORTANT, COPY THIS AND PASTE SOMEWHERE ELSE. You do not want to change anything from it's original location.

2) So now you have the Effects11 folder copy and pasted somewhere else on your computer, location doesn't matter really can be anywhere you want to place it. Inside this folder, open the Solution for Effects11_2010. You need to run this in debug and release mode, at the end of each run a message will appear saying 'unable to start program' but this is fine.

3)Then after this has been done there will be a debug and release folder appear in the Effects11 folder. In the debug folder find the Effects11 object library file and rename it to Effects11d. In the release folder now find the Effects11 object library file, this does not need renaming.

4)Now both of these files the Effects11d that was renamed and the Effects11 just seen both need to be copied. They should then be pasted into the Common folder that the books examples come with. This common folder allows for the examples to work, that common folder. So both debug and release effect files paste them into the common folder. Last of all in the Effects11 main folder open it one more time. Open 'Inc' folder, copy 'd3dx11effect' header file. Then paste this into the common folder now.

----------------

That's pretty much it. Thank you gamedev.net for helping me getting this working. The community have been an invaluable help. Every person that gave me input in a thread i made a year ago that i worked at for awhile then stopped to work on other stuff. To the people that have helped me in this recent thread I made as I am now needing to use DirectX for something i'm making. Every bit of info i received got me that bit closer to making this books examples to run for me. Such a hassle they don't just run straight away but with newer operating systems and software and when the examples were actually created. It's probably understandable/expected for the examples to need tweaks. I want to give a big thank you to community members Infinisearch and Happy SDE who's help on this matter helped me get this working. They had both given massive input into making this work for me. Thanks guys but you know this already as I PM'd this to you both ;).

Ok, this is a long enough post as it needs to be. Better cut this post short now. Thanks again gamedev.net for allowing me to learn directx from that book now, as i have the examples working.

edit - I have just realised that there are downloads for Source Code Set 2 and 3. I was only testing the examples from code set 1. I totally forgot that there were more examples. Only because i've been trying so long trying to get these first lot of examples running. Hopefully the other examples work fine but the examples for code set 1 definitely all run okay. I am going to see now what these other examples are like. I am keen to see what interesting things there are to see in these other code sets.

- The first example for code set 2 needs the effects11 procedure to occur before it can run fyi. I haven't tested anymore so far. The other examples are working fine (code set 2). I'm going to say that for code set 2, effects11 needs setting up.

- Tested near enough every example now, code set 3 including. They all run. from code set 2 the effects11 needs setting up then the examples are able to work.

Edited by GameDevCoder

## 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.