2003-08-17

OpenXDK

Here's a cool project...OpenXDK

I was successful in getting the sample to compile and run on the XBOX:


#include
#include
#include

void WinMainCRTStartup()
{
char buffer[1024];
float last = (float)KeTickCount;
int fps = 0;

RtlZeroMemory(buffer, 1024);

// Currently, this is the only mode supported by xhal.lib
InitMode( MODE_320x240x32 );

// Animate up and down
int y=25, ys=1;

// XBox software does not typically ever return from its entry point
while(true)
{

WaitVBlank(); // Wait for Vertical Blank
Flip(); // Flip
Cls(); // Clear screen

fps = (int)(1.0f/(((float)KeTickCount - last) / 1000.0f));
last = (float)KeTickCount;

// Print to screen
sprintf(buffer,"OpenXDK Sample: %d fps", fps);
Print(50,y, buffer);

// Move text up and down
y+=ys;
if(y > 175 || y < 25)
ys = -ys;
}
}




This piece of code remindes me of the code we use to write for MODE 13 on the PC (320x200x256). Clear the buffer...write next frame...wait for vertical retrace....flip buffer to screen...cool stuff!

Looking through the library one could see it's still a bit limited however there's great potential!

0 Comments:

Post a Comment

<< Home