~ubuntu-branches/ubuntu/lucid/meshlab/lucid

« back to all changes in this revision

Viewing changes to meshlab/src/meshlabplugins/render_splatpyramid/shaderStructs.h

  • Committer: Bazaar Package Importer
  • Author(s): Teemu Ikonen
  • Date: 2009-10-08 16:40:41 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20091008164041-0c2ealqv8b8uc20c
Tags: 1.2.2-1
* New upstream version
* Do not build filter_isoparametrization because liblevmar dependency
  is not (yet) in Debian
* Fix compilation with gcc-4.4, thanks to Jonathan Liu for the patch
  (closes: #539544)
* rules: Add compiler variables to the qmake call (for testing with new
  GCC versions)
* io_3ds.pro: Make LIBS and INCLUDEPATH point to Debian version of lib3ds
* io_epoch.pro: Make LIBS point to Debian version of libbz2
* control:
  - Move Homepage URL to the source package section
  - Update to standards-version 3.8.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef SHDRSTRUCTS
 
2
#define SHDRSTRUCTS
 
3
 
 
4
#include <map>
 
5
#include <QString>
 
6
#include <vector>
 
7
 
 
8
struct UniformVariable {
 
9
        short type;
 
10
        short widget;
 
11
        float min;
 
12
        float max;
 
13
        float step;
 
14
        int location;
 
15
        union {
 
16
                int ival[4];
 
17
                float fval[4];
 
18
        };
 
19
};
 
20
 
 
21
struct TextureInfo {
 
22
        QString path;
 
23
        GLuint tId;
 
24
        short MinFilter;
 
25
        short   MagFilter;
 
26
        short   Target;
 
27
        short   WrapS;  
 
28
        short   WrapT;
 
29
        short   WrapR;
 
30
};
 
31
 
 
32
 
 
33
struct ShaderInfo {
 
34
        QString vpFile;
 
35
        QString fpFile;
 
36
        std::map<QString, UniformVariable> uniformVars;
 
37
        std::map<int, QString> glStatus;
 
38
        std::vector<TextureInfo> textureInfo;
 
39
        int shaderProg;
 
40
};
 
41
 
 
42
enum {
 
43
        SINGLE_INT = 1,
 
44
        SINGLE_FLOAT = 5,
 
45
        ARRAY_2_FLOAT = 6,
 
46
        ARRAY_3_FLOAT = 7,
 
47
        ARRAY_4_FLOAT = 8
 
48
};
 
49
 
 
50
static int getVarsNumber(int i) {
 
51
        switch (i) {
 
52
                case SINGLE_INT: return 1; break; 
 
53
                case SINGLE_FLOAT: return 1; break;
 
54
                case ARRAY_2_FLOAT: return 2; break;
 
55
                case ARRAY_3_FLOAT: return 3; break;
 
56
                case ARRAY_4_FLOAT: return 4; break;
 
57
                default: return 0; break;
 
58
        }
 
59
}
 
60
 
 
61
 
 
62
enum {
 
63
        WIDGET_NONE = 0,
 
64
        WIDGET_COLOR = 1,
 
65
        WIDGET_SLIDER = 2
 
66
};
 
67
 
 
68
enum {
 
69
        SHADE = 0,
 
70
        ALPHA_TEST,
 
71
        ALPHA_FUNC,
 
72
        ALPHA_CLAMP,
 
73
        BLENDING,
 
74
        BLEND_FUNC_SRC,
 
75
        BLEND_FUNC_DST,
 
76
        BLEND_EQUATION,
 
77
        DEPTH_TEST,
 
78
        DEPTH_FUNC,
 
79
        CLAMP_NEAR,
 
80
        CLAMP_FAR,
 
81
        CLEAR_COLOR_R,
 
82
        CLEAR_COLOR_G,
 
83
        CLEAR_COLOR_B,
 
84
        CLEAR_COLOR_A
 
85
};
 
86
 
 
87
#endif