www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/02/24/08:00:15

From: "helen" <lab_darzo AT libero DOT it>
Newsgroups: comp.os.msdos.djgpp
Subject: ALLEGRO: help with ARC
Date: Mon, 24 Feb 2003 12:50:56 +0000 (UTC)
Organization: Mailgate.ORG Server - http://www.Mailgate.ORG
Lines: 89
Message-ID: <8d3750b48cafc870dd036fac3f43e856.113557@mygate.mailgate.org>
NNTP-Posting-Host: host227-148.pool217223.interbusiness.it
X-Trace: news.mailgate.org 1046088187 8401 217.223.148.227 (Mon Feb 24 13:50:55 2003)
X-Complaints-To: abuse AT mailgate DOT org
NNTP-Posting-Date: Mon, 24 Feb 2003 12:50:56 +0000 (UTC)
Injector-Info: news.mailgate.org; posting-host=host227-148.pool217223.interbusiness.it; posting-account=113557; posting-date=1046088187
User-Agent: Mailgate Web Server
X-URL: http://mygate.mailgate.org/mynews/comp/comp.os.msdos.djgpp/8d3750b48cafc870dd036fac3f43e856.113557%40mygate.mailgate.org
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

I am using Allegro with DJGPP on a win98 OS.
Everything works fine, but I can't get this to work properly:
(look under for more questions and details)

/*
 *    Example program for the Allegro library, by Shawn Hargreaves.
 *
 *    This is a very simple program showing how to get into graphics
 *    mode and put pixels onto the screen.
 */


#include "allegro.h"



int main()
{
	int i,k;
   /* you should always do this at the start of Allegro programs */
   allegro_init();

   /* set up the keyboard handler */
   install_keyboard(); 

   /* set a graphics mode sized 320x200 */
   if (set_gfx_mode(GFX_SAFE, 320, 200, 0, 0) != 0) {
      set_gfx_mode(GFX_TEXT, 0, 0, 0, 0);
      allegro_message("Unable to set any graphic mode\n%s\n",
allegro_error);
      return 1;
   }

   /* set the color palette */
   set_palette(desktop_palette);

   /* clear the screen to white */
   clear_to_color(screen, makecol(255, 255, 255));

   /* you don't need to do this, but on some platforms (eg. Windows)
things
    * will be drawn more quickly if you always acquire the screen before
    * trying to draw onto it.
    */
   acquire_screen();

   // Now prepare a arc...
    
	arc(screen, 100, 100, 60,200, 50,4);
    	
    readkey();

   /* you must always release bitmaps before calling any input functions
*/
   release_screen();

   /* wait for a keypress */
   readkey();

   return 0;
}

END_OF_MAIN();
----------

I only want to draw an arc on the screen, say from 30 degrees to 300
degrees.
I am not sure what kind of numbers to use to specify the degrees
in the ARc primitive.

HELP says
void arc(BITMAP *bmp, int x, y, fixed ang1, ang2, int r, int color);
Draws a circular arc with centre x, y and radius r, in an anticlockwise
direction starting from the angle a1 and ending when it reaches a2.
These values are specified in 16.16 fixed point format, with 256 equal
to a full circle, 64 a right angle, etc. Zero is to the right of the
centre point, and larger values rotate anticlockwise from there.


thank you

helen

contact me also at skyboxNOSPAM AT infinito DOT it


-- 
Posted via Mailgate.ORG Server - http://www.Mailgate.ORG

- Raw text -


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