// WARNING!!!
// Now don't forget to put the 'image.tga' with your xbe :)
#include
<openxdk.h>
#include
<xgfx2d/bitmap.h> // Bitmap*,
create_bitmap(..) etc
#include
<xgfx2d/blit.h> // blit(..)
#include
<xgfx2d/blitters.h> // normal_blit
// Program Entry Point
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
Bitmap *screen;
Bitmap *image;
//let's load the test image (one of the opexdk
demo images)
image = load_tga("D:\\image.tga");
while(1)
{
// A list of all these functions can
be found at the top of xvga.h
vga_vsync();
// Wait for Vertical Blank
vga_flip();
// Flip
// You can comment this line our
really as where totally overwritting
// the full screen - but I left it in
anyhow, as you woudl usually clear
vga_clear();
// Clear screen
//so where's the screen? who knows if
we're page flipping?
screen = get_screen_bitmap();
// blit method definition:
// void blit(Bitmap *dest, Bitmap *src,
int dx, int dy, int sx,
// int sy, int sw, int sh, void (*blitter)(uint32*,uint32*,int,int),
int parameter)
blit( screen, //
destination
image,
// source
0, 0,
// destination x,y (top left)
0, 0,
// source x,y (top left)
640, 480,
// width and height (source)
normal_blit, 0); //
blit method, options (ignored)
}//
End while loop
}//End
|