• Content count

  • Joined

  • Last visited

Community Reputation

206 Neutral

About RobAU78

  • Rank
  1. Yeah, stupid me forgot to look at the using-statements. [img][/img] Thanks for your help!
  2. D'oh, nevermind! I just noticed the following using-statement in the tutorials: "using SlimDX.Direct3D11;" So I need to change that to "using SlimDX.Direct3D9;"
  3. Okay, how do I use the D3D9 components with SlimDX? Or can I? Sorry, I'm a complete noob when it comes to this. [img][/img]
  4. Ah, that's what I was afraid of. The SlimDX site says that it supports Windows XP though? Is that no longer accurate?
  5. I just started looking into SlimDX and was trying to run tutorials 2 and 3 on my home computer, but I ran into a snag on the line where Device.CreateWithSwapChain() is called. Apparently an SEHException is thrown on that line. The error code is -2147467259, which apparently means an undetermined error has occurred. This issue comes up with both DeviceCreationFlags.None and DeviceCreationFlags.Debug, which suggests that downloading the DirectX SDK won't solve the problem (but I could be wrong). For reference, my computer is running 32-bit Windows XP Professional. The processor is an Intel E5400 with integrated graphics (i.e. I don't have a separate graphics card).
  6. I'm not a game programmer...screw games

    If this is your first game project, I'd suggest going with 2D instead. 3D games are much harder to develop. The concepts involved are much more complex. That doesn't mean you won't be able to understand them - it just means the understanding will take all that much longer.
  7. Although I think this is an interesting idea, I don't think it's fit for a full-scale 4x game. Most 4x players don't want to actually design mass drivers, etc. They just want to use them to do other things. On a more basic level, I think you have two different concepts put together. One of them is about setting goals and getting results based on those goals. This is basically the way a lot of government-contracting work is done. The government will request proposals for things that meet certain requirements, and contracting companies will submit proposals for them. The other concept is about dependencies existing between different components. For example, an unmanned spacecraft doesn't need a life-support system, but a manned spacecraft does. Certain weapons or other active components may need certain amounts of power generation, etc. So the idea is that the actual ship stats (power, speed, offensive/defensive capabilities, etc.) are somewhat emergent based on the components used. Hope this helps. I think both of these concepts are interesting and would like to see them better developed in future space 4x games.
  8. Dynamic Game State System

    Quote:Original post by BasicMind My next attempt was a little more dynamic but equally flawed. StateManagerInstance().switchState(new GameState()) This meant that only the current state would need to know what the next state was, which is close to what I want. But passing new everywhere worries me (I cant use boost btw), and also it does not check to see if the next state is already active. You could just create the states on the stack, whether they're global or function-level variables. Something like this: void runGame() { GameState mainMenu, gameplay; // loop goes here } Or you could make them class members: class Game { public: // ... private: GameState mainMenu; GameState gameplay; // etc. } Does this make sense?
  9. If you use WPF a lot, I'd say upgrading to the 2010 Express Edition is worth it, since you get the graphical editor built-in. Otherwise, I don't see a big difference between VS 2008 and VS 2010.
  10. A few Win32 API questions

    Quote:Original post by Sigvatr 2) When I try and code an object oriented window model, I can't set the window object's window class's lpfnWndProc value to the WndProc function, whether or not it is a class member function or a normal function. How can I give a window class it's own WndProc function for message handling? One way to do it is described here. Basically it describes passing in the this pointer when creating a new window; this will be passed as the lParam of the WM_NCCREATE message. You'll then need to set the user-defined area of the window object, called GWL_USERDATA. On any subsequent invocation of the static message procedure, you can grab the this pointer out of the GWL_USERDATA region (it should be the only thing in there) and then call its member message procedure. Hope that makes sense. The contents of the whole tutorial can be found here.
  11. Quote:Original post by LorenzoGatti I think there are two components in this approach: a generic, low-level renderer "service" that draws stuff (understanding model, sprite, animation etc. data structures and APIs, taking care of DirectX or OpenGL data structures and calls, and providing general purpose functionality like sorting geometry and caching textures); and a high-level renderer controller that has the described access to game objects and uses it to decide what to draw and implement game specific behaviour, e.g. querying the game world model for soldiers, smoke and muzzle flashes, sorting them together, then drawing all friendly projectiles, then enemy projectiles (more important), then all laser beams with additive blending, and finally the HUD. For a generalized graphics system, I'd say you're right. But if you're taking a simpler approach (i.e. making a game, not an engine), then I don't think you have to separate these behaviors into two layers. :)
  12. Another approach that might help you is to basically invert the relationship between the game objects and the renderer. Instead of the game objects holding references to the renderer (singleton or otherwise), the renderer holds a reference to an interface for accessing the game objects. You could call this interface the "model" or "world". The renderer would have one main method called DrawFrame() or the like, in which it would use the model interface to access the various game objects and basically ask them how they should be drawn. I got started recently with DirectX and think this is a good approach to use there. It allows you to keep all or most of the DirectX interaction within one area, namely the renderer class and any supporting classes.
  13. Agreed, it was a bad assumption on my part. I was not aware (or had forgotten) that the behavior is undefined. Thanks again. :)
  14. Aha... I've edited the code above to make it easier to read (i.e. got rid of the escaped quotation marks) and also put the comment on the right line, where the dereference is. Still sounds like it would be undefined behavior though, right?
  15. I'm probably missing something obvious here. Can anyone tell me what it is? Thanks. #include <iostream> #include <vector> using namespace std; struct Test { int a; float b; char* c; }; int main() { vector<Test*> first; vector<Test*> second; for(unsigned int i = 0; i < 2; i++) { Test* pTest = new Test; pTest->a = i; pTest->b = 2.0; pTest->c = "Hello world!"; first.push_back(pTest); second.push_back(pTest); } for(vector<Test*>::iterator it = first.begin(); it != first.end();) { Test* pTest = *it; if(pTest->a == 1) { if(second[1] == pTest) { cout << "Pointers are equal!" << endl; } else { cout << "Pointers are NOT equal!" << endl; } it = first.erase(it); delete pTest; cout << "Pointer value: " << pTest << endl; // Program should crash here, but doesn't? cout << "Test.c value: " << pTest->c << endl; } else { it++; } } cout << first.size() << endl; cout << second.size() << endl; return 0; }