Geogram Version 1.9.6-rc
A programming library of geometric algorithms
Loading...
Searching...
No Matches
GLUP_context_GLSL.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2000-2022 Inria
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 *
8 * * Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright notice,
11 * this list of conditions and the following disclaimer in the documentation
12 * and/or other materials provided with the distribution.
13 * * Neither the name of the ALICE Project-Team nor the names of its
14 * contributors may be used to endorse or promote products derived from this
15 * software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
21 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 * POSSIBILITY OF SUCH DAMAGE.
28 *
29 * Contact: Bruno Levy
30 *
31 * https://www.inria.fr/fr/bruno-levy
32 *
33 * Inria,
34 * Domaine de Voluceau,
35 * 78150 Le Chesnay - Rocquencourt
36 * FRANCE
37 *
38 */
39
40#ifndef GEOGRAM_GFX_GLUP_GLUP_CONTEXT_GLSL
41#define GEOGRAM_GFX_GLUP_GLUP_CONTEXT_GLSL
42
45
52namespace GLUP {
53 using namespace GEO;
54
55
56 /*********************************************************************/
57
58#ifdef GEO_GL_140
59
67 class Context_GLSL140 : public Context {
68 public:
72 Context_GLSL140();
73
77 const char* profile_name() const override;
78
82 void setup() override;
83
84 protected:
88 void setup_GLUP_POINTS() override;
89
93 void setup_GLUP_LINES() override;
94
98 void setup_GLUP_THICK_LINES() override;
99
103 void setup_GLUP_TRIANGLES() override;
104
108 void setup_GLUP_SPHERES() override;
109
113 void get_vertex_shader_preamble_pseudo_file(
114 std::vector<GLSL::Source>& sources
115 ) override;
116
120 void get_fragment_shader_preamble_pseudo_file(
121 std::vector<GLSL::Source>& sources
122 ) override;
123
127 void get_primitive_pseudo_file(
128 std::vector<GLSL::Source>& sources
129 ) override;
130 };
131
132#endif
133
134 /*********************************************************************/
135
136
137#ifdef GEO_GL_150
147 class Context_GLSL150 : public Context_GLSL140 {
148 public:
149
153 Context_GLSL150();
154
158 const char* profile_name() const override;
159
163 void setup() override;
164
165 protected:
169 void setup_GLUP_THICK_LINES() override;
170
174 void setup_GLUP_TRIANGLES() override;
175
179 void setup_GLUP_QUADS() override;
180
184 void setup_GLUP_TETRAHEDRA() override;
185
189 void setup_GLUP_PRISMS() override;
190
194 void setup_GLUP_HEXAHEDRA() override;
195
199 void setup_GLUP_PYRAMIDS() override;
200
204 void setup_GLUP_CONNECTORS() override;
205
209 void get_geometry_shader_preamble_pseudo_file(
210 std::vector<GLSL::Source>& sources
211 ) override;
212
218 virtual void get_geometry_shader_layout(
219 std::vector<GLSL::Source>& sources
220 );
221
225 void get_primitive_pseudo_file(
226 std::vector<GLSL::Source>& sources
227 ) override;
228 };
229
230 /*********************************************************************/
231
240 class Context_GLSL440 : public Context_GLSL150 {
241 public:
242
246 Context_GLSL440();
247
251 const char* profile_name() const override;
252
253 protected:
257 void setup_GLUP_HEXAHEDRA() override;
258
262 void setup_GLUP_PYRAMIDS() override;
263
267 void get_vertex_shader_preamble_pseudo_file(
268 std::vector<GLSL::Source>& sources
269 ) override;
270
274 void get_fragment_shader_preamble_pseudo_file(
275 std::vector<GLSL::Source>& sources
276 ) override;
277
281 void get_geometry_shader_preamble_pseudo_file(
282 std::vector<GLSL::Source>& sources
283 ) override;
284
288 void get_tess_evaluation_shader_preamble_pseudo_file(
289 std::vector<GLSL::Source>& sources
290 ) override;
291
295 void get_primitive_pseudo_file(
296 std::vector<GLSL::Source>& sources
297 ) override;
298
302 void get_geometry_shader_layout(
303 std::vector<GLSL::Source>& sources
304 ) override;
305
306 bool use_tessellation_;
307 };
308
309 /*********************************************************************/
310#endif
311
312}
313
314#endif
Internal implementation of GLUP context.
Common include file, providing basic definitions. Should be included before anything else by all head...
Global Vorpaline namespace.
Definition basic.h:55