delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/05/27/13:11:02

From: "Alexei A. Frounze" <see_below AT the_message_body DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Silly Question...
Date: Sat, 27 May 2000 17:52:06 +0400
Organization: None
Lines: 96
Message-ID: <392FD306.310AA7D0@the_message_body.com>
References: <W_MX4.2771$D%2 DOT 66210 AT news1 DOT news DOT adelphia DOT net> <392FB870 DOT 58FCE4C0 AT the_message_body DOT com> <vyPX4.2777$D%2 DOT 66584 AT news1 DOT news DOT adelphia DOT net>
NNTP-Posting-Host: ppp108-82.dialup.mtu-net.ru
Mime-Version: 1.0
X-Trace: gavrilo.mtu.ru 959435674 11330 212.188.108.82 (27 May 2000 13:54:34 GMT)
X-Complaints-To: usenet-abuse AT mtu DOT ru
NNTP-Posting-Date: 27 May 2000 13:54:34 GMT
X-Mailer: Mozilla 4.72 [en] (Win95; I)
X-Accept-Language: ru,en
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019