Game Development Community

True consoles

by Matthew Shapiro · in Torque Game Engine · 02/04/2002 (5:07 am) · 3 replies

I have moved my thread here because i want to know, how does torque do their console display for their dedicated server? It has it perfect where the text is on the bottom line and output text scrolls above it... Anyone wanna enlighten me how it's done?

#1
02/04/2002 (5:52 am)
umm correct me if im wrong but .. im sure the console operates much the same way this simple code does :
int main(int argc, char* argv[])
{
	char data[1024];

	while(true)
	{
		printf("Enter some Text (Ctrl-C to quit)\n%%");
		gets(data);
		printf("Data : %s\n", data);
	}
	return 0;
}
as in as you fill the buffer it fills the screen ..
once screen is full it scrolls the data out
#2
02/04/2002 (7:38 am)
It uses CR!

int main(int argc, char* argv[])
{
	char data[1024];

	while(true)
	{
		printf("Enter some Text (Ctrl-C to quit)%%");
		gets(data);
		printf("\rData : %s\n", data);
	}
	return 0;
}
#3
02/04/2002 (10:09 am)
But the entering of text seems to be blocking (i added printf("blah\n"); but it only displayed after i typed... and i kjnow that torque's console doesn't block... any other ideas?

...or am i missing something?