rendered paste body#include <allegro.h>
#include <winalleg.h>
#include "stdio.h"
#include "resource.h"
const char * configuration_file="game.cfg";
const int screen_x=640;
const int screen_y=480;
const unsigned char colour_depth=32;
const int graphics_mode=GFX_DIRECTX_WIN;
BITMAP * LoadBitmapRes(int id) {
HBITMAP bmp2=(HBITMAP)LoadImage(GetModuleHandle(0),MAKEINTRESOURCE(id),IMAGE_BITMAP,0,0,LR_CREATEDIBSECTION);
if(!bmp2) {
return (BITMAP*)0;
}
BITMAP * ret=convert_hbitmap_to_bitmap(bmp2);
if(!ret) {
return (BITMAP*)1;
}
return ret;
}
int main(int argc, char *argv[])
{
allegro_init();
set_config_file(configuration_file);
install_keyboard();
int buttons=install_mouse();
if(install_sound(DIGI_AUTODETECT, MIDI_AUTODETECT, NULL)) {
allegro_message("Error %s (sound)", allegro_error);
return 1;
}
set_volume(/*digital*/ 255, /*midi*/ 255);
set_color_depth(colour_depth);
if(set_gfx_mode(graphics_mode,screen_x,screen_y,0,0)) {
printf("Video Error: %s",allegro_error);
return 1;
}
BITMAP * white=LoadBitmapRes(IDB_WHITE);
BITMAP * black=LoadBitmapRes(IDB_BLACK);
if(int(white)>1) {
masked_blit(white,screen,0,0,0,0,32,32);
} else {
allegro_message("%i",(int)white);
}
readkey();
return 0;
}
END_OF_MAIN()