Showing posts with label tutorial links. Show all posts
Showing posts with label tutorial links. Show all posts

Saturday, February 18, 2012

Progress Report

I have no fancy pictures of any moving textured objects yet, but there has been some progress.

I've realized that the way the code is structured in the DX11SDK tutorials simply won't do even as a starting point for a game engine, for a few different reasons..
First off, the triangles shown are defined and put into a vertex buffer in the InitDevice() function, and while we could change the triangles in some other function later, this would get rather messy, since the same kinds of things would be done at different places. Also, after Tutorial 5 we draw out two objects, but we actually only have one, we transform it and draw it at two places, but it's only one object. This is kind of a problem.

So we need to add something that manages different objects, where they're at, how large they are, what triangles they contain, how they are drawn, and so on. I *think* this is what's called a Scene Graph. We want to do these things in a separate file from the main .cpp, because in the main .cpp we will want to focus on handling events in the game.

So I'm restructuring all the code(not much code, but hey), making a class called TSceneGraph in a different .cpp file, that will do all of the above. This also means moving all the DX11 initialization to this TSceneGraph.
Inside this class I can create a variable that decides what API to use, making it possible to chose if I want it to initialize an OpenGL window or a DX11 window, while keeping track of all the objects separately from the API.
Making this new structure is kind of hard for me and requires some thought, and also, since I'm note really used to C++ anymore, lots and lots of compiling errors. To brush up I read about header file and source file standard practice here, and about class definition here. Hopefully, I'll have a rudimentary scene graph working soon.

I also found how to chose which pages to include or not in the menu, so from now on any tutorials will have their own pages, instead of posts, linked from the Tutorials page in the menu above, and from a list to the right.

Monday, February 13, 2012

I Have Triangles!

I have Triangles!

Ok, so I said I would document the journey from the start, and I did mean it.
I've just got to rendering triangles, using DX11.


This may not look like much, but at least it means that I've gotten Visual C++ 2010 express to work, and compile. The code is actually just the tutorial02 from the DX11 SDK, but I took the important parts of that code and put it into a default win32 application project, which is why I also have a menu. And then of course I played around a bit with the vertices.

As stated in the first post the idea is to support OpenGL and older DX versions, but I will start with DX11.

Here's a link to the tutorial