Jump to content
  • Advertisement

delta user

Member
  • Content Count

    131
  • Joined

  • Last visited

Community Reputation

164 Neutral

About delta user

  • Rank
    Member
  1. delta user

    Multiple mice?

    On linux you can read the input from "/dev/input/mouse*" (where * can be replaced by any number from '0' to 'number of mouses - 1'). This way you can get the input from separate mice. The used protocol is PS/2. Just google "PS/2 mouse interfacing" and you will find tutorials on how to get the required data out of them. You need root privileges to read those files though.
  2. delta user

    HelP! (Access Violation ) delete pointer

    Psycrosis: True fantasyme: You also need to be very careful when calling virtual functions inside a destructor as this might not do what you expect it to do.
  3. I'm sorry for hi-jacking this thread, but reading the article and the article referred in that article [smile] left me thinking. In the end of A simple meta-accessor there is: Quote: And finally, for const members make the type inside Accessors const rather than the Accessors object. I'll leave it to you to work out reasons for this. I do not see why you should put the const inside the template argument. The only difference I get is that when using 'Accessor<const int>' the compiler generates a more obscure error than when using 'const Accessor<int>'. That error is of course produced if you try to modify the int inside the Accessor. Can someone enlighten me?
  4. You can also just use erase. If you are using pointers then find is the best way. Stupid me for not seeing this before.
  5. Writing exception-safe C++ code isn't as simple as just having RAII everywhere though - your objects can still be left in an inconsistent state without care. Consider: void Widget::Swap( Widget& other ) { member1.swap( other.member1 ); member2.swap( other.member2 );//throws... member3.swap( other.member3 ); } [/quote] In this example, if you use return codes instead of exceptions, you still get an inconsistent state. It doesn't matter what method you use. If you don't handle the errors, it won't work.
  6. You will find the answer here.[wink]
  7. delta user

    C++ base member access control

    I must agree with a private using being valid, but i believe it wasn't meant to be private in this case. It is annoying that VS is giving an error because it might be your intention to make it private. On g++ on the other hand, the code compiles fine and runs the template function instead of the base function, which might not be what you intended.
  8. delta user

    C++ base member access control

    The using shouldn't be private, it should be public. That's also what the compiler is saying.
  9. delta user

    c++ template challenge

    So you want to reduce the number of function calls because they might be to much of an overhead, and you want to do this by creating and destroying instances of classes? This has to be a joke. The construction and destruction of that instance take a function call each.
  10. delta user

    Stuck on stupid movement problem

    In my opinion, your move method is not the most suited for your problem. Lets think about it for a minute. You have a move() method. This would make me think that every time I call that function, the object would move a constant distance. And if you wanted to move a bit further you just would have to call the function multiple times. Now, you are trying to move at a constant speed, by telling the object when to start and when to stop moving. This is when a key is pressed and released respectively. So a more logic function or rather functions would be startMove() and stopMove(), which immediately solves your timing problem. You just start a timer in the startMove() function and stop the timer in the stopMove() function. By using an updateGraphics() function you can get the right position using the timer.
  11. delta user

    Windows Programming Basics

    it is not the same error. It first said the error was at parameter 2 and now it is at parameter 3. This is because you need to put the L in front of all the text parameters. The LPCWSTR stands for Long Pointer to a Constant Wide STRing Long is something from the 16bit era Pointer because it is a poiter to a string Constant because the MessageBox api promises not to modify the string Wide because it is a Unicode string and has wide chars and of course it is a STRing
  12. in visual studio, go to: project properties -> configuration properties ( release ) -> C/C++ -> Code generation -> runtime library and choose 'multi-threaded' instead of 'multi-threaded DLL' that should do it
  13. delta user

    Additive blending conundrum...

    You could try GL_ONE_MINUS_SRC_ALPHA in the destination parameter. [edit] Wow, fast postings. To do the transparent blending you have to use the GL_ONE_MINUS_SRC_ALPHA in the destination parameter. But you can't directly to additive and transparent blending at the same time. You could however render your particles with additive blending to a different buffer (which has a black backgroundcolor) and then render that buffer with transparent blending on your scene.
  14. delta user

    Why do my clients get spiked?

    Quote:Original post by Eralp So I think that this is the proper way how to do this, but my clients get spiked,if you for example push and release a key really fast it doesn't even move. And when you push and hold the key the character "spikes"(teleports) back a little bit. I am just guessing right now but it might be possible that the problem isn't located at the packets itself. For example with the "push and release a key really fast". Is there a triggering condition which could be not met, or is your moving distance to small to notice a movement. For the teleports it rather sound like you are not completely in sync which is also not possible because of the uncertainity stonemetal mentioned. On a network you can almost never synchronize up to a milisecond accuracy (not even close). If your movement is to strictly based on "being synchronized", you will most likely get those teleports and glitches.
  15. delta user

    WinMain vs Main

    Yes ofcourse you need to choose the right linker option. But I ment that when you are using main, you (most likely) will be compiling as a console app and when you use winmain it is probably a native win32 app. I just wanted to make it clear that there is no real difference between main and WinMain besides the arguments (if you want it to). Don't make it harder than it is.
  • 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!