3 registered members (Ayumi, Akow, AndrewAMD),
1,505
guests, and 9
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Acknex.exe with console
[Re: Tempelbauer]
#377002
07/08/11 22:03
07/08/11 22:03
|
Joined: Nov 2002
Posts: 913 Berlin, Germany
SchokoKeks
User
|
User
Joined: Nov 2002
Posts: 913
Berlin, Germany
|
Thats a great contribution, would you mind sharing the changes you did to acknex.cpp to make it open a second window that displays the console? that would probably save me a lot of hassle
|
|
|
Re: Acknex.exe with console
[Re: SchokoKeks]
#377004
07/08/11 22:27
07/08/11 22:27
|
Joined: Oct 2007
Posts: 5,210 Ä°stanbul, Turkey
Quad
OP
Senior Expert
|
OP
Senior Expert
Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
|
There is no change in the source, only on project settings. Set it as console application instead of windows application and you are set.
3333333333
|
|
|
Re: Acknex.exe with console
[Re: Quad]
#379454
08/02/11 20:35
08/02/11 20:35
|
Joined: Dec 2008
Posts: 1,218 Germany
Rackscha
Serious User
|
Serious User
Joined: Dec 2008
Posts: 1,218
Germany
|
mh if publishing doesnt work with this technique, maybe create a second application, a logger application which can communicate through pipes with liteC? since we have winapi, we have pipes. Worked with them at work in delphi. It might be a bit complicated at first but allows them to use for logging(tools like smartinspect for example use them).
This way you can send messages between applications.
Greets Rackscha
MY Website with news of my projects: (for example my current Muliplayer Bomberman, GenesisPrecompiler for LiteC and TileMaster, an easy to use Tile editor) Sparetime-Development
|
|
|
Re: Acknex.exe with console
[Re: alibaba]
#451437
05/06/15 12:58
05/06/15 12:58
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
Expert
|
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
You will love this! You can redirect stdout to a virtual console file using freopen() like so:
freopen("CONOUT$", "w", stdout);
Redirecting the console to stdin works via the CONIN$ virtual file. This, of course, does not work with the standard Gamestudio printf(), because standard gamestudio is stupid and doesn't actually ever output to stdout. So, here is the amazing workaround: Shadow printf so that it actually fprintf() with stdout as argument! Cool, but, Lite-C does not support variadic macros and one of the great things about printf() is that you can put a format string in there and you probably do that and don't want to change your call sites. If you expect some genius solution now, sorry, you are totally out of luck. Here is how to write the basic macro though:
#define elide_arg (0)
#define pack_args1(arg0) arg0
#define pack_args2(arg0, arg1) arg0, arg1
#define pack_args3(arg0, arg1, arg2) arg0, arg1, arg2
#define printf(format, args) fprintf(stdout, format, args)
And your call sites would need to change like this:
// Old
printf("Hello World");
printf("Hello %s, %d", "world", 42);
// New
printf("Hello World", elide_arg);
printf("Hello %s, %d", pack_args2("world", 42));
PS: For Chaos, who prefers Haskell over Lite-C, the way to go is using the Text.Printf packaged. Printf has the following signature: printf :: PrintfType r => String -> r
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
|