DemoGL::Reference::Functions::DEMOGL_ConsoleLogLineV

DEMOGL_ConsoleLogLineV

DEMOGL_ConsoleLogLine logs a given string on the DemoGL system console. It uses a format string and a variable list of parameters, similar to printf.

void
DEMOGL_ConsoleLogLineV(
	const bool bScroll,
	const char *pszFormat,
	...
);
	
Parameters.
bScroll
Specifies if the console contents should scroll one line up when the line to be logged is placed on the system console. When bScroll is true, scrolling takes place, otherwise no scrolling will take place and the line will be overwritten by the next line that is logged.
pszFormat
Pointer to a zero-terminated string that will be used as a format string, similar to printf's format string. It has the same syntax as the format string of printf.
...
The three dots in the declaration header specify that you can use one or more parameters with this function, similar to printf. All types accepted by printf are accepted by DEMOGL_ConsoleLogLineV.

Return values.

Remarks.
The zero-terminated string pointed by pszFormat is used as a format string and combined with the values of the parameters will it result in a zero-terminated string that is placed on the lowest line visible in the system console, just above the input lines. bScroll controlls if the contents of the console should scroll up or not after this line is logged. This function will not have any effect when DEMOGL_AppRun is not called, so use DEMOGL_ConsoleLogLineV only in code placed in registered effectclasses. Logged lines are always wrapped. When bScroll is false, the wrapped part is lost.

Example.
int     iFoo;
float   fBar;

// Give our example variables some values
iFoo=10;
fBar=1.0f;

// Log a string constructed at runtime on the console, 
// scroll the contents after the log has completed.
DEMOGL_ConsoleLogLineV(true,
	"This is an integer: %d, and this is a float: %f", iFoo, fBar);
	

Requirements.
DemoGL v1.3 (build 0112 or higher)

See also.
DEMOGL_ConsoleLogLine, DEMOGL_AppRun

Last changed on 19-jan-2001

©1999-2001 Solutions Design