Tatooine
texsettings.h
Go to the documentation of this file.
1#ifndef TATOOINE_GL_TEXSETTINGS_H
2#define TATOOINE_GL_TEXSETTINGS_H
3//==============================================================================
4#include "glincludes.h"
5#include "gltype.h"
6#include "texcomponents.h"
7//==============================================================================
9//==============================================================================
10template <typename T, typename format>
11struct settings;
12//------------------------------------------------------------------------------
13// GLubyte
14//------------------------------------------------------------------------------
15template <>
16struct settings<GLubyte, R> {
17 using real_type = GLubyte;
19 static constexpr GLint internal_format = GL_R8UI;
20 static constexpr GLenum format = GL_RED;
21 static constexpr GLenum type = gl_type_v<real_type>;
22};
23// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
24template <>
25struct settings<GLubyte, RG> {
26 using real_type = GLubyte;
28 static constexpr GLint internal_format = GL_RG8UI;
29 static constexpr GLenum format = GL_RG;
30 static constexpr GLenum type = gl_type_v<real_type>;
31};
32// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
33template <>
34struct settings<GLubyte, RGB> {
35 using real_type = GLubyte;
37 static constexpr GLint internal_format = GL_RGB8UI;
38 static constexpr GLenum format = GL_RGB;
39 static constexpr GLenum type = gl_type_v<real_type>;
40};
41// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
42template <>
43struct settings<GLubyte, RGBA> {
44 using real_type = GLubyte;
46 static constexpr GLint internal_format = GL_RGBA;
47 static constexpr GLenum format = GL_RGBA;
48 static constexpr GLenum type = gl_type_v<real_type>;
49};
50// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
51template <>
52struct settings<GLubyte, BGR> {
53 using real_type = GLubyte;
55 static constexpr GLint internal_format = GL_RGB8UI;
56 static constexpr GLenum format = GL_BGR;
57 static constexpr GLenum type = gl_type_v<real_type>;
58};
59// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
60template <>
61struct settings<GLubyte, BGRA> {
62 using real_type = GLubyte;
64 static constexpr GLint internal_format = GL_RGBA8UI;
65 static constexpr GLenum format = GL_BGRA;
66 static constexpr GLenum type = gl_type_v<real_type>;
67};
68//------------------------------------------------------------------------------
69// GLbyte
70//------------------------------------------------------------------------------
71template <>
72struct settings<GLbyte, R> {
73 using real_type = GLbyte;
75 static constexpr GLint internal_format = GL_R8I;
76 static constexpr GLenum format = GL_RED;
77 static constexpr GLenum type = gl_type_v<real_type>;
78};
79// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
80template <>
81struct settings<GLbyte, RG> {
82 using real_type = GLbyte;
84 static constexpr GLint internal_format = GL_RG8I;
85 static constexpr GLenum format = GL_RG;
86 static constexpr GLenum type = gl_type_v<real_type>;
87};
88// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
89template <>
90struct settings<GLbyte, RGB> {
91 using real_type = GLbyte;
93 static constexpr GLint internal_format = GL_RGB8I;
94 static constexpr GLenum format = GL_RGB;
95 static constexpr GLenum type = gl_type_v<real_type>;
96};
97// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
98template <>
99struct settings<GLbyte, RGBA> {
100 using real_type = GLbyte;
102 static constexpr GLint internal_format = GL_RGBA8I;
103 static constexpr GLenum format = GL_RGBA;
104 static constexpr GLenum type = gl_type_v<real_type>;
105};
106// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
107template <>
108struct settings<GLbyte, BGR> {
109 using real_type = GLbyte;
111 static constexpr GLint internal_format = GL_RGB8I;
112 static constexpr GLenum format = GL_BGR;
113 static constexpr GLenum type = gl_type_v<real_type>;
114};
115// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
116template <>
117struct settings<GLbyte, BGRA> {
118 using real_type = GLbyte;
120 static constexpr GLint internal_format = GL_RGBA8I;
121 static constexpr GLenum format = GL_BGRA;
122 static constexpr GLenum type = gl_type_v<real_type>;
123};
124//------------------------------------------------------------------------------
125// GLushort
126template <>
127struct settings<GLushort, R> {
128 using real_type = GLushort;
130 static constexpr GLint internal_format = GL_R16UI;
131 static constexpr GLenum format = GL_RED;
132 static constexpr GLenum type = gl_type_v<real_type>;
133};
134// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
135template <>
136struct settings<GLushort, RG> {
137 using real_type = GLushort;
139 static constexpr GLint internal_format = GL_RG16UI;
140 static constexpr GLenum format = GL_RG;
141 static constexpr GLenum type = gl_type_v<real_type>;
142};
143// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
144template <>
145struct settings<GLushort, RGB> {
146 using real_type = GLushort;
148 static constexpr GLint internal_format = GL_RGB16UI;
149 static constexpr GLenum format = GL_RGB;
150 static constexpr GLenum type = gl_type_v<real_type>;
151};
152// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
153template <>
154struct settings<GLushort, RGBA> {
155 using real_type = GLushort;
157 static constexpr GLint internal_format = GL_RGBA16UI;
158 static constexpr GLenum format = GL_RGBA;
159 static constexpr GLenum type = gl_type_v<real_type>;
160};
161// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
162template <>
163struct settings<GLushort, BGR> {
164 using real_type = GLushort;
166 static constexpr GLint internal_format = GL_RGB16UI;
167 static constexpr GLenum format = GL_BGR;
168 static constexpr GLenum type = gl_type_v<real_type>;
169};
170// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
171template <>
172struct settings<GLushort, BGRA> {
173 using real_type = GLushort;
175 static constexpr GLint internal_format = GL_RGBA16UI;
176 static constexpr GLenum format = GL_BGRA;
177 static constexpr GLenum type = gl_type_v<real_type>;
178};
179//------------------------------------------------------------------------------
180// GLshort
181//------------------------------------------------------------------------------
182template <>
183struct settings<GLshort, R> {
184 using real_type = GLshort;
186 static constexpr GLint internal_format = GL_R16I;
187 static constexpr GLenum format = GL_RED;
188 static constexpr GLenum type = gl_type_v<real_type>;
189};
190// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
191template <>
192struct settings<GLshort, RG> {
193 using real_type = GLshort;
195 static constexpr GLint internal_format = GL_RG16I;
196 static constexpr GLenum format = GL_RG;
197 static constexpr GLenum type = gl_type_v<real_type>;
198};
199// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
200template <>
201struct settings<GLshort, RGB> {
202 using real_type = GLshort;
204 static constexpr GLint internal_format = GL_RGB16I;
205 static constexpr GLenum format = GL_RGB;
206 static constexpr GLenum type = gl_type_v<real_type>;
207};
208// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
209template <>
210struct settings<GLshort, RGBA> {
211 using real_type = GLshort;
213 static constexpr GLint internal_format = GL_RGBA16I;
214 static constexpr GLenum format = GL_RGBA;
215 static constexpr GLenum type = gl_type_v<real_type>;
216};
217// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
218template <>
219struct settings<GLshort, BGR> {
220 using real_type = GLshort;
222 static constexpr GLint internal_format = GL_RGB16I;
223 static constexpr GLenum format = GL_BGR;
224 static constexpr GLenum type = gl_type_v<real_type>;
225};
226// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
227template <>
228struct settings<GLshort, BGRA> {
229 using real_type = GLshort;
231 static constexpr GLint internal_format = GL_RGBA16I;
232 static constexpr GLenum format = GL_BGRA;
233 static constexpr GLenum type = gl_type_v<real_type>;
234};
235//------------------------------------------------------------------------------
236// GLuint
237//------------------------------------------------------------------------------
238template <>
239struct settings<GLuint, R> {
242 static constexpr GLint internal_format = GL_R32UI;
243 static constexpr GLenum format = GL_RED_INTEGER;
244 static constexpr GLenum type = gl_type_v<real_type>;
245};
246// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
247template <>
251 static constexpr GLint internal_format = GL_RG32UI;
252 static constexpr GLenum format = GL_RG_INTEGER;
253 static constexpr GLenum type = gl_type_v<real_type>;
254};
255// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
256template <>
260 static constexpr GLint internal_format = GL_RGB32UI;
261 static constexpr GLenum format = GL_RGB_INTEGER;
262 static constexpr GLenum type = gl_type_v<real_type>;
263};
264// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
265template <>
269 static constexpr GLint internal_format = GL_RGBA32UI;
270 static constexpr GLenum format = GL_RGBA_INTEGER;
271 static constexpr GLenum type = gl_type_v<real_type>;
272};
273// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
274template <>
278 static constexpr GLint internal_format = GL_RGB32UI;
279 static constexpr GLenum format = GL_BGR_INTEGER;
280 static constexpr GLenum type = gl_type_v<real_type>;
281};
282// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
283template <>
287 static constexpr GLint internal_format = GL_RGBA32UI;
288 static constexpr GLenum format = GL_BGRA_INTEGER;
289 static constexpr GLenum type = gl_type_v<real_type>;
290};
291//------------------------------------------------------------------------------
292// GLint
293//------------------------------------------------------------------------------
294template <>
295struct settings<GLint, R> {
296 using real_type = GLint;
298 static constexpr GLint internal_format = GL_R32I;
299 static constexpr GLenum format = GL_RED_INTEGER;
300 static constexpr GLenum type = gl_type_v<real_type>;
301};
302// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
303template <>
304struct settings<GLint, RG> {
305 using real_type = GLint;
307 static constexpr GLint internal_format = GL_RG32I;
308 static constexpr GLenum format = GL_RG_INTEGER;
309 static constexpr GLenum type = gl_type_v<real_type>;
310};
311// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
312template <>
313struct settings<GLint, RGB> {
314 using real_type = GLint;
316 static constexpr GLint internal_format = GL_RGB32I;
317 static constexpr GLenum format = GL_RGB_INTEGER;
318 static constexpr GLenum type = gl_type_v<real_type>;
319};
320// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
321template <>
322struct settings<GLint, RGBA> {
323 using real_type = GLint;
325 static constexpr GLint internal_format = GL_RGBA32I;
326 static constexpr GLenum format = GL_RGBA_INTEGER;
327 static constexpr GLenum type = gl_type_v<real_type>;
328};
329// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
330template <>
331struct settings<GLint, BGR> {
332 using real_type = GLint;
334 static constexpr GLint internal_format = GL_RGB32I;
335 static constexpr GLenum format = GL_BGR_INTEGER;
336 static constexpr GLenum type = gl_type_v<real_type>;
337};
338// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
339template <>
340struct settings<GLint, BGRA> {
341 using real_type = GLint;
343 static constexpr GLint internal_format = GL_RGBA32I;
344 static constexpr GLenum format = GL_BGRA_INTEGER;
345 static constexpr GLenum type = gl_type_v<real_type>;
346};
347//------------------------------------------------------------------------------
348// GLhalf
349//------------------------------------------------------------------------------
350template <>
351struct settings<gl_half, R> {
352 using real_type = GLhalf;
354 static constexpr GLint internal_format = GL_R16F;
355 static constexpr GLenum format = GL_RED;
356 static constexpr GLenum type = gl_type_v<real_type>;
357};
358// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
359template <>
360struct settings<gl_half, RG> {
361 using real_type = GLhalf;
363 static constexpr GLint internal_format = GL_RG16F;
364 static constexpr GLenum format = GL_RG;
365 static constexpr GLenum type = gl_type_v<real_type>;
366};
367// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
368template <>
369struct settings<gl_half, RGB> {
370 using real_type = GLhalf;
372 static constexpr GLint internal_format = GL_RGB16F;
373 static constexpr GLenum format = GL_RGB;
374 static constexpr GLenum type = gl_type_v<real_type>;
375};
376// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
377template <>
378struct settings<gl_half, RGBA> {
379 using real_type = GLhalf;
381 static constexpr GLint internal_format = GL_RGBA16F;
382 static constexpr GLenum format = GL_RGBA;
383 static constexpr GLenum type = gl_type_v<real_type>;
384};
385// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
386template <>
387struct settings<gl_half, BGR> {
388 using real_type = GLhalf;
390 static constexpr GLint internal_format = GL_RGB16F;
391 static constexpr GLenum format = GL_BGR;
392 static constexpr GLenum type = gl_type_v<real_type>;
393};
394// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
395template <>
396struct settings<gl_half, BGRA> {
397 using real_type = GLhalf;
399 static constexpr GLint internal_format = GL_RGBA16F;
400 static constexpr GLenum format = GL_BGRA;
401 static constexpr GLenum type = gl_type_v<real_type>;
402};
403//------------------------------------------------------------------------------
404// GLfloat
405template <>
406struct settings<GLfloat, R> {
407 using real_type = GLfloat;
409 static constexpr GLint internal_format = GL_R32F;
410 static constexpr GLenum format = GL_RED;
411 static constexpr GLenum type = gl_type_v<real_type>;
412};
413// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
414template <>
415struct settings<GLfloat, RG> {
416 using real_type = GLfloat;
418 static constexpr GLint internal_format = GL_RG32F;
419 static constexpr GLenum format = GL_RG;
420 static constexpr GLenum type = gl_type_v<real_type>;
421};
422// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
423template <>
424struct settings<GLfloat, RGB> {
425 using real_type = GLfloat;
427 static constexpr GLint internal_format = GL_RGB32F;
428 static constexpr GLenum format = GL_RGB;
429 static constexpr GLenum type = gl_type_v<real_type>;
430};
431// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
432template <>
433struct settings<GLfloat, RGBA> {
434 using real_type = GLfloat;
436 static constexpr GLint internal_format = GL_RGBA32F;
437 static constexpr GLenum format = GL_RGBA;
438 static constexpr GLenum type = gl_type_v<real_type>;
439};
440// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
441template <>
442struct settings<GLfloat, BGR> {
443 using real_type = GLfloat;
445 static constexpr GLint internal_format = GL_RGB32F;
446 static constexpr GLenum format = GL_BGR;
447 static constexpr GLenum type = gl_type_v<real_type>;
448};
449// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
450template <>
451struct settings<GLfloat, BGRA> {
452 using real_type = GLfloat;
454 static constexpr GLint internal_format = GL_RGBA32F;
455 static constexpr GLenum format = GL_BGRA;
456 static constexpr GLenum type = gl_type_v<real_type>;
457};
458//------------------------------------------------------------------------------
459// Depth
460template <>
461struct settings<GLushort, Depth> {
462 using real_type = GLushort;
464 static constexpr GLint internal_format = GL_DEPTH_COMPONENT16;
465 static constexpr GLenum format = GL_DEPTH_COMPONENT;
466 static constexpr GLenum type = gl_type_v<real_type>;
467};
468// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
469template <>
471 using real_type = GLint;
473 static constexpr GLint internal_format = GL_DEPTH_COMPONENT32;
474 static constexpr GLenum format = GL_DEPTH_COMPONENT;
475 static constexpr GLenum type = gl_type_v<real_type>;
476};
477// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
478struct depth24 {};
479template <>
483 static constexpr GLint internal_format = GL_DEPTH_COMPONENT24;
484 static constexpr GLenum format = GL_DEPTH_COMPONENT;
485 static constexpr GLenum type = GL_UNSIGNED_BYTE;
486};
487// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
488template <>
489struct settings<GLfloat, Depth> {
490 using real_type = GLint;
492 static constexpr GLint internal_format = GL_DEPTH_COMPONENT32F;
493 static constexpr GLenum format = GL_DEPTH_COMPONENT;
494 static constexpr GLenum type = gl_type_v<real_type>;
495};
496//==============================================================================
497} // namespace tatooine::gl::tex
498//==============================================================================
499#endif
Definition: texsettings.h:8
Definition: texcomponents.h:24
Definition: texcomponents.h:21
Definition: texcomponents.h:27
Definition: texcomponents.h:18
Definition: texcomponents.h:15
Definition: texcomponents.h:12
Definition: texcomponents.h:9
Definition: texsettings.h:478
GLbyte real_type
Definition: texsettings.h:118
GLbyte real_type
Definition: texsettings.h:109
GLbyte real_type
Definition: texsettings.h:100
GLbyte real_type
Definition: texsettings.h:91
GLbyte real_type
Definition: texsettings.h:82
GLbyte real_type
Definition: texsettings.h:73
GLfloat real_type
Definition: texsettings.h:452
GLfloat real_type
Definition: texsettings.h:443
GLint real_type
Definition: texsettings.h:490
GLfloat real_type
Definition: texsettings.h:434
GLfloat real_type
Definition: texsettings.h:425
GLfloat real_type
Definition: texsettings.h:416
GLfloat real_type
Definition: texsettings.h:407
GLint real_type
Definition: texsettings.h:341
GLint real_type
Definition: texsettings.h:332
GLint real_type
Definition: texsettings.h:323
GLint real_type
Definition: texsettings.h:314
GLint real_type
Definition: texsettings.h:305
GLint real_type
Definition: texsettings.h:296
GLshort real_type
Definition: texsettings.h:229
GLshort real_type
Definition: texsettings.h:220
GLshort real_type
Definition: texsettings.h:211
GLshort real_type
Definition: texsettings.h:202
GLshort real_type
Definition: texsettings.h:193
GLshort real_type
Definition: texsettings.h:184
GLubyte real_type
Definition: texsettings.h:62
GLubyte real_type
Definition: texsettings.h:53
GLubyte real_type
Definition: texsettings.h:44
GLubyte real_type
Definition: texsettings.h:35
GLubyte real_type
Definition: texsettings.h:26
GLubyte real_type
Definition: texsettings.h:17
GLint real_type
Definition: texsettings.h:471
GLushort real_type
Definition: texsettings.h:173
GLushort real_type
Definition: texsettings.h:164
GLushort real_type
Definition: texsettings.h:462
GLushort real_type
Definition: texsettings.h:155
GLushort real_type
Definition: texsettings.h:146
GLushort real_type
Definition: texsettings.h:137
GLushort real_type
Definition: texsettings.h:128
GLhalf real_type
Definition: texsettings.h:397
GLhalf real_type
Definition: texsettings.h:388
GLhalf real_type
Definition: texsettings.h:379
GLhalf real_type
Definition: texsettings.h:370
GLhalf real_type
Definition: texsettings.h:361
GLhalf real_type
Definition: texsettings.h:352
Definition: texsettings.h:11