|
2 registered members (juanex, AndrewAMD),
988
guests, and 8
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Console Output?
[Re: muffel]
#345263
10/24/10 16:01
10/24/10 16:01
|
Joined: Feb 2010
Posts: 886
Random
User
|
User
Joined: Feb 2010
Posts: 886
|
What this is passable with 3dgs??? For Console outputs like ps3 or xbox 360 I use Unity 3D.
|
|
|
Re: Console Output?
[Re: Random]
#345265
10/24/10 16:17
10/24/10 16:17
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
Expert
|
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
What this is passable with 3dgs??? For Console outputs like ps3 or xbox 360 I use Unity 3D. We are talking about a console that outputs text to the screen, not about an gaming console.
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
Re: Console Output?
[Re: Random]
#345266
10/24/10 16:18
10/24/10 16:18
|
Joined: Apr 2005
Posts: 3,815 Finland
Inestical
Rabbit Developer
|
Rabbit Developer
Joined: Apr 2005
Posts: 3,815
Finland
|
What this is passable with 3dgs??? For Console outputs like ps3 or xbox 360 I use Unity 3D. Before a storm comes, let me straighten you. It means console outputs as in textual (debugging) representation into windows command line, or other console window.
"Yesterday was once today's tomorrow."
|
|
|
Re: Console Output?
[Re: Random]
#345271
10/24/10 17:05
10/24/10 17:05
|
Joined: Jun 2006
Posts: 2,640 Earth
Germanunkol
OP
Expert
|
OP
Expert
Joined: Jun 2006
Posts: 2,640
Earth
|
Yay!  For anyone interested, here's a quick 'n dirty example of how to create a console and print info to it:
#include <acknex.h>
#include <default.c>
#include <litec.h>
#include <windows.h>
#include <stdio.h>
DWORD consoleOutput;
void logToConsole(STRING* logStr)
{
var out, out2;
WriteFile(consoleOutput, logStr, str_len(logStr), &out, &out2);
//line break:
WriteFile(consoleOutput, "\n", 1, &out, &out2);
}
void main()
{
video_screen = 0;
AllocConsole();
SetConsoleTitle("CSiS Dedicated Server");
consoleOutput = GetStdHandle(STD_OUTPUT_HANDLE);
logToConsole("Hello World");
wait(3);
}
It's interesting how "WriteFile" works to write into a console - which isn't really a file. I must admit I don't fully understand what I did above. But it works...
Last edited by Germanunkol; 10/24/10 17:08.
~"I never let school interfere with my education"~ -Mark Twain
|
|
|
Re: Console Output?
[Re: Germanunkol]
#345272
10/24/10 17:13
10/24/10 17:13
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
Expert
|
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
In fact, stdout _is_ a file. But not a file in your normal file system on the hard disk, but one in the virtual file system. So its no wonder that you can write into the console like into a file.
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
Re: Console Output?
[Re: WretchedSid]
#345275
10/24/10 17:39
10/24/10 17:39
|
Joined: Sep 2003
Posts: 9,859
FBL
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 9,859
|
more interesting is that it seems to be able to handle Acknex STRINGs...
edit: ah it's not. By directly passing a parameter in "" isntead of a sTRING pointer, A8 uses a char array instead of a STRING. And this way your code works. Confusing, isn't it?
Last edited by Firoball; 10/24/10 17:40.
|
|
|
Re: Console Output?
[Re: FBL]
#345277
10/24/10 18:05
10/24/10 18:05
|
Joined: Jun 2006
Posts: 2,640 Earth
Germanunkol
OP
Expert
|
OP
Expert
Joined: Jun 2006
Posts: 2,640
Earth
|
Yes, guess why I couldn't get it to work?  STRINGS seem to mess up, but that makes sense I guess, since they're acknex-structs... Oh well. It works now. I guess I'll have to make input work as well somehow, that'll be harder...
~"I never let school interfere with my education"~ -Mark Twain
|
|
|
Re: Console Output?
[Re: Germanunkol]
#345280
10/24/10 18:11
10/24/10 18:11
|
Joined: Jan 2003
Posts: 4,615 Cambridge
Joey
Expert
|
Expert
Joined: Jan 2003
Posts: 4,615
Cambridge
|
streams (pipes, better) work like files.
edit: yay, three new posts. i'd better refresh pages before posting.
Last edited by Joey; 10/24/10 18:12.
|
|
|
|