1 
2 //          Copyright 2018 - 2021 Michael D. Parker
3 // Distributed under the Boost Software License, Version 1.0.
4 //    (See accompanying file LICENSE_1_0.txt or copy at
5 //          http://www.boost.org/LICENSE_1_0.txt)
6 
7 module bindbc.opengl.bind.dep.dep12;
8 
9 import bindbc.loader;
10 import bindbc.opengl.context;
11 import bindbc.opengl.bind.types;
12 
13 version(GL_AllowDeprecated) {
14     enum : uint {
15         GL_RESCALE_NORMAL                 = 0x803A,
16         GL_LIGHT_MODEL_COLOR_CONTROL      = 0x81F8,
17         GL_SINGLE_COLOR                   = 0x81F9,
18         GL_SEPARATE_SPECULAR_COLOR        = 0x81FA,
19         GL_ALIASED_POINT_SIZE_RANGE       = 0x846D,
20         GL_CONVOLUTION_1D                 = 0x8010,
21         GL_CONVOLUTION_2D                 = 0x8011,
22         GL_SEPARABLE_2D                   = 0x8012,
23         GL_CONVOLUTION_BORDER_MODE        = 0x8013,
24         GL_CONVOLUTION_FILTER_SCALE       = 0x8014,
25         GL_CONVOLUTION_FILTER_BIAS        = 0x8015,
26         GL_REDUCE                         = 0x8016,
27         GL_CONVOLUTION_FORMAT             = 0x8017,
28         GL_CONVOLUTION_WIDTH              = 0x8018,
29         GL_CONVOLUTION_HEIGHT             = 0x8019,
30         GL_MAX_CONVOLUTION_WIDTH          = 0x801A,
31         GL_MAX_CONVOLUTION_HEIGHT         = 0x801B,
32         GL_POST_CONVOLUTION_RED_SCALE     = 0x801C,
33         GL_POST_CONVOLUTION_GREEN_SCALE   = 0x801D,
34         GL_POST_CONVOLUTION_BLUE_SCALE    = 0x801E,
35         GL_POST_CONVOLUTION_ALPHA_SCALE   = 0x801F,
36         GL_POST_CONVOLUTION_RED_BIAS      = 0x8020,
37         GL_POST_CONVOLUTION_GREEN_BIAS    = 0x8021,
38         GL_POST_CONVOLUTION_BLUE_BIAS     = 0x8022,
39         GL_POST_CONVOLUTION_ALPHA_BIAS    = 0x8023,
40         GL_HISTOGRAM                      = 0x8024,
41         GL_PROXY_HISTOGRAM                = 0x8025,
42         GL_HISTOGRAM_WIDTH                = 0x8026,
43         GL_HISTOGRAM_FORMAT               = 0x8027,
44         GL_HISTOGRAM_RED_SIZE             = 0x8028,
45         GL_HISTOGRAM_GREEN_SIZE           = 0x8029,
46         GL_HISTOGRAM_BLUE_SIZE            = 0x802A,
47         GL_HISTOGRAM_ALPHA_SIZE           = 0x802B,
48         GL_HISTOGRAM_LUMINANCE_SIZE       = 0x802C,
49         GL_HISTOGRAM_SINK                 = 0x802D,
50         GL_MINMAX                         = 0x802E,
51         GL_MINMAX_FORMAT                  = 0x802F,
52         GL_MINMAX_SINK                    = 0x8030,
53         GL_TABLE_TOO_LARGE                = 0x8031,
54         GL_COLOR_MATRIX                   = 0x80B1,
55         GL_COLOR_MATRIX_STACK_DEPTH       = 0x80B2,
56         GL_MAX_COLOR_MATRIX_STACK_DEPTH   = 0x80B3,
57         GL_POST_COLOR_MATRIX_RED_SCALE    = 0x80B4,
58         GL_POST_COLOR_MATRIX_GREEN_SCALE  = 0x80B5,
59         GL_POST_COLOR_MATRIX_BLUE_SCALE   = 0x80B6,
60         GL_POST_COLOR_MATRIX_ALPHA_SCALE  = 0x80B7,
61         GL_POST_COLOR_MATRIX_RED_BIAS     = 0x80B8,
62         GL_POST_COLOR_MATRIX_GREEN_BIAS   = 0x80B9,
63         GL_POST_COLOR_MATRIX_BLUE_BIAS    = 0x80BA,
64         GL_POST_COLOR_MATRIX_ALPHA_BIAS   = 0x80BB,
65         GL_COLOR_TABLE                    = 0x80D0,
66         GL_POST_CONVOLUTION_COLOR_TABLE   = 0x80D1,
67         GL_POST_COLOR_MATRIX_COLOR_TABLE  = 0x80D2,
68         GL_PROXY_COLOR_TABLE              = 0x80D3,
69         GL_PROXY_POST_CONVOLUTION_COLOR_TABLE = 0x80D4,
70         GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE = 0x80D5,
71         GL_COLOR_TABLE_SCALE              = 0x80D6,
72         GL_COLOR_TABLE_BIAS               = 0x80D7,
73         GL_COLOR_TABLE_FORMAT             = 0x80D8,
74         GL_COLOR_TABLE_WIDTH              = 0x80D9,
75         GL_COLOR_TABLE_RED_SIZE           = 0x80DA,
76         GL_COLOR_TABLE_GREEN_SIZE         = 0x80DB,
77         GL_COLOR_TABLE_BLUE_SIZE          = 0x80DC,
78         GL_COLOR_TABLE_ALPHA_SIZE         = 0x80DD,
79         GL_COLOR_TABLE_LUMINANCE_SIZE     = 0x80DE,
80         GL_COLOR_TABLE_INTENSITY_SIZE     = 0x80DF,
81         GL_CONSTANT_BORDER                = 0x8151,
82         GL_REPLICATE_BORDER               = 0x8153,
83         GL_CONVOLUTION_BORDER_COLOR       = 0x8154,
84     }
85 
86     extern(System) @nogc nothrow {
87         alias pglColorTable = void function(GLenum, GLenum, GLsizei, GLenum, GLenum, const(void)*);
88         alias pglColorSubTable = void function(GLenum, GLsizei, GLsizei, GLenum, GLenum, const(void)*);
89         alias pglColorTableParameteriv = void function(GLenum, GLenum, const(GLint)*);
90         alias pglColorTableParameterfv = void function(GLenum, GLenum, const(GLfloat)*);
91         alias pglCopyColorSubTable = void function(GLenum, GLsizei, GLint, GLint, GLsizei);
92         alias pglCopyColorTable = void function(GLenum, GLenum, GLint, GLint, GLsizei);
93         alias pglGetColorTable = void function(GLenum, GLenum, GLenum, void*);
94         alias pglGetColorTableParameterfv = void function(GLenum, GLenum, GLfloat*);
95         alias pglGetColorTableParameteriv = void function(GLenum, GLenum, GLint*);
96         alias pglHistogram = void function(GLenum, GLsizei, GLenum, GLboolean);
97         alias pglResetHistogram = void function(GLenum);
98         alias pglGetHistogram = void function(GLenum, GLboolean, GLenum, GLenum, void*);
99         alias pglGetHistogramParameterfv = void function(GLenum, GLenum, GLfloat*);
100         alias pglGetHistogramParameteriv = void function(GLenum, GLenum, GLint*);
101         alias pglMinmax = void function(GLenum, GLenum, GLboolean);
102         alias pglResetMinmax = void function(GLenum);
103         alias pglGetMinmax = void function(GLenum, GLboolean, GLenum, GLenum, void*);
104         alias pglGetMinmaxParameterfv = void function(GLenum, GLenum, GLfloat*);
105         alias pglGetMinmaxParameteriv = void function(GLenum, GLenum, GLint*);
106         alias pglConvolutionFilter1D = void function(GLenum, GLenum, GLsizei, GLenum, GLenum, const(void)*);
107         alias pglConvolutionFilter2D = void function(GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const(void)*);
108         alias pglConvolutionParameterf = void function(GLenum, GLenum, GLfloat);
109         alias pglConvolutionParameterfv = void function(GLenum, GLenum, const(GLfloat)*);
110         alias pglConvolutionParameteri = void function(GLenum, GLenum, GLint);
111         alias pglConvolutionParameteriv = void function(GLenum, GLenum, const(GLint)*);
112         alias pglCopyConvolutionFilter1D = void function(GLenum, GLenum, GLint, GLint, GLsizei);
113         alias pglCopyConvolutionFilter2D = void function(GLenum, GLenum, GLint, GLint, GLsizei, GLsizei);
114         alias pglGetConvolutionFilter = void function(GLenum, GLenum, GLenum, void*);
115         alias pglGetConvolutionParameterfv = void function(GLenum, GLenum, GLfloat*);
116         alias pglGetConvolutionParameteriv = void function(GLenum, GLenum, GLint*);
117         alias pglSeparableFilter2D = void function(GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const(void)*, const(void)*);
118         alias pglGetSeparableFilter = void function(GLenum, GLenum, GLenum, void*, void*, void*);
119     }
120 
121     __gshared {
122         pglColorTable glColorTable;
123         pglColorSubTable glColorSubTable;
124         pglColorTableParameteriv glColorTableParameteriv;
125         pglColorTableParameterfv glColorTableParameterfv;
126         pglCopyColorSubTable glCopyColorSubTable;
127         pglCopyColorTable glCopyColorTable;
128         pglGetColorTable glGetColorTable;
129         pglGetColorTableParameterfv glGetColorTableParameterfv;
130         pglGetColorTableParameteriv glGetColorTableParameteriv;
131         pglHistogram glHistogram;
132         pglResetHistogram glResetHistogram;
133         pglGetHistogram glGetHistogram;
134         pglGetHistogramParameterfv glGetHistogramParameterfv;
135         pglGetHistogramParameteriv glGetHistogramParameteriv;
136         pglMinmax glMinmax;
137         pglResetMinmax glResetMinmax;
138         pglGetMinmax glGetMinmax;
139         pglGetMinmaxParameterfv glGetMinmaxParameterfv;
140         pglGetMinmaxParameteriv glGetMinmaxParameteriv;
141         pglConvolutionFilter1D glConvolutionFilter1D;
142         pglConvolutionFilter2D glConvolutionFilter2D;
143         pglConvolutionParameterf glConvolutionParameterf;
144         pglConvolutionParameterfv glConvolutionParameterfv;
145         pglConvolutionParameteri glConvolutionParameteri;
146         pglConvolutionParameteriv glConvolutionParameteriv;
147         pglCopyConvolutionFilter1D glCopyConvolutionFilter1D;
148         pglCopyConvolutionFilter2D glCopyConvolutionFilter2D;
149         pglGetConvolutionFilter glGetConvolutionFilter;
150         pglGetConvolutionParameterfv glGetConvolutionParameterfv;
151         pglGetConvolutionParameteriv glGetConvolutionParameteriv;
152         pglSeparableFilter2D glSeparableFilter2D;
153         pglGetSeparableFilter glGetSeparableFilter;
154     }
155 
156     package(bindbc.opengl.bind) @nogc nothrow
157     bool loadDeprecatedGL12(SharedLib lib)
158     {
159         lib.bindGLSymbol(cast(void**)&glColorTable, "glColorTable");
160         lib.bindGLSymbol(cast(void**)&glColorSubTable, "glColorSubTable");
161         lib.bindGLSymbol(cast(void**)&glColorTableParameteriv, "glColorTableParameteriv");
162         lib.bindGLSymbol(cast(void**)&glColorTableParameterfv, "glColorTableParameterfv");
163         lib.bindGLSymbol(cast(void**)&glCopyColorSubTable, "glCopyColorSubTable");
164         lib.bindGLSymbol(cast(void**)&glCopyColorTable, "glCopyColorTable");
165         lib.bindGLSymbol(cast(void**)&glGetColorTable, "glGetColorTable");
166         lib.bindGLSymbol(cast(void**)&glGetColorTableParameterfv, "glGetColorTableParameterfv");
167         lib.bindGLSymbol(cast(void**)&glGetColorTableParameteriv, "glGetColorTableParameteriv");
168         lib.bindGLSymbol(cast(void**)&glHistogram, "glHistogram");
169         lib.bindGLSymbol(cast(void**)&glResetHistogram, "glResetHistogram");
170         lib.bindGLSymbol(cast(void**)&glGetHistogram, "glGetHistogram");
171         lib.bindGLSymbol(cast(void**)&glGetHistogramParameterfv, "glGetHistogramParameterfv");
172         lib.bindGLSymbol(cast(void**)&glGetHistogramParameteriv, "glGetHistogramParameteriv");
173         lib.bindGLSymbol(cast(void**)&glMinmax, "glMinmax");
174         lib.bindGLSymbol(cast(void**)&glResetMinmax, "glResetMinmax");
175         lib.bindGLSymbol(cast(void**)&glGetMinmax, "glGetMinmax");
176         lib.bindGLSymbol(cast(void**)&glGetMinmaxParameterfv, "glGetMinmaxParameterfv");
177         lib.bindGLSymbol(cast(void**)&glGetMinmaxParameteriv, "glGetMinmaxParameteriv");
178         lib.bindGLSymbol(cast(void**)&glConvolutionFilter1D, "glConvolutionFilter1D");
179         lib.bindGLSymbol(cast(void**)&glConvolutionFilter2D, "glConvolutionFilter2D");
180         lib.bindGLSymbol(cast(void**)&glConvolutionParameterf, "glConvolutionParameterf");
181         lib.bindGLSymbol(cast(void**)&glConvolutionParameterfv, "glConvolutionParameterfv");
182         lib.bindGLSymbol(cast(void**)&glConvolutionParameteri, "glConvolutionParameteri");
183         lib.bindGLSymbol(cast(void**)&glConvolutionParameteriv, "glConvolutionParameteriv");
184         lib.bindGLSymbol(cast(void**)&glCopyConvolutionFilter1D, "glCopyConvolutionFilter1D");
185         lib.bindGLSymbol(cast(void**)&glCopyConvolutionFilter2D, "glCopyConvolutionFilter2D");
186         lib.bindGLSymbol(cast(void**)&glGetConvolutionFilter, "glGetConvolutionFilter");
187         lib.bindGLSymbol(cast(void**)&glGetConvolutionParameterfv, "glGetConvolutionParameterfv");
188         lib.bindGLSymbol(cast(void**)&glGetConvolutionParameteriv, "glGetConvolutionParameteriv");
189         lib.bindGLSymbol(cast(void**)&glSeparableFilter2D, "glSeparableFilter2D");
190         lib.bindGLSymbol(cast(void**)&glGetSeparableFilter, "glGetSeparableFilter");
191 
192         return errorCountGL() == 0;
193     }
194 }