delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/03/06/22:45:15

Message-ID: <38C4290B.19B6F15@ou.edu>
From: David Cleaver <davidis AT ou DOT edu>
X-Mailer: Mozilla 4.7 [en] (Win98; I)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Re: make a faster blit (allegro)
References: <Pine DOT LNX DOT 4 DOT 10 DOT 10003050557260 DOT 878-100000 AT darkstar DOT grendel DOT net> <200003050219 DOT HAA01019 AT midpec DOT com> <8a0tfo$aaf$1 AT wanadoo DOT fr>
Lines: 83
Date: Mon, 06 Mar 2000 15:54:19 -0600
NNTP-Posting-Host: 129.15.140.115
X-Complaints-To: usenet AT ou DOT edu
X-Trace: news.ou.edu 952379579 129.15.140.115 (Mon, 06 Mar 2000 15:52:59 CST)
NNTP-Posting-Date: Mon, 06 Mar 2000 15:52:59 CST
Organization: The University of Oklahoma
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hello,

I believe I have a solution for you that will solve your problems:

change the two lines that say:
int d_a=10;
int d_b=11;

TO:
#define d_a 10
#define d_b 11

That should take care of your problems.  Hope this helps, and good luck.

-David C.

Cyberdivad wrote:
> 
> Hi !
> Here is an example of source with the project file for rhide. This example
> work only if you don't setup variables with values (like a=2;).
> In this example, this is not really a problem, but my program needs to
> assign values to var in header files.
> 
> source of header f.h :
> #include <stdlib.h>
> #include <stdio.h>
> #include "allegro.h"
> 
> #ifndef FONC_H
> #define FONC_H
> 
> // here
> int d_a=10;
> int d_b=11;
> 
> extern int calcab(int a, int b);
> 
> #endif
> ----------------
> 
> source of f.c :
> #include "fonc.h"
> 
> int calcab(int a, int b)
> {
>  return a*b+d_a;
> }
> --------------
> 
> source of main.c :
> include <stdlib.h>
> #include <stdio.h>
> 
> #include "allegro.h"
> #include "fonc.h"
> 
> int calcabi(int a, int b)
> {
>  return (d_a*a)+(d_b*b);
> }
> 
> int main()
> {
> 
>  int r;
> 
>  allegro_init();
>  install_keyboard();
> 
>  printf("\nBonjour !");
>  r=calcab(d_a,d_b)+calcabi(7,8);
>  printf("%d*%d=%d",d_a,d_b,r);
> 
>  readkey();
> 
>  set_gfx_mode(GFX_VGA, 320, 200, 0, 0);
>  set_pallete(desktop_pallete);
>  textout_centre(screen, font, "Hello, world!", SCREEN_W/2, SCREEN_H/2, 255);
>  readkey();
>  return 0;
> }
> --------end---------

- Raw text -


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