ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/radogl.h
Revision: 3.11
Committed: Tue Sep 16 06:31:48 2003 UTC (20 years, 7 months ago) by greg
Content type: text/plain
Branch: MAIN
CVS Tags: rad3R7P2, rad3R7P1, rad4R1, rad4R0, rad3R6, rad3R6P1, rad3R8, rad3R9
Changes since 3.10: +2 -2 lines
Log Message:
Fixed prototype for freemtl() to match function pointer in lookup.h

File Contents

# User Rev Content
1 greg 3.11 /* RCSid $Id: radogl.h,v 3.10 2003/07/14 22:23:59 schorsch Exp $ */
2 gwlarson 3.1 /*
3     * Header file for Radiance - OpenGL routines.
4     */
5 schorsch 3.7 #ifndef _RAD_RADOGL_H_
6     #define _RAD_RADOGL_H_
7 greg 3.4
8 gwlarson 3.1 #include "standard.h"
9 gwlarson 3.3 #include <GL/glu.h>
10 gwlarson 3.1 #include "color.h"
11     #include "object.h"
12     #include "otypes.h"
13     #include "lookup.h"
14 schorsch 3.10
15     #ifdef __cplusplus
16     extern "C" {
17     #endif
18 gwlarson 3.1
19     #define MAXLIGHTS 8 /* number of OGL light sources */
20    
21     #define MAXSPECEXP 128. /* maximum allowed specular exponent */
22     #define UNKSPECEXP 25. /* value to use when exponent unknown */
23    
24     typedef struct {
25     short type; /* material type (from otypes.h) */
26     short nlinks; /* number of links to this material */
27     union {
28     struct {
29     COLOR ambdiff; /* ambient and diffuse color */
30     COLOR specular; /* specular color */
31     GLfloat specexp; /* specular exponent */
32     } m; /* regular material */
33     struct {
34     COLOR emission; /* emitting component */
35     GLfloat spotdir[3]; /* spot direction */
36     GLfloat spotang; /* spot cutoff angle */
37     } l; /* light source */
38     } u; /* union of types */
39     } MATREC; /* OGL material properties */
40    
41     extern double expval; /* global exposure value */
42     extern COLOR ambval; /* global ambient value */
43 gwlarson 3.2 extern int glightid[MAXLIGHTS]; /* OpenGL GL_LIGHTi values */
44 gwlarson 3.1 extern int dolights; /* are we outputting light sources? */
45     extern int domats; /* are we doing materials? */
46    
47     extern LUTAB mtab; /* material/modifier lookup table */
48    
49 greg 3.4 #define issrcmat(m) ((m) != NULL && islight((m)->type) && \
50     (m)->type != MAT_GLOW)
51    
52     /* defined in rgldomat.c */
53     extern void domatobj(MATREC *mp, FVECT cent);
54     extern void domatvert(MATREC *mp, FVECT v, FVECT n);
55     /* defined in rglfile.c */
56     extern int newglist(void);
57     extern void rgl_checkerr(char *where);
58     extern int rgl_filelist(int ic, char **inp, int *nl);
59 schorsch 3.8 extern int rgl_octlist(char *fname, FVECT cent, RREAL *radp, int *nl);
60 greg 3.4 extern void rgl_load(char *inpspec);
61     extern void rgl_object(char *name, FILE *fp);
62     /* defined in rglinst.c */
63     extern int o_instance(OBJREC *o);
64     extern int loadoctrees(void);
65     extern double checkoct(char *fname, FVECT cent);
66     extern int loadoct(char *fname);
67     /* defined in rglmat.c */
68     extern void rgl_matclear(void);
69     extern MATREC *getmatp(char *nam);
70     extern int o_default(OBJREC *o);
71 greg 3.6 extern int o_unsupported(OBJREC *o);
72 greg 3.4 extern MATREC *newmaterial(char *nam);
73 greg 3.11 extern void freemtl(void *p);
74 greg 3.4 extern int m_normal(OBJREC *o);
75     extern int m_aniso(OBJREC *o);
76     extern int m_glass(OBJREC *o);
77     extern int m_brdf(OBJREC *o);
78     extern int m_brdf2(OBJREC *o);
79     extern int m_light(OBJREC *o);
80     extern int m_mirror(OBJREC *o);
81     extern int m_prism(OBJREC *o);
82     /* defined in rglsrc.c */
83     extern void lightinit(void);
84     extern void lightclean(void);
85     extern void lightdefs(void);
86     extern int o_source(OBJREC *o);
87     extern int doflatsrc(MATREC *m, FVECT pos, FVECT norm, double area);
88     extern int dosphsrc(MATREC *m, FVECT pos, double area);
89     /* defined in rglsurf.c */
90     extern void setmaterial(MATREC *mp, FVECT cent, int ispoly);
91     extern double polyarea(FVECT cent, FVECT norm, int n, FVECT v[]);
92     extern int o_face(OBJREC *o);
93     extern void surfclean(void);
94     extern int o_sphere(OBJREC *o);
95     extern int o_cone(OBJREC *o);
96     extern int o_ring(OBJREC *o);
97 gwlarson 3.1
98 schorsch 3.7
99     #ifdef __cplusplus
100     }
101 greg 3.4 #endif
102 schorsch 3.7 #endif /* _RAD_RADOGL_H_ */
103