// Basic text output
#include
<openxdk.h>
#include
<stdio.h>
#include
<stdlib.h>
void
XBoxStartup()
{
//let's init the screen
vga_init_mode(MODE_640x480x32); // Some
possible modes all defined in
// xvga.h
//
MODE_320x240x32
//
MODE_640x240x32
//
MODE_640x480x32 etc...plus many more
float last = (float)KeTickCount;
int fps = 0;
int testcount = 0;
while(1)
{
// A list of all these functions can
be found at the top of xvga.h
// Comment this line out to watch the
frame rate go up...on my xbox
// I comment this out, and my frame
rate is nearly 1000fps!...wow!
// but of course you can notice the
flicker :-/
vga_vsync();
// Wait for Vertical Blank
vga_flip();
// Flip
vga_clear();
// Clear screen
fps = (int)(1.0f/(((float)KeTickCount
- last) / 1000.0f));
last = (float)KeTickCount;
// Print to screen
char buffer[300];
// large temp text buffer
sprintf(buffer,"OpenXDK Sample: %d fps", fps);
vga_print(50, 50, buffer);
sprintf(buffer, "Dynamic Counter Value: %d", testcount++);
vga_print(50, 75, buffer);
}//
End while loop
}//End
|