Motoky12

Members
  • Content count

    21
  • Joined

  • Last visited

Community Reputation

109 Neutral

About Motoky12

  • Rank
    Member
  1. Online CS Degree and other decisions

    Cheers for the link. I don't feel as worried, I always try to discuss things with my Dad about these kinds of things and getting a lot of opinions and researching helps me a lot.   I get worried way to much, I'm only 20 and I think way to far into the future. Like University, I haven't even done any college courses yet and already thinking about Uni, job, pension, etc.   I will definitely do my A-Levels Maths course, do another course after that. If I get the grades I want, I know I have the option to go for a university degree, but will still find the stuff I did from a college course useful and help me in the future.     I have been learning for a couple of years now, so I know I can do stuff on my own and have learnt quite a lot, not just from books, but from sites and just researching as much as I can.
  2. Online CS Degree and other decisions

    Has anyone else got anything to add??
  3. Online CS Degree and other decisions

    Well I don't tend to just read through my books, I have specified times of studying, write stuff down, do the exercises or go through the examples. Find questions on the internet about certain chapters and try and answer them.   Like my Algebra book, I have one for actually learning the material and another one which is a workbook with questions for the chapter from the previous book. When I finish a chapter in the first book I do the chapter associated with that chapter to make sure I know how to solve the problems without needing to look at the examples or answers.     Like I said before, it's mainly a safety net, university is quite expensive, but if I have to go then that's what I will have to do. What do you think of the material in this course:   www.cs.bham.ac.uk/admissions/undergraduate/cs.php   This isn't an online course.   I still feel it's daft having to pay this amount for each year...
  4. Online CS Degree and other decisions

    Well this is just for a safety net, I plan on going indie.   I already have several game ideas which I am adding and changing often. I do need to start drawing stuff out though (even though I can't draw)   I was planning on starting the A Level Maths in January, this is from an open college so I would learn the course content at home and go to an exam center to take each exam when I feel I am ready. It has an 18 month limit, but can be completed earlier depending on how much effort you put in.   I still have a couple of years before I decide on whether I choose an online CS degree or go on campus, so by then there might be more options compared to now and they could be better or could be worse. Otherwise, I still have the option of going to the University of Birmingham which isn't too far, should save me on paying for an Accommodation >.<     Anyway, is it still possible to learn the content you mentioned like data structures, algorithms, etc. from books?
  5. I have been reading a lot of threads in this category for months now. It's nice to see what other people are doing and how they it could be different to what I am doing.   I'm currently 20 and live in the UK. I will give you a little about my past few years and decisions I have made up until now.   I left high school at 16, went to College and took a level 3 BTEC course. The course was terrible and I wasn't learning anything which made it really boring. It's a none exam course, it's all coursework, and at the time I had no enthusiasm to much in the lectures because we would go in and just do coursework while the lecturer sat there for 2 hours or more saying nothing at all. Now I don't see how that is learning. So I left become Decemeber and was doing crappy little courses online, researching as much as I could, learning about different things and spent the year doing dossing.   I stumbled upon GameInstitute and it was pretty good to begin with. I moved from C++ to DirectX and then I found it really hard and didn't understand much of it. The tutors stopped replying to my messages, so I wasn't getting any feedback on what I was doing. I wasn't really putting in enough hours while doing this and didn't see how important it is to learn as much as I could.   I got serious at like 18 and a half. I started learning about ActionScript because at the time I thought I could get into making Flash games, get some games on Kongregate and make some money. Well at the time I don't think ActionScript was for me. It just felt different, but there will be a time where I will have to learn about different languages like ActionScript, Java, maybe Python, Lua, etc.   I bought a book on Maths and Physics for Video Games because I felt I needed to know how it worked and was quite important in video games. Now I didn't understand much of that book because it also included Algebra, and I haven't dont basic algebra since high school. So I put that book on hold, bought an Algebra book and a Linear Algebra book to help with the previous book. I'm also done with the Algebra book, been working on it for 10 months now, but this was along with learning from a DirectX.   So, onto the DirectX book, got Beginning DirectX 9 by Wendy Jones and I found to be a great book and helped me a hell of a lot compared to the earlier book I used. I know a lot more about it now than I did before, but there will always be some things I won't know completely, which is why it's best to go through it a couple of times before putting the book away lol. I've written some programs based on the books examples, but tried my best not to look at the code whilst writing it. I'm currently working on the last project in the book.   I'm not the kind of person who can just think of a problem to solve and write a program for it. So the way I've been learning is by reading through the examples, making sure I know exactly what each part does and how each class works with other classes. I write like bullet points on each function or class in a word document, very vague description as to not give to much away and try my best to write a program from it. I do get errors and do manage to resolve them. The programs usually are up and running without any problems after that. I know the best way to learn programming is to program, but I've not come across anything that would require me to write a program... Sadly...     So I've been learning from books, checking these forums, and I have actually been writing code and not just reading through stuff completing ignoring my compiler lol.   My plan was to try out Indie development and actually make a living off of it, if I'm any good, but I would like to have a safety net just incase that doesn't work out for me. Because I don't have any qualifications from College, I'm unable to go to University until I do. I actually find it easier to learn at home, in my time, it's comfortable, it's relaxing and I don't have to worry about other students, spending money on transport or giving up my job. I found an A level Mathematics course online which offers UCAS points when you complete the course which is what is required to get into uni over here, along with a ton of money... I've heard A level Maths isn't easy, but I couldn't find anything else online that was any good, I know maths is important and I actually enjoy maths, so I've just got to put in the extra effort to learn as much as I can and pass the exams.   I would also have to take on another course to get the rest of the points, and if I do manage to get enough points, I was thinking of taking an online Computer Science course by the University of Hertfordshire. It does offer a Bachelors of Science with Honours in Computer Science if I pass at the end. I will post the link for this course and you can check the course material:   http://www.herts.ac.uk/more/uh-online-distance-learning/online-courses/computer-science-online-degree-bsc-hons.cfm   It doesn't have as much content compared to actually going to a campus, but it's cheaper and it could still offer me a safety net for the future.     So I just wanted people's opinions and want to know if other people are in my position and are doing alright or have already been in my position and maybe not doing so good.
  6. Memory Leak?

    Ok, I've just tried your code Codarki, but I am getting a different Debug Assertion, but on line 1169. It says: Expression: vector erase iterator out of range. The only way I could fix this is by getting rid of "+ emitterNum" in the first call to erase, but that would result in me not erasing the second emitter. Also, I'm not too sure what I am meant to pass through when I call the second function. Anyway, wouldn't it be easier to just call the clear function to clear all of the elements in the vector? I tried it and I'm not getting the debug assertion.
  7. Memory Leak?

    It's what was provided on the CD, so if you're saying it's wrong, I don't have a clue what the person was thinking when writing up the code. It's just confusing me now. I've been trying to sort this code out for a while now and finally managed to get it running, but with this stupid debug assertion thing. I'm not sure how these two functions work properly. I know that the first function is called twice with an index of 0 and 1 which indicates which emitters are to be erased. There are only two emitters, so the size would only two? The first function calls the second function and loops through the elements of the two created emitters and erases them. That's my take on it, I'm not too sure though. The book doesn't even mention these functions at all and there weren't any comments provided with the CD, so I was pretty much left in the dark on this one...
  8. Memory Leak?

    I decided to change some of the names so I know which functions I am calling. Like I said, I've not had a good book explain how to use std::vector and all of it's library. I also find the documentation to be useless without knowing how it works properly. I will post the original code from the CD: [CODE] void particleManager::removeEmitter(int emitterNum) { removeEmitter(emitters[emitterNum]); } void particleManager::removeEmitter(Emitter *which) { emitters.erase(&which); std::vector <Emitter*>::iterator Iter; for ( Iter = emitters.begin( ) ; Iter != emitters.end( ) ; Iter++ ) { if (*Iter == which) { emitters.erase(Iter); break; } } } [/CODE]
  9. Memory Leak?

    Never mind, I've managed to fix it. I found a site that mentions using push_back to add a new element to the end of the vector. Unless this is the wrong way of doing. I've put: emitter.push_back(which); where the comment was, so the erase isn't there anymore. I'm just wondering, because I am adding a new element at the end, the memory isn't actually deleted...
  10. Hey, I am currently working through Beginning DirectX 9 by Wendy Jones. I am currently on a chapter which shows you how to create a particle system. I think I am getting to grips with it, but at the moment, I am trying to practice writing the code from notes. I've got the code to run, with a few errors which I've managed to fix. The part which is bugging me at the moment is when I debug the code and the program runs, the particles spray into which ever direction and when I close the window, a dialog box appears which says: [quote] Debug Assertion Failed! Program: ... [insert directory path] File:c:\program files (x86)\microsoft visual studio 10.0\vc\include\vector Line 932 Expression: vector subscript out of range [/quote] Now when I had a look at the code that came on the CD, there was a part of the code which was trying to erase an object pointer of the Emitter class, but using the standard vector library. Now, I am guessing you can't call std::vector functions and erase the elements if it isn't of type std::vector. Here is the code that is trying to remove the emitters: [CODE] void ParticleManager::removeEmitter(int emitterNum) { iterateEmitter(emitter[emitterNum]); } void ParticleManager::iterateEmitter(Emitter* which) { // emitter.erase(&which); std::vector <Emitter*>::iterator Iter; for(Iter = emitter.begin(); Iter != emitter.end(); Iter++) { if(*Iter != which) { emitter.erase(Iter); break; } } } [/CODE] The emitter object is of type std::vector. It's the part of the code that's commented. If I use that which was in the provided code, will have a red mark underneath the dot and the last bracket. I am just stuck at what to do, I don't think I have found a good book that really explains how the std::vector works, so this is most likely why I have run into problems like this because I've not learnt it in detail...
  11. Stupid amount of Error Messages...

    I managed to sort my code out, not too sure why, but I was looking up error C4430 on MSDN and it showed some code which declared a class object, but wasn't of type int. It showed that same class object, but was declared as an int datatype. I tried this with my Direct3D Object and Device, I knew this wasn't going to make my code work because I was calling function under the Direct3D9 Library with those Direct3D objects. So I changed them back to Direct3D objects and devices and all of those weird errors dissappeared. The only errors I was getting was a linker error which was to do with the timeGetTime function call, so I had to include the Windows Header File and the Winmm Library File in the Properties Page. I think I had a couple of other errors to do with function calls, but I sorted them out. Executed my program and it started working. I had to change a few things in my custom vertex structure object, I plotted some points wrongly which came out with a rotating mess on the screen. I was also using a Triangle List and not a Triangle Strip in my DrawPrimitive function call. I also wasn't able to call that same function within a for loop, not sure why, I tried many different approaches, but it wasn't showing my cube properly. The only problem I am having now is that my cube is just black, whereas the cube in the example code is white, but the edges are different colors. I know I am only using one color at the moment and that's blue, but the whole cube is black including the faces. EDIT: Ok, I managed to get it all sorted now. I was doing the exercises through my book and noticed I hadn't called the D3DXMatrixIdentity function, I actually couldn't remember what this function did, I looked it up and I was pretty sure that wasn't it as this would have nothing to do with setting colors to my object. I then spotted something in the example code which called the SetRenderState function three times, one for the Ambient Light, one for the Fill Mode and the other for the Lighting. I then knew that is what was causing the problem with my code, I hadn't set any lighting in the program or specified how to fill in my object so it was set to black by default. Put the function calls in and it works lol. I do appreciate all the help people have offered, but I somehow fixed all the problems without really knowing 100% how to do it, but tried a few things about just in case and it seemed to work. So hopefully if this same error appears in the future, I will know what to do lol.
  12. Stupid amount of Error Messages...

    I followed your instructions, but going through the Properties Page dialog box. I typed in the directory file path and pressed OK. I compiled and it is still showing the same errors.
  13. Stupid amount of Error Messages...

    I'm trying to look through the code. I've looked at the preprocessor directives and I really can't see what the problem is. I have tried looking at this exact code, but in a different project that runs without any problems at all and the only difference is that I am not using the D3DX Library with a few less functions and data members declared. They are pretty much the same header file. I've not exactly learnt what all of the preprocessor directives do, but I made a little effort to find out what the #ifndef, #define and #endif do when using them in a Header File. The #ifndef if I am correct checks to see if the identifier has been defined, if it hasn't then I use the #define directive to define that identifier which is DXMANAGER_H. I then end this so called #ifndef loop with the #endif directive. I don't have that much knowledge on the preprocessor directives, the books I am using don't go into much depth about it so I don't know the full use of them. EDIT: Hey Steve, I tried followed your instructions, but as soon as I get to the 2nd step and click on VC++ Directories, nothing comes up except for: "VC++ Directories editing in Tools > Options has been deprecated. VC++ Directories are now available as a user property sheet that is added by default to all projects. Please click '?' for more information." If I do press on the '?', the MDSN site comes up.
  14. Stupid amount of Error Messages...

    Yes I am using VS2010. I have been using it for like 2 years now and haven't come across any errors like this. Also, how do I check if I have set up my include paths correctly??
  15. Hey, I am currently working through Beginning DirectX 9 by Wendy Jones. I am on Chapter 5 and I am currently practising writing up the code without looking at the code itself, but following my own step by step guide on how to write the code without giving too much away. It seems to be helping quite a lot and I have written this code which draws a cube to the screen, translates it and then rotates around the Y axis. It's already in the examples that came with the book, but I feel it is good practice to write up the code without looking at it at all. Anyway, I've been having trouble actually executing this code. I started to get these errors: [code]1>------ Build started: Project: Cubes, Configuration: Debug Win32 ------ 1> winmain.cpp 1>c1xx : fatal error C1083: Cannot open source file: '..\..\..\..\Part II - It's A 3D World After All\Chapter 5 - Matrices, Transforms, and Rotations\Notes\Cubes\winmain.cpp': No such file or directory 1> dxManager.cpp 1>c1xx : fatal error C1083: Cannot open source file: '..\..\..\..\Part II - It's A 3D World After All\Chapter 5 - Matrices, Transforms, and Rotations\Notes\Cubes\dxManager.cpp': No such file or directory 1> Generating Code... ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== [/code] I couldn't find much on the internet, so I thought maybe I had to put the code in another place because the file directory was getting too long. So I created another project, and decided to copy and paste my code to this new project. Changing the properties such as Character Set and including the appropriate library files. I try and compile it and I get these errors: [code]1>------ Build started: Project: Cube, Configuration: Debug Win32 ------ 1> winmain.cpp 1>c:\users\jamie\desktop\cube\dxmanager.h(26): error C2146: syntax error : missing ';' before identifier 'pD3D' 1>c:\users\jamie\desktop\cube\dxmanager.h(26): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>c:\users\jamie\desktop\cube\dxmanager.h(26): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>c:\users\jamie\desktop\cube\dxmanager.h(27): error C2146: syntax error : missing ';' before identifier 'pD3DDevice' 1>c:\users\jamie\desktop\cube\dxmanager.h(27): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>c:\users\jamie\desktop\cube\dxmanager.h(27): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1> dxManager.cpp 1>c:\users\jamie\desktop\cube\dxmanager.h(26): error C2146: syntax error : missing ';' before identifier 'pD3D' 1>c:\users\jamie\desktop\cube\dxmanager.h(26): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>c:\users\jamie\desktop\cube\dxmanager.h(26): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>c:\users\jamie\desktop\cube\dxmanager.h(27): error C2146: syntax error : missing ';' before identifier 'pD3DDevice' 1>c:\users\jamie\desktop\cube\dxmanager.h(27): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>c:\users\jamie\desktop\cube\dxmanager.h(27): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>c:\users\jamie\desktop\cube\dxmanager.cpp(7): error C2065: 'pD3D' : undeclared identifier 1>c:\users\jamie\desktop\cube\dxmanager.cpp(8): error C2065: 'pD3DDevice' : undeclared identifier 1>c:\users\jamie\desktop\cube\dxmanager.cpp(18): error C2065: 'pD3D' : undeclared identifier 1>c:\users\jamie\desktop\cube\dxmanager.cpp(20): error C2065: 'pD3D' : undeclared identifier 1>c:\users\jamie\desktop\cube\dxmanager.cpp(20): error C2227: left of '->Release' must point to class/struct/union/generic type 1> type is ''unknown-type'' 1>c:\users\jamie\desktop\cube\dxmanager.cpp(21): error C2065: 'pD3D' : undeclared identifier 1>c:\users\jamie\desktop\cube\dxmanager.cpp(24): error C2065: 'pD3DDevice' : undeclared identifier 1>c:\users\jamie\desktop\cube\dxmanager.cpp(26): error C2065: 'pD3DDevice' : undeclared identifier 1>c:\users\jamie\desktop\cube\dxmanager.cpp(26): error C2227: left of '->Release' must point to class/struct/union/generic type 1> type is ''unknown-type'' 1>c:\users\jamie\desktop\cube\dxmanager.cpp(27): error C2065: 'pD3DDevice' : undeclared identifier 1>c:\users\jamie\desktop\cube\dxmanager.cpp(42): error C2065: 'pD3DDevice' : undeclared identifier 1>c:\users\jamie\desktop\cube\dxmanager.cpp(45): error C2065: 'pD3DDevice' : undeclared identifier 1>c:\users\jamie\desktop\cube\dxmanager.cpp(45): error C2227: left of '->Clear' must point to class/struct/union/generic type 1> type is ''unknown-type'' 1>c:\users\jamie\desktop\cube\dxmanager.cpp(51): error C2065: 'pD3DDevice' : undeclared identifier 1>c:\users\jamie\desktop\cube\dxmanager.cpp(51): error C2227: left of '->Present' must point to class/struct/union/generic type 1> type is ''unknown-type'' 1>c:\users\jamie\desktop\cube\dxmanager.cpp(56): error C2065: 'pD3D' : undeclared identifier 1>c:\users\jamie\desktop\cube\dxmanager.cpp(73): error C2065: 'pD3D' : undeclared identifier 1>c:\users\jamie\desktop\cube\dxmanager.cpp(73): error C2227: left of '->CreateDevice' must point to class/struct/union/generic type 1> type is ''unknown-type'' 1>c:\users\jamie\desktop\cube\dxmanager.cpp(75): error C2065: 'pD3DDevice' : undeclared identifier 1>c:\users\jamie\desktop\cube\dxmanager.cpp(124): error C2065: 'pD3DDevice' : undeclared identifier 1>c:\users\jamie\desktop\cube\dxmanager.cpp(124): error C2227: left of '->CreateVertexBuffer' must point to class/struct/union/generic type 1> type is ''unknown-type'' 1>c:\users\jamie\desktop\cube\dxmanager.cpp(154): error C2065: 'pD3DDevice' : undeclared identifier 1>c:\users\jamie\desktop\cube\dxmanager.cpp(154): error C2227: left of '->SetTransform' must point to class/struct/union/generic type 1> type is ''unknown-type'' 1>c:\users\jamie\desktop\cube\dxmanager.cpp(170): error C2065: 'pD3DDevice' : undeclared identifier 1>c:\users\jamie\desktop\cube\dxmanager.cpp(170): error C2227: left of '->SetTransform' must point to class/struct/union/generic type 1> type is ''unknown-type'' 1>c:\users\jamie\desktop\cube\dxmanager.cpp(177): error C2065: 'pD3DDevice' : undeclared identifier 1>c:\users\jamie\desktop\cube\dxmanager.cpp(177): error C2227: left of '->BeginScene' must point to class/struct/union/generic type 1> type is ''unknown-type'' 1>c:\users\jamie\desktop\cube\dxmanager.cpp(179): error C2065: 'pD3DDevice' : undeclared identifier 1>c:\users\jamie\desktop\cube\dxmanager.cpp(179): error C2227: left of '->SetStreamSource' must point to class/struct/union/generic type 1> type is ''unknown-type'' 1>c:\users\jamie\desktop\cube\dxmanager.cpp(181): error C2065: 'pD3DDevice' : undeclared identifier 1>c:\users\jamie\desktop\cube\dxmanager.cpp(181): error C2227: left of '->SetFVF' must point to class/struct/union/generic type 1> type is ''unknown-type'' 1>c:\users\jamie\desktop\cube\dxmanager.cpp(189): error C2065: 'pD3DDevice' : undeclared identifier 1>c:\users\jamie\desktop\cube\dxmanager.cpp(189): error C2227: left of '->SetTransform' must point to class/struct/union/generic type 1> type is ''unknown-type'' 1>c:\users\jamie\desktop\cube\dxmanager.cpp(191): warning C4552: '+' : operator has no effect; expected operator with side-effect 1>c:\users\jamie\desktop\cube\dxmanager.cpp(192): error C2065: 'pD3DDevice' : undeclared identifier 1>c:\users\jamie\desktop\cube\dxmanager.cpp(192): error C2227: left of '->DrawPrimitive' must point to class/struct/union/generic type 1> type is ''unknown-type'' 1>c:\users\jamie\desktop\cube\dxmanager.cpp(194): error C2065: 'pD3DDevice' : undeclared identifier 1>c:\users\jamie\desktop\cube\dxmanager.cpp(194): error C2227: left of '->EndScene' must point to class/struct/union/generic type 1> type is ''unknown-type'' 1> Generating Code... ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== [/code] It's quite a long list of errors and they are all pretty much the same. This is pretty much the same code I have been using throughout the few chapters of the book and haven't been getting any of these errors at all. This is my code, remember pretty much the same code from other chapters: customVertex.h File [code]struct CUSTOMVERTEX { float x, y, z; DWORD color; };[/code] dxManager.h File [code]#ifndef DXMANAGER_H #define DXMANAGER_H #include <d3d9.h> #include <d3dx9.h> #include "customVertex.h" class dxManager { public: dxManager(); ~dxManager(); void cleanUp(void); void clearScreen(void); void endScene(void); bool initDirect3D(HWND hWnd); bool createCube(void); void createCamera(float nearClip, float farClip); void moveCamera(D3DXVECTOR3 vec); void lookCamera(D3DXVECTOR3 vec); void renderScene(void); private: LPDIRECT3D pD3D; LPDIRECT3DDEVICE pD3DDevice; LPDIRECT3DVERTEXBUFFER9 pVertexBuffer; IDirect3DSurface9* pBackBuffer; HRESULT hResult; D3DXMATRIX viewMat; D3DXMATRIX projMat; D3DXVECTOR3 cameraPosition; D3DXVECTOR3 cameraLook; }; #endif // DXMANAGER_H[/code] dxManager.cpp File [code]#include "dxManager.h" #define CUSTOMFVF (D3DFVF_XYZ | D3DFVF_DIFFUSE) dxManager::dxManager() { pD3D = NULL; pD3DDevice = NULL; pVertexBuffer = NULL; } dxManager::~dxManager() { } void dxManager::cleanUp(void) { if(pD3D != NULL) { pD3D->Release(); pD3D = NULL; } if(pD3DDevice != NULL) { pD3DDevice->Release(); pD3DDevice = NULL; } if(pVertexBuffer != NULL) { pVertexBuffer->Release(); pVertexBuffer = NULL; } } void dxManager::clearScreen(void) { pBackBuffer = NULL; hResult = NULL; if(pD3DDevice == NULL) return; pD3DDevice->Clear(0, 0, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0,0,0), 1.0f, 0.0); } void dxManager::endScene(void) { pD3DDevice->Present(NULL, NULL, NULL, NULL); } bool dxManager::initDirect3D(HWND hWnd) { if(NULL == (pD3D = Direct3DCreate9(D3D_SDK_VERSION))) { hResult = E_FAIL; return false; } D3DPRESENT_PARAMETERS pD3DPresent; ZeroMemory(&pD3DPresent, sizeof(D3DPRESENT_PARAMETERS)); pD3DPresent.BackBufferWidth = 640; pD3DPresent.BackBufferHeight = 480; pD3DPresent.BackBufferFormat = D3DFMT_X8R8G8B8; pD3DPresent.BackBufferCount = 0; pD3DPresent.SwapEffect = D3DSWAPEFFECT_DISCARD; pD3DPresent.hDeviceWindow = hWnd; pD3DPresent.Windowed = true; hResult = pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &pD3DPresent, &pD3DDevice); if(FAILED(hResult)) return false; return true; } bool dxManager::createCube(void) { CUSTOMVERTEX gVertices[] = { // 1 {-64.0f, 64.0f, -64.0f, D3DCOLOR_ARGB(0,0,0,255)}, { 64.0f, 64.0f, -64.0f, D3DCOLOR_ARGB(0,0,0,255)}, {-64.0f, -64.0f, -64.0f, D3DCOLOR_ARGB(0,0,0,255)}, { 64.0f, -64.0f, -64.0f, D3DCOLOR_ARGB(0,0,0,255)}, // 2 {-64.0f, 64.0f, 64.0f, D3DCOLOR_ARGB(0,0,0,255)}, {-64.0f, -64.0f, 64.0f, D3DCOLOR_ARGB(0,0,0,255)}, { 64.0f, 64.0f, 64.0f, D3DCOLOR_ARGB(0,0,0,255)}, { 64.0f, -64.0f, 64.0f, D3DCOLOR_ARGB(0,0,0,255)}, // 3 {-64.0f, 64.0f, 64.0f, D3DCOLOR_ARGB(0,0,0,255)}, { 64.0f, 64.0f, 64.0f, D3DCOLOR_ARGB(0,0,0,255)}, {-64.0f, 64.0f, -64.0f, D3DCOLOR_ARGB(0,0,0,255)}, {-64.0f, 64.0f, -64.0f, D3DCOLOR_ARGB(0,0,0,255)}, // 4 {-64.0f, -64.0f, 64.0f, D3DCOLOR_ARGB(0,0,0,255)}, {-64.0f, -64.0f, -64.0f, D3DCOLOR_ARGB(0,0,0,255)}, { 64.0f, -64.0f, 64.0f, D3DCOLOR_ARGB(0,0,0,255)}, { 64.0f, -64.0f, -64.0f, D3DCOLOR_ARGB(0,0,0,255)}, // 5 { 64.0f, 64.0f, -64.0f, D3DCOLOR_ARGB(0,0,0,255)}, { 64.0f, 64.0f, 64.0f, D3DCOLOR_ARGB(0,0,0,255)}, { 64.0f, -64.0f, -64.0f, D3DCOLOR_ARGB(0,0,0,255)}, { 64.0f, -64.0f, 64.0f, D3DCOLOR_ARGB(0,0,0,255)}, // 6 {-64.0f, 64.0f, -64.0f, D3DCOLOR_ARGB(0,0,0,255)}, {-64.0f, -64.0f, -64.0f, D3DCOLOR_ARGB(0,0,0,255)}, {-64.0f, 64.0f, 64.0f, D3DCOLOR_ARGB(0,0,0,255)}, {-64.0f, -64.0f, 64.0f, D3DCOLOR_ARGB(0,0,0,255)} }; hResult = pD3DDevice->CreateVertexBuffer(sizeof(gVertices) * sizeof(CUSTOMVERTEX), D3DUSAGE_SOFTWAREPROCESSING, CUSTOMFVF, D3DPOOL_DEFAULT, &pVertexBuffer, NULL); if(FAILED(hResult)) return false; VOID* vertexData; hResult = pVertexBuffer->Lock(0, 0, (void**)vertexData, D3DLOCK_DISCARD); if(FAILED(hResult)) return false; memcpy(vertexData, gVertices, sizeof(gVertices)); pVertexBuffer->Unlock(); return true; } void dxManager::createCamera(float nearClip, float farClip) { D3DXMatrixPerspectiveFovLH(&projMat, D3DX_PI/4, 640/480, nearClip, farClip); pD3DDevice->SetTransform(D3DTS_PROJECTION, &projMat); } void dxManager::moveCamera(D3DXVECTOR3 vec) { cameraPosition = vec; } void dxManager::lookCamera(D3DXVECTOR3 vec) { cameraLook = vec; D3DXMatrixLookAtLH(&viewMat, &cameraPosition, &cameraLook, &D3DXVECTOR3(0.0f, 1.0f, 0.0f)); pD3DDevice->SetTransform(D3DTS_VIEW, &viewMat); } void dxManager::renderScene(void) { D3DXMATRIX objectMat, translationMat, rotationMat; pD3DDevice->BeginScene(); pD3DDevice->SetStreamSource(0, pVertexBuffer, 0, sizeof(CUSTOMVERTEX)); pD3DDevice->SetFVF(CUSTOMFVF); D3DXMatrixTranslation(&translationMat, 0.0f, 64.0f, 0.0f); D3DXMatrixRotationY(&rotationMat, timeGetTime()/1000.0f); D3DXMatrixMultiply(&objectMat, &translationMat, &rotationMat); pD3DDevice->SetTransform(D3DTS_WORLD, &objectMat); for (int i = 0; i < 20; i+4) pD3DDevice->DrawPrimitive(D3DPT_TRIANGLELIST, i, 2); pD3DDevice->EndScene(); } [/code] winmain.cpp File [code]#include "dxManager.h" HINSTANCE hInstance; HWND hWnd; dxManager* dxMgr = new dxManager(); bool initWindow(HINSTANCE hInstance); LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); void initCamera(); int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR cmdLine, int cmdShow) { if(!initWindow(hInstance)) return false; if(!dxMgr->initDirect3D(hWnd)) return false; if(!dxMgr->createCube()) return false; initCamera(); MSG msg; ZeroMemory(&msg, sizeof(MSG)); while(msg.message != WM_QUIT) { if(PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) { TranslateMessage(&msg); DispatchMessage(&msg); } else { dxMgr->clearScreen(); dxMgr->renderScene(); dxMgr->endScene(); } } dxMgr->cleanUp(); return (int)msg.wParam; } bool initWindow(HINSTANCE hInstance) { WNDCLASSEX wcex; wcex.cbSize = sizeof(WNDCLASSEX); wcex.style = CS_HREDRAW | CS_VREDRAW; wcex.lpfnWndProc = (WNDPROC)WndProc; wcex.cbClsExtra = NULL; wcex.cbWndExtra = NULL; wcex.hInstance = hInstance; wcex.hIcon = LoadIcon(NULL, IDI_APPLICATION); wcex.hCursor = LoadCursor(NULL, IDC_ARROW); wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); wcex.lpszMenuName = NULL; wcex.lpszClassName = "DirectXExample"; wcex.hIconSm = NULL; RegisterClassEx(&wcex); hWnd = CreateWindow("DirectXExample", "DirectXExample", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 640, 480, NULL, NULL, hInstance, NULL); if(!hWnd) return false; ShowWindow(hWnd, SW_SHOW); UpdateWindow(hWnd); return true; } LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch(msg) { case WM_DESTROY: PostQuitMessage(0); break; } return DefWindowProc(hWnd, msg, wParam, lParam); } void initCamera() { dxMgr->createCamera(1.0f, 500.0f); dxMgr->moveCamera(D3DXVECTOR3(0.0f, 0.0f, -450.0f)); dxMgr->lookCamera(D3DXVECTOR3(0.0f, 0.0f, 0.0f)); }[/code] I know it's quite a lot to look through, but it's best to just include it all rather than none. Some of these errors are appearing on my dxManager.h file where I have declared my Direct3D Object, "pD3D" and Direct3D Device, "pD3DDevice".