ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/radogl.h
Revision: 3.7
Committed: Fri Jun 6 16:38:47 2003 UTC (20 years, 10 months ago) by schorsch
Content type: text/plain
Branch: MAIN
Changes since 3.6: +12 -44 lines
Log Message:
*** empty log message ***

File Contents

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