.com.unity Forums

.com.unity Forums (http://forum.shrapnelgames.com/index.php)
-   Space Empires: IV & V (http://forum.shrapnelgames.com/forumdisplay.php?f=20)
-   -   OT: Stupid c++ (Roguelike development) (http://forum.shrapnelgames.com/showthread.php?t=29767)

PvK August 9th, 2006 03:00 PM

Re: OT: Stupid c++
 
I'm not familiar with "Dev C++" - never even heard of it, sorry.

What response to mice are you getting that you don't want? One thing you can generally do is handle mouse events received by your window, and then just do nothing with them and say you handled it. But that's assuming you have a window procedure. If you're running in an MS-DOS-like Windows console window running as a console app, then I don't think you do control how that window behaves - it's a window from Windohs onto your program's i/o. You might be able to make a Windohs shortcut to your app and play with the shortcut's settings to alter the mouse behavior - I'm not sure how many options you have to do that, though.

What's the mouse doing that you don't want it to?

PvK August 9th, 2006 03:07 PM

Re: OT: Stupid c++
 
Oh, I just glanced at the code you linked to, and saw this:
<font class="small">Code:</font><hr /><pre> case MOUSE_EVENT:
++MouseEvents;
SetConsoleCursorPosition(hOut,
MouseWhere);
cout &lt;&lt; MouseEvents &lt;&lt; flush;
break; </pre><hr />
Is that in your code? Is that what's doing what you don't like? Looks like it is set to move your cursor wherever the mouse goes. If so, just comment out (or delete) all the lines above, to stop it doing that.

narf poit chez BOOM August 9th, 2006 05:25 PM

Re: OT: Stupid c++
 
*Whaps forehead* Yeah, it works much better when I describe the problem. Sorry.

Basically, each time I move the mouse...Er, the characters used to flicker. Something I did stopped that, though...Programs is wierd.

narf poit chez BOOM August 14th, 2006 08:56 PM

Re: OT: Stupid c++
 
How would one convert an int into a std::string?

Programs for debugging...What can you tell me?

narf poit chez BOOM August 15th, 2006 04:19 AM

Re: OT: Stupid c++
 
For that matter, how would one convert a std::string into an int? Or a float?

Are there any libraries out there for this?

Fyron August 15th, 2006 04:28 AM

Re: OT: Stupid c++
 
http://www.cplusplus.com/ is a decent source of c++ info. Look up atoi. Then recall that string objects have a .c_str() member function that will return a c-style string (null-terminated array of characters).

There is a function to go the other way, but I forget it.

Debugging is related to the compiler you are using. What is your compiler?

narf poit chez BOOM August 15th, 2006 04:44 AM

Re: OT: Stupid c++
 
Thanks. If all else fails...

Dev c++ - The debug function doesn't seem to work.

Is it possible to use the '&gt;&gt;' operator with an 'ifstream'?

narf poit chez BOOM August 15th, 2006 05:29 AM

Re: OT: Stupid c++
 
Can someone give me an example of how to use seekg () and get () to read from a file? I can't seem to get them to work.

(DBPro has sane file inputs and outputs. Why can't c++?)

Never mind. Figured it out.

narf poit chez BOOM August 15th, 2006 06:10 AM

Re: OT: Stupid c++
 
What, exactly, is ' C:\Programming\Dev-Cpp\Projects\Simple Roguelike\Makefile.win [Build Error] [clean] Error 1 ' and why would it stop the program from compiling?

Fyron August 15th, 2006 12:07 PM

Re: OT: Stupid c++
 
&gt;&gt; and &lt;&lt; are operators that are generally valid for streams (cout and cin are actually file streams). You should be able to use &gt;&gt; with ifstream, as per this page (ifstream is derived from istream). That site is a good reference to use. http://forum.shrapnelgames.com/images/smilies/wink.gif


I have no idea what that error means.

To use a different debugger, you would have to compile with a different compiler. Microsoft's VC++ 7.1 compiler is free to get (the command line version), which you should be able to plug in to DevC++ (if it is worth it's salt).


All times are GMT -4. The time now is 07:12 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.