Skip to main content
GameDev.net gamedev.net
🔒 Locked

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

Started by GameDevCoder Nov 9, 2017 at 1:07 AM 33 replies 18.7k views
Original Post
GameDevCoder
GameDevCoder

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.

Look forward to reading any replies this thread receives.


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.

https://www.gamedev.net/forums/topic/693437-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/?do=findComment&comment=5363013

Syntac_
Syntac_

Need more information than "They do not work for me".

What's not working?

GameDevCoder
GameDevCoder

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.

CortexDragon
CortexDragon
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


cozzie
cozzie

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

Crealysm game & engine development: http://www.crealysm.com

Looking for a passionate, disciplined and structured producer? PM me
GameDevCoder
GameDevCoder
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.

Infinisearch
Infinisearch

If you install and use the june 2010 SDK then you won't need to change anything.

edit - code that is.

-potential energy is easily made kinetic-
GameDevCoder
GameDevCoder
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.

GameDevCoder
GameDevCoder

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.

ericrrichards22
ericrrichards22

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

https://msdn.microsoft.com/en-us/library/windows/desktop/ee419645(v=vs.85).aspx

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

-potential energy is easily made kinetic-
GameDevCoder
GameDevCoder


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?

Infinisearch
Infinisearch

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.

-potential energy is easily made kinetic-
GameDevCoder
GameDevCoder
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.

Infinisearch
Infinisearch

BTW what version of Visual Studio are you using?

-potential energy is easily made kinetic-
GameDevCoder
GameDevCoder

I've been working on the example from scratch again. Have made developments but have this left to solve. Any ideas?

https://ibb.co/hG0gSb

Infinisearch
Infinisearch
7 hours ago, GameDevCoder said:

2015 i'm using

Then I take back what I said about not having to change anything.

See here: https://blogs.msdn.microsoft.com/chuckw/2012/04/24/wheres-dxerr-lib/

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

https://msdn.microsoft.com/en-us/library/windows/desktop/ee419645(v=vs.85).aspx

This really should work for you in your older version. You should try it.

-potential energy is easily made kinetic-
GameDevCoder
GameDevCoder

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.

Infinisearch
Infinisearch

I know you want to stick with Luna but just so you know there are some tutorials here:

http://www.rastertek.com/tutdx11s2.html

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.

-potential energy is easily made kinetic-

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.