~ubuntu-branches/ubuntu/warty/aqsis/warty

« back to all changes in this revision

Viewing changes to libslxargs/slx.h

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones
  • Date: 2004-08-24 07:25:04 UTC
  • Revision ID: james.westby@ubuntu.com-20040824072504-zf993vnevvisdsvb
Tags: upstream-0.9.1
Import upstream version 0.9.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Aqsis
 
2
// Copyright � 1997 - 2001, Paul C. Gregory
 
3
//
 
4
// Contact: pgregory@aqsis.com
 
5
//
 
6
// This library is free software; you can redistribute it and/or
 
7
// modify it under the terms of the GNU General Public
 
8
// License as published by the Free Software Foundation; either
 
9
// version 2 of the License, or (at your option) any later version.
 
10
//
 
11
// This library is distributed in the hope that it will be useful,
 
12
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
14
// General Public License for more details.
 
15
//
 
16
// You should have received a copy of the GNU General Public
 
17
// License along with this library; if not, write to the Free Software
 
18
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
19
 
 
20
 
 
21
/** \file
 
22
                \brief Implements libslxargs, analogous to Pixar's sloarg library.
 
23
                \author Douglas Ward (dsward@vidi.com)
 
24
*/
 
25
 
 
26
#ifndef SLX_H_INCLUDED
 
27
#define SLX_H_INCLUDED 1
 
28
 
 
29
#ifdef __cplusplus
 
30
extern "C"
 
31
{
 
32
#endif
 
33
 
 
34
    typedef enum {
 
35
        SLX_TYPE_UNKNOWN,
 
36
        SLX_TYPE_POINT,
 
37
        SLX_TYPE_COLOR,
 
38
        SLX_TYPE_SCALAR,
 
39
        SLX_TYPE_STRING,
 
40
        SLX_TYPE_SURFACE,
 
41
        SLX_TYPE_LIGHT,
 
42
        SLX_TYPE_DISPLACEMENT,
 
43
        SLX_TYPE_VOLUME,
 
44
        SLX_TYPE_TRANSFORMATION,
 
45
        SLX_TYPE_IMAGER,
 
46
        SLX_TYPE_VECTOR,
 
47
        SLX_TYPE_NORMAL,
 
48
        SLX_TYPE_MATRIX
 
49
    } SLX_TYPE;
 
50
 
 
51
    typedef enum {
 
52
        SLX_STOR_UNKNOWN,
 
53
        SLX_STOR_CONSTANT,
 
54
        SLX_STOR_VARIABLE,
 
55
        SLX_STOR_TEMPORARY,
 
56
        SLX_STOR_PARAMETER,
 
57
        SLX_STOR_GSTATE
 
58
    } SLX_STORAGE;
 
59
 
 
60
    typedef enum {
 
61
        SLX_DETAIL_UNKNOWN,
 
62
        SLX_DETAIL_VARYING,
 
63
        SLX_DETAIL_UNIFORM
 
64
    } SLX_DETAIL;
 
65
 
 
66
    typedef struct
 
67
    {
 
68
        float   xval;
 
69
        float   yval;
 
70
        float   zval;
 
71
    }
 
72
    SLX_POINT;
 
73
 
 
74
    typedef struct
 
75
    {
 
76
        float   val[4][4];
 
77
    }
 
78
    SLX_MATRIX;
 
79
 
 
80
    typedef float SLX_SCALAR;
 
81
 
 
82
    typedef struct SLXvissymdef
 
83
    {
 
84
        char *svd_name;
 
85
        SLX_TYPE svd_type;
 
86
        SLX_STORAGE svd_storage;
 
87
        SLX_DETAIL svd_detail;
 
88
        char *  svd_spacename;
 
89
        int     svd_arraylen;
 
90
        union {
 
91
            SLX_POINT   *pointval;
 
92
            SLX_SCALAR  *scalarval;
 
93
            SLX_MATRIX  *matrixval;
 
94
            char        **stringval;
 
95
        } svd_default;
 
96
    }
 
97
    SLX_VISSYMDEF;
 
98
 
 
99
#define NULL_SLXVISSYMDEF ((SLX_VISSYMDEF *)0)
 
100
 
 
101
    extern void SLX_SetPath ( char * path );
 
102
    extern char *SLX_GetPath ( void );
 
103
    extern int SLX_SetShader ( char * name );
 
104
    extern char *SLX_GetName ( void );
 
105
    extern SLX_TYPE SLX_GetType ( void );
 
106
    extern int SLX_GetNArgs ( void );
 
107
    extern SLX_VISSYMDEF *SLX_GetArgById ( int id );
 
108
    extern SLX_VISSYMDEF *SLX_GetArgByName ( char * name );
 
109
    extern SLX_VISSYMDEF *SLX_GetArrayArgElement( SLX_VISSYMDEF * array, int index );
 
110
    extern void SLX_EndShader ( void );
 
111
    extern char *SLX_TypetoStr ( SLX_TYPE type );
 
112
    extern char *SLX_StortoStr ( SLX_STORAGE storage );
 
113
    extern char *SLX_DetailtoStr ( SLX_DETAIL detail );
 
114
 
 
115
#ifdef __cplusplus
 
116
}
 
117
#endif
 
118
 
 
119
#endif /* SLX_H_INCLUDED */