delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/16/11:48:08

From: Shawn Hargreaves <Shawn AT talula DOT demon DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Allegros quad3d function HELP NEEDED. PLEASE ;-)
Date: Sun, 16 Mar 1997 11:11:32 +0000
Organization: None
Distribution: world
Message-ID: <JjOxPAAkV9KzEwXL@talula.demon.co.uk>
References: <tQhk9AA8R4HzEwpx AT jenkinsdavid DOT demon DOT co DOT uk>
<or1VzBAaUjKzEwS2 AT jenkinsdavid DOT demon DOT co DOT uk>
<bihl$LAZFsKzEwE2 AT talula DOT demon DOT co DOT uk>
<RHE9cJAji5KzEw2q AT jenkinsdavid DOT demon DOT co DOT uk>
NNTP-Posting-Host: talula.demon.co.uk
MIME-Version: 1.0
Lines: 27
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

David Jenkins writes:
>Why doesn't the following work???
[snip]
>        v2d[d].y = CENT_Y - (LENS * plotted[d].y / dist);
>    }
>
>/***************
>This is where I get a "parse before vtx1 error".
>*******/
>    V3D_f vtx1 = {  v2d[0].x, v2d[0].y,  0,   0,   0,   255   };

You are declaring a variable (vtx1) in the middle of a function, and you
can't do that in C. Solutions:

- move the definition to the top of your function

- compile as C++ instead (rename the file from .c to .cpp)

- make a local scope block containing the V3D_f structures and the call 
  to quad3d_f(), by enclosing that chunk of code in braces. Ugly, but it
  works...


/*
 *  Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/
 *  Beauty is a French phonetic corruption of a short cloth neck ornament.
 */

- Raw text -


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