• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
dawoodr

DirectX

31 posts in this topic

Hello! My name is Dawood Rehman and I am 18 years old. I have been programming in C++ for an entire year. Now we are going to have a project in school which we get a whole year to complete so I thought of doing some thing in DirectX with 3D graphics.

Now, I know that there is a whole ocean to discover but everybody has to start somewhere right? However I was messing around a little bit with my Visual Studio 2013 Ultimate and I saw that you can make "DirectX App" and "Xaml DirectX App" and theese both were for windows store. Now first of all, what is the difference between theese two and do I really have to make the application for window store? I just want to make a normal windows desktop application.

For the ones that are wondering, I am focusing on making a FPS game, now remember, I am trying to make one, not complete one, making just a room with a single gun to fire with would be hell of an achievement because I know nothing really.

So now when all that is cleared, is there some kind soul out there to help me out on my way that knows something about DirectX programming?

 

I am willing to make a few 2D games before I jump into the 3D one but then it must be in C++/DirectX because that is what I am aiming for later on. I don´t have the time to learn another language.

 

Please write your ideas, any help or comment is appreciated!

Regards!

0

Share this post


Link to post
Share on other sites

Guys, I am not looking for any kind of solution, just ideas and some useful tips, that is all. Please feel free to comment, they are appreciated.

0

Share this post


Link to post
Share on other sites

It depends what you want to do.  I used to work for Microsoft at the time they were developing the framework for Windows 8 applications.  I wasn't on the team that handled Direct3D implementation, but I've been to talks by the head of those divisions.  

 

I believe XAML apps incur a performance overhead of managing the XAML framework.  But I could be wrong.  However, there is absolutely no performance overhead of creating a blank Direct3D application.  In either case, the code generated is intended for the Windows 8.1 store.

 

Creating a new application with the Direct3D (non-xaml) will give you the starter code for creating a simple rotating cube in the Windows 8.1 store, and the performance of this application will be identical to a desktop application. 

 

If you don't know much about Direct3D yet, it's easier to begin with a Windows 8.1 app because it will generate the initialization code and some very basic shaders for you.  If you would rather make a desktop application like most 3D games currently, it's very easy to convert the code in the Windows 8.1 app to run on desktop.  All of the Direct3D code is the same on desktop as it is for the windows store.  You can set up two separate projects in the same solution and point both projects to compile from the same source files.  The only code you will need to change is the code for initializing the program window.  You will also need a new winmain() function, I believe.

 

The Direct3D objects I believe are wrapped in smart pointers specific to C++/CX (Microsoft's extension to C++ intended for use with windows store components).  But you can delete these pointers and use the objects directly, and the code will still compile correctly to both windows store and windows desktop.  The only time you cannot avoid these pointers are for components specific to the windows store (such as the window object), but you will have to recreate these objects anyway to use them in windows desktop mode.

0

Share this post


Link to post
Share on other sites

So, you saw this stuff, right?

 

http://msdn.microsoft.com/en-US/library/windows/apps/ff476345  <- Programming Guide for Direct3D 11

http://code.msdn.microsoft.com/DirectX-3D-shooting-game-ed8e56f0  <- DirectX 3D Shooting game sample

 

 

As Vexal mentioned, Windows Store apps are going to be easier to start with than Win32.

 

You say you're 18?  Have you taken Trigonometry yet?  That stuff's 100% required if you want to do 3D. 

 

This book http://www.amazon.com/Math-Primer-Graphics-Development-Edition/dp/1568817231/ref=sr_1_1?ie=UTF8&qid=1401393014&sr=8-1&keywords=3d+math+primer is awesome if you do need some help.

 

You also mention you're using Visual Studio 2013 Ultimate.  I find it unlikely an 18 year old with 1 year of programming experience acquired it legally.  There's nothing in there you need that's not available in Visual Studio Express, so stop pirating!  Or at the very least don't announce it so blatantly.  <southern drawl>Folks 'round here don't take too kindly to the piratin' kind</southern drawl> so you're limiting the amount of help you might get by doing so.

2

Share this post


Link to post
Share on other sites

If you're a student in a university (maybe even highschools?), Microsoft will give you Visual Studio 2013 Professional for free.  It's not ultimate, but you're not really missing anything.  I think you can even use the profiler in Professional now.

0

Share this post


Link to post
Share on other sites

Hello and thanks for the answers!

 

Well, I have not a pirated version of Visual Studio, my school has made a deal with microsoft and we can download it for free from dreamspark, so I have not obtained the program illegally.

 

About the trigonometry part, yes I have worked with trigonometry.

 

Now, I am wondering, "vexal" sir, you said that you worked with microsoft, so I am wondering, do you have the time and patience to help me out on this one, the thing is that my teacher have no knowledge of this area so I am on my own literally, I would appreciate the help. I have created a simple window through win32 using a guide online but I wouldn´t say that I understand it all.

 

However, if I understand you correctly, you are saying that I can use DirectX library even in win32? I thought that you could only use it in DirectX App/DirectX App Xaml. And another thing that hit my mind was that you are all saying "direct3d" there is no such thing in Visual Studio 2013 Ultimate atleast. Only DirectX App/DirectX App Xaml exist, perhaps it´s the same thing?

 

Regards!

Edited by dawoodr
0

Share this post


Link to post
Share on other sites

Well there's not a template for a Win32 window with a Direct3D context, no.  You need to create a new Win32 project, link the directx libraries, include the headers, then create a Win32 window (the Win32 template may have done this for you if you ticked the checkbox) and initialize Direct3D (create a device, swap chain, render target view etc...).

 

Tutorials here: http://code.msdn.microsoft.com/windowsdesktop/Direct3D-Tutorial-Win32-829979ef (If you're going the Win32 route, this is what you want.  Otherwise see my previous link for the Windows Store DirectX tutorials)

Good book here: http://www.amazon.com/Introduction-3D-Game-Programming-DirectX/dp/1936420228/ref=sr_1_1?ie=UTF8&qid=1401414711&sr=8-1&keywords=beginning+game+programming+with+directx

 

Regarding DirectXApp, DirectXApp XAML vs Win32, the DirectXApp Windows Store template create a Windows Store app and fills in the aforementioned boilerplate for you.  If you create an empty Windows Store app then link the libraries, include the headers, then create a window (IFrameworkView implementation),  create a d3ddevice etc.... you'd end up in the same place.  So you never *need* templates, they're just shortcuts.

 

As for the difference between the regular DirectXApp and the XAML one, the XAML one layers a GUI on top of the Direct3D content, which you can graphically edit in a designer and hook up to your app with event handlers etc...  The normal template figures you're going to draw the GUI yourself, or hook up another, third-party GUI system.

 

Also, if going the Windows Store route (which I do recommend for starting) definitely check out Visual Studio 3D Starter kit.  It even includes a content pipeline and shader designer.  Great for learning & experimentation.

Edited by xenobrain
2

Share this post


Link to post
Share on other sites

Thanks alot for the replay "xenobrain", it helped to clearify some things. However, could you be more specific about how to do this --> "(the Win32 template may have done this for you if you ticked the checkbox) and initialize Direct3D (create a device, swap chain, render target view etc...)."

 

I was also wondering, if I start with DirectX App and then eventually wanted to change to a win32 application, could I just copypaste the code after I had included the libraries in the win32 project? Except that I have to make a Winmain() function and so on to get a windows running instead of the commant prompt?

 

And btw, about making a simple 2D game before I jump into a 3D one would be a good idea I think aswell, I have heard alot about pong being good for starters. Now I wonder, can it be made with C++ using DirectX libraries?

 

More posts and ideas are welcome.

 

Regards!

Edited by dawoodr
0

Share this post


Link to post
Share on other sites

ya the answer to all of your questions is yes. Now it's time to write some code.

0

Share this post


Link to post
Share on other sites

ya the answer to all of your questions is yes. Now it's time to write some code.

It is a bit hard when you don´t have any clue on how to start. I am having some difficulties to include the libraries into my win32 application. If anybody is able to help me out I would be very greatful.

0

Share this post


Link to post
Share on other sites

I did some research on my own and find out that if you have windows 8.1 and visual studio 2013 the sdks are already installed, however they removed D3DX or something like that from the sdk packet or whatever.

 

All this is so frustrating, All I would like to do for now is to make a "Hello World" program with DirectX, perhaps a cube that says hello world or something like that, but I can´t even do that...

0

Share this post


Link to post
Share on other sites

You are correct.  D3DX is now removed.  However, you should have everything you need in the DirectXMath header, and that can be used on desktop and win8.  For things like loading textures, you can use the code from DirectXTex.

 

If you have a specific question about a feature in D3DX that you are unsure of the modern equivalent of, post it here and I might be able to tell you.

0

Share this post


Link to post
Share on other sites

Thanks alot for the answer Vexal, for now I know nothing about DirectX programming, I would really appreciate if someone could show me to make a simple program in DirectX. An example would be like a "hello world" program in win32 application, although I do understand that it won´t be that simple, but I still would appreciate if somebody could guide me through my first program.

 

I have nobody to show me this really.

 

Regards!

0

Share this post


Link to post
Share on other sites

I strongly you suggest using the windows 8 directx app (non-xaml) template.  Once you figure out how the majority of that program works, you can work on porting it to win32 (not difficult once you understand directx).  You're not wasting time adding functionality to the windows 8 version because almost all code will compile for both platforms.

 

The template should create a rotating 3d cube and some basic shaders for you.

0

Share this post


Link to post
Share on other sites

I will take your advice Vexal and start out with a DirectX App, but I have a question. Where am I suposed to learn DirectX programming? It is very easy for like html and C++ and other languages because everything you need is out on the web. But how am I suposed to learn programming with DirectX as a complete beginner?

 

I can´t find anything out there that is similar to a "hello world" program in c++ for an example. The reason I am bringing up the hello world program over and over is because it´s the most simple program you can do in c++ and I want something similar to that using DirectX, however ofcourse I understand that it still won't be that simple.

Edited by dawoodr
0

Share this post


Link to post
Share on other sites

Sadly 3D graphics is a huge topic and things change so quickly that's hard to keep up.

IMO the best way is the proper way: buy a book and read it. I don't think it's a subject that can be understood with internet tutorials.

Try to find the most recent book on DX11 (or OpenGL) on amazon and study it.

 

The DirectX App wizard is your "hello world" for DX, it doesn't get any simpler than that.

Also make sure your knowledge of C++ and basic operations in Visual Studio is up to the challenge... if you have problems linking and compiling with libraries it means your level of C++ is simply not high enough to adventure into 3D graphics.

Edited by kunos
1

Share this post


Link to post
Share on other sites

Sadly 3D graphics is a huge topic and things change so quickly that's hard to keep up.

IMO the best way is the proper way: buy a book and read it. I don't think it's a subject that can be understood with internet tutorials.

Try to find the most recent book on DX11 (or OpenGL) on amazon and study it.

 

The DirectX App wizard is your "hello world" for DX, it doesn't get any simpler than that.

Also make sure your knowledge of C++ and basic operations in Visual Studio is up to the challenge... if you have problems linking and compiling with libraries it means your level of C++ is simply not high enough to adventure into 3D graphics.

Well, I wouldn't say that my programming skills are good, I do not believe so. The best thing I have done with C++ so far is to make a 2D game using windows forms, however windows forms have been excluded from visual studio 2013 because windows forms sucks when you are working with C++.

 

And I was wondering, do you have any recommendations on the latest arrival books out there targeting DirectX? It is like you said, things change so quickly that you have to get the latest teaching aids.

0

Share this post


Link to post
Share on other sites

sadly I am too old to know about new beginner friendly books... but I have a feeling that the best book to learn about 3D remains the OpenGL Programming Guide (aka the "Red Book").. that was the book that made me go "aha!" years ago. Of course now it has been updated to more modern OpenGL.

But I think you can get all the info you need by reading the reviews on amazon.

0

Share this post


Link to post
Share on other sites

step 1: chose a directx version to work with: 9, 10, 11, etc.

 

step 2: google for online tutorials, such as twokings

 

step 3. do the 4 or so basic tutorial programs that get you a window, fullscreen graphics, flat shading, and then texture mapping of a triangle.

 

you'll be able to get lots of help on specific questions by posting in the diretcx and xna forum.

 

the location of the directx header and lib files will vary, depending on version chosen: the sdk in which its included, what files are required, and where they're installed.

 

choosing dx 10 or newer will also require the use of shaders. choosing dx9 will allow use of the old fixed function pipeline without shaders.

0

Share this post


Link to post
Share on other sites

This is the site that I used to initially learn the basics of DirectX.  It's a bit outdated (last I used it was 2006 or 2007, not sure if it's been updated recently -- it says it has tutorials for DirectX 11 and Windows 8, but I don't know how quality they are), but if you want to start completely from scratch with DirectX, this site is the one to use.

 

http://www.directxtutorial.com/

 

What's great about this tutorial site is the writer starts completely from scratch and explains how the components of a DirectX program fit together -- it's easier to follow than most official Microsoft documentation, because Microsoft's documentation documents each component separately, and doesn't really say how to fit them together to write a full program.

 

Before learning DirectX, I did use the OpenGL Redbook -- I bought the 2006 or 2007 edition.  It steered me in the wrong direction completely.  It had a section on shaders, but it didn't try hard enough to convince me that the programmable pipeline (things like GLVertex, GLBegin) was obsolete, even in 2006.  I wasted a lot of time working with the programmable pipeline until I finally learned shaders a couple years later.  I haven't looked at any of the new versions of the RedBook, so I can't tell you if they're better.

 

As for the online version (the free one) of the redbook, it's useless now.  It's interesting to read to see how OpenGL started out, but it's from 1996 or something and shaders didn't exist then.

0

Share this post


Link to post
Share on other sites

Well I am back with a new question now again, I didn't want to make a new thread because it is related to this one anyway.

 

My question is, in which particular version of visual studio did the <xnamath.h> work? I am reading Frank D. Luna's book about directx programming and in the book they are using the xnamath library which I can't do in microsoft visual studio 2013/2012. I tried to install VS2010 but it is not compatible with windows 8.

 

It is a pain in the as* that microsoft keeps removing/add stuff and changing old things so they don't work anymore, which makes the learning proccess much harder than it should be.

 

 

What should I do now? Any suggestions?

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0