Mail Archives: djgpp/2000/05/27/13:11:02
Keep in mind that most of people are not going to do your job especially, if
your task is explained in FAQs and docs available for you.
I have no idea why you avoid the FAQ and ready-made examples, if you're a
newbie. What you ask to do is done in 5 minutes from the scratch.
Apply your source to this and you're done...
--------------8<---------------
#include <stdlib.h>
#include <stdio.h>
#include "allegro.h"
/*
This makes VGA and VESA 1.2 (256 colored) modes available only,
no digital sound and midi music, no joystic and thus smaller EXE.
*/
BEGIN_GFX_DRIVER_LIST
GFX_DRIVER_VGA
GFX_DRIVER_VESA1
END_GFX_DRIVER_LIST
BEGIN_COLOR_DEPTH_LIST
COLOR_DEPTH_8
END_COLOR_DEPTH_LIST
BEGIN_DIGI_DRIVER_LIST
END_DIGI_DRIVER_LIST
BEGIN_MIDI_DRIVER_LIST
END_MIDI_DRIVER_LIST
BEGIN_JOYSTICK_DRIVER_LIST
END_JOYSTICK_DRIVER_LIST
int main()
{
/* you should always do this at the start of Allegro programs */
allegro_init();
/* set up the keyboard handler */
install_keyboard();
/* set VGA graphics mode 13h (sized 320x200) */
set_gfx_mode(GFX_VGA, 320, 200, 0, 0);
/* set the black pallete */
set_pallete(black_pallete);
/* write some text to the screen */
textout_centre(screen, font, "Hello, world!", SCREEN_W/2, SCREEN_H/2,
255);
/* wait for a keypress */
readkey();
/* fade in from current (black) palette to specified */
fade_in (desktop_pallete, 4);
/* wait for a keypress */
readkey();
/* fade out from current palette to black */
fade_out (4);
return 0;
}
--------------8<---------------
Good Luck
Alexei A. Frounze
-----------------------------------------
E-mail: alexfru [AT] chat [DOT] ru
Homepage: http://alexfru.chat.ru
Mirror: http://members.xoom.com/alexfru
Justin Szczap wrote:
>
> Uh... yeah, I've looked at those, but still fail to see how I'd feasibly do
> what I want. Can you please apply an example to the following code?
> void display_board()
> {
> BITMAP *the_board;
> PALETTE the_board_pal;
> the_board=load_bitmap("board.bmp", the_board_pal);
> set_palette(the_board_pal);
> blit(the_board, screen, 0, 0, (SCREEN_W-the_board->w)/2,
> (SCREEN_H-the_board->h)/2, the_board->w, the_board->h);
> destroy_bitmap(the_board);
> }
> I'm really in a jam... Thanks...
> - JS
- Raw text -