So I've made a separate .h for the graphics, which declares a TSceneGraph class, this class will be used to handle what we see, so far it's very simple, and in fact only supports one(!!) object, only supporting one object is of course a rather useless scene graph(if it should even be called a scene graph), but let's take simple steps.
Now, the TSceneGraph class is based on the code from the DX11 SDK tutorial 5, but split into functions in the class. Most of the functions are as they where, except that the object creation code has been taken of of InitDevice() and put into CreateObject(), and the vertex data is expected to be written where the CreateObject() function is called.
I ran into some trouble doing this, which is why there hasn't been an update for a while(also, I'm on an internship, so I'm rather busy).
Anyway, the first problem:
E_INVALIDARGand the application quit from
After finally making sure that the D3D11Device was created with the flag
D3D11_CREATE_DEVICE_DEBUG, I found that I was my buffer description bd containd some very strange flags, apparently, this was because I had not done
ZeroMemory(db). This leaves some strange random data in the fields of the buffer description that are not specifically defined.
I tried to create the objects as pointers to 3dObject structs containing a VertexBuffer and an IndexBuffer each.. This all got really confusing and I probably just didn't manage to access them in the correct way, leading to exceptions when trying to create the buffers. I realized that such a struct only contains pointers anyway, so there is not really any use of making them pointer variables.
So I just skipped the complicated stuff for now and made regular variables.
So after some time of trouble, I finally got it compiling again. Way!
BUT, it's all just a bit more modular and uses a "scene graph".
PS, since I'm away from home for a while I have to do this on a laptop, making development really tedious due the small screen(note the lack of plural).. sigh.