Jump to content
  • Advertisement

xegoth

Member
  • Content Count

    242
  • Joined

  • Last visited

Community Reputation

154 Neutral

About xegoth

  • Rank
    Member
  1. Quote:Original post by Will F When you insert something into a standard library container, the object is not put into it. Instead a copy of the object is made. Ah, okay. I didn't realize STL makes a copy, the fact that it was passed by reference is what sent me down that path. Thanks.
  2. I've been coding in C# for the last year or so and recently returned to C++ only to find I seem to have forgotten everything. Heh. Anyhow... given the following scenario... class foo { list<std::string> m_list; foo(int Count) { for(int i = 0; i < NumSeats; i++) { string bar = "something"; m_list.push_back(bar); } } }; Okay. What happens to the data in the list? I want to think that the string is in the scope of the for loop, so it goes out of scope each time around, meaning the list is empty. What *really* happens?
  3. xegoth

    Bullet/Ship Conundrum

    My guess is your ship is going faster than 2km/s and your bullets always fire at 2km/s. Remember, if a bullet is being fired out of a moving ship its initial velocity is: shipVelocity + InitialBulletVelocity. This is because the bullet is ALREADY moving inside of the ship at the speed of the ship, before it's fired. Whatever the muzzle velocity is, needs to be added to the ships velocity.
  4. Visual studio .net for development.. Windows OS. Then again, I work at Microsoft. :P
  5. The node to the right is the node on the same level (depth), but to the right. 1 is connected to 4 is connected to 6. 3 is connected to 9.
  6. Here's the problem: Create a function that takes a binary tree and connects each node to the node closest to its right. There has to be a really elegant solution for this using recursion... but it hasn't occured to me yet. Anyone?
  7. xegoth

    Simple OO question.

    dbzprogrammer, yeah that's the answer. I just couldn't rememember. Thanks :)
  8. My C++ is unfrotunately a bit rusty and I've run into a problem I don't remember how to get around. If you have the following layout: //A.h #ifndef _A_H_ #define _A_H_ #include "B.h" class A { A() { b = new B(this); } B b; } #endif //B.h #ifndef _B_H_ #define _B_H_ #include "A.h" class B { B(A &a); } #endif The above code wouldn't compile because the line: B(A &a); A hasn't been defined yet. How do you get around a problem like this when you want a class to pass a reference of itself to a child?
  9. It looks to me like under normal circumstances the child window gets redrawn when the parent window gets redrawn. This makes some sense as it would be undesirable to redraw the child window only and not the parent. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/pantdraw_2s32.asp
  10. I'm trying to create a class to represent a Win32 dialog in my app. The problem is, the dialog must have a proc which can't be a member of a class. Here's how I implimented it: // Global CConfigMenu *g_ConfigMenu = NULL; // A callback director for the graphics settings dialog's message handler. BOOL CALLBACK ConfigDlgProcDirector( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam ) { return g_ConfigMenu->ConfigDlgProc( hDlg, message, wParam, lParam ); } CConfigMenu::CConfigMenu() : m_pEnumeration( NULL ) { g_ConfigMenu = this; } This is all good and fine unless there is more than one instance of the class. Does anyone know of an elegant way to roll a win32 dialog up into a class? My current way of doing it seems hackish.
  11. xegoth

    Off center fullscreen

    I've seen the same issue and fixed it by switching my game to a higher resolution. I don't know what caused it, for me I wanted to run at a higher resolution anyhow so it didn't matter. You might want to try different resolutions as a temproary solution. (Someone else here may know exactly what causes that).
  12. What about just a fixed image without a loading bar. Do I need to continually redraw it or is once sufficient?
  13. I have a DirectX app that takes a bit of time to load. What I want to do, is display a fullscreen bitmap (think like loading counter strike), while the game loads. I know I have to display my image after DirectX is initialized, but what about rendering it? I won't be in a render loop because I'll be loading my level. Does anyone know of a really good way to impliment a bitmap being displayed at load time? I can think of a few ways to do it but none of them stand out as really clean and effective to me. As far as I'm concerned, I want a simple implimentation that is displayed quickly.
  14. xegoth

    Enum question.

    Quote:Original post by Roboguy IIRC, the first one is invalid. It compiles just fine for me. Does it just have no effect?
  15. xegoth

    Enum question.

    What's the difference between: const enum PlacesILike { Paris, SanDiego, Hawaii } and enum PlacesILike { Paris, SanDiego, Hawaii } I forget what const means in that context. :/
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!