Gamp v0.0.8
Gamp: Graphics, Audio, Multimedia and Processing
Loading...
Searching...
No Matches
GLUniformData.hpp
Go to the documentation of this file.
1/*
2 * Author: Sven Gothel <sgothel@jausoft.com>
3 * Copyright Gothel Software e.K.
4 *
5 * SPDX-License-Identifier: MIT
6 *
7 * This Source Code Form is subject to the terms of the MIT License
8 * If a copy of the MIT was not distributed with this file,
9 * you can obtain one at https://opensource.org/license/mit/.
10 */
11
12#ifndef GAMP_GLSLUNIFORMDATA_HPP_
13#define GAMP_GLSLUNIFORMDATA_HPP_
14
15#include <jau/basic_types.hpp>
16#include <jau/cpp_lang_util.hpp>
17#include <jau/debug.hpp>
18#include <jau/float_types.hpp>
19#include <jau/io/file_util.hpp>
20#include <jau/io/io_util.hpp>
21#include <jau/math/vec4f.hpp>
22#include <jau/string_util.hpp>
24
25#include <gamp/Gamp.hpp>
30
31namespace gamp::render::gl::data {
32 using namespace gamp::render::gl;
33 using namespace jau::math::util;
34
35 /** \addtogroup Gamp_GLData
36 *
37 * @{
38 */
39
40 /**
41 * GLSL uniform data wrapper encapsulating data to be uploaded to the GPU as a uniform.
42 */
44 public:
45 /** Signature, denoting a uniform buffer, i.e. GLUniformBuffer. */
47
48 virtual ~GLUniformData() noexcept = default;
49
50 /** Return the underlying data buffer pointer. */
51 virtual const void* data() const noexcept = 0;
52
53 /** Returns type signature of implementing class's stored component value type. */
54 const jau::type_info& compSignature() const noexcept { return m_signature; }
55
56 /** Return the uniform name as used in the shader */
57 const stringview_t name() const noexcept { return m_name; }
58
59 /** Returns true if instance refers to a uniform buffer object */
60 constexpr bool isBuffer() const noexcept { return 0!=m_bufferSize; }
61 constexpr GLuint bufferName() const noexcept { return m_bufferName; }
62 constexpr GLsizeiptr bufferSize() const noexcept { return m_bufferSize; }
63
64 /// Returns the uniform's location, -1 if no location has been retrieved or set or if isBuffer()
65 constexpr GLint location() const noexcept { return isBuffer() ? -1 : m_location; }
66 /// Returns the uniform buffer's index, GL_INVALID_INDEX if no index has been retrieved or set or is if !isBuffer()
67 constexpr GLuint bufferIndex() const noexcept { return isBuffer() ? m_bufferIndex : GL_INVALID_INDEX; }
68 /// Returns the uniform buffer's global binding point, GL_INVALID_INDEX if !isBuffer()
69 constexpr GLuint bufferBinding() const noexcept { return isBuffer() ? m_bufferGlobalBinding : GL_INVALID_INDEX; }
70
71 /// Returns true if buffer index or location is valid, otherwise false
72 bool hasLocation() const noexcept { return isBuffer() ? GL_INVALID_INDEX != bufferIndex() : 0 <= location(); }
73
74 // Clears the location or buffer-index
75 void clearLocation() noexcept {
76 if( isBuffer() ) {
77 m_bufferIndex = GL_INVALID_INDEX;
78 } else {
79 m_location = -1;
80 }
81 }
82
83 /**
84 * Retrieves the location or buffer-index of the shader uniform (buffer) with {@link #getName()} from the linked shader program,
85 * depending on isBuffer().
86 *
87 * @param gl
88 * @param program
89 * @return true if successful, i.e. retrieved buffer-index != GL_INVALID_INDEX or location >= 0. False otherwise
90 */
91 bool resolveLocation(const GL&, GLuint program) noexcept;
92
93 /** Returns element count. One element consist compsPerElem() components. */
94 constexpr GLsizei count() const noexcept { return m_count; }
95 /** Returns component count per element, i.e. rows() * columns(). */
96 constexpr GLsizei components() const noexcept { return m_rows*m_columns; }
97 /** Returns row count, i.e. matrices usually have a row count > 1. */
98 constexpr GLsizei rows() const noexcept { return m_rows; }
99 /** Returns column count, i.e. matrices and vectors usually have a column count > 1. */
100 constexpr GLsizei columns() const noexcept { return m_columns; }
101 /** Return true if rows > 1 && columns > 1 */
102 constexpr bool isMatrix() const noexcept { return m_rows > 1 && m_columns > 1; }
103 /** Return true if rows == 1 && columns > 1 */
104 constexpr bool isVector() const noexcept { return m_rows == 1 && m_columns > 1; }
105 /** Return true if rows == 1 && columns == 1 */
106 constexpr bool isScalar() const noexcept { return m_rows == 1 && m_columns == 1; }
107
109 string_t sb("GLUniformData[");
110 sb.append(compSignature().name())
111 .append(", name ").append(m_name);
112 if( isBuffer() ) {
113 sb.append(", buffer[index ").append(jau::toHexString(m_bufferIndex))
114 .append(", binding ").append(jau::toHexString(m_bufferGlobalBinding))
115 .append(", name ").append(std::to_string(m_bufferName)).append(", ")
116 .append(std::to_string(m_bufferSize)).append(" bytes]");
117 } else {
118 sb.append(", location ").append(std::to_string(m_location));
119 }
120 sb.append(", size ").append(std::to_string(m_rows)).append("x").append(std::to_string(m_columns))
121 .append(", count ").append(std::to_string(m_count));
122 sb.append(", data ");
123 if( isMatrix() ) {
125 sb.append("\n");
126 const GLfloat* d = reinterpret_cast<const GLfloat*>(data());
127 for( GLsizei i = 0; i < m_count; ++i ) {
128 if( i > 0 ) { sb.append("\n"); }
129 jau::mat_to_string<GLfloat>(sb, std::to_string(i)+": ", "%10.5f",
130 d+static_cast<ptrdiff_t>(i*m_rows*m_columns), m_rows, m_columns, false);
131 }
132 }
133 } else if( isVector() ) {
135 const GLfloat* d = reinterpret_cast<const GLfloat*>(data());
136 jau::row_to_string<GLfloat>(sb, "%10.5f", d, 1, m_columns, false, 0);
137 }
138 } else {
140 const GLfloat d = *reinterpret_cast<const GLfloat*>(data());
141 sb.append(std::to_string(d));
142 } else if( compSignature() == jau::int_ctti::i32() ) {
143 const GLint d = *reinterpret_cast<const GLint*>(data());
144 sb.append(std::to_string(d));
145 }
146 }
147 sb.append(" ]");
148 return sb;
149 }
150
151 GLUniformData(const GLUniformData&) = delete;
154
155 /** Releases OpenGL resources, i.e. bufferName() if used. */
156 void destroy(GL&) {
157 if( m_bufferName != 0 ) {
158 ::glDeleteBuffers(1, &m_bufferName);
159 m_bufferName = 0;
160 }
161 }
162
163 /** Sends the uniform data to the GPU, i.e. issues [glUniform](https://docs.gl/es3/glUniform) or the aequivalent uniform buffer transfer. */
164 bool send(const GL& gl) noexcept;
165 /** Sends a subset of the uniform buffer to the GPU, specialization must have passed bufferSignature() for compSignature(). */
166 bool sendSub(const GL& gl, GLintptr offset, GLsizeiptr size) noexcept;
167
168 protected:
169 /**
170 * For plain uniforms
171 * @param name persistent std::string_view name of uniform, must be valid through the lifecycle of this instance
172 */
174 GLsizei rows, GLsizei columns, size_t count)
175 : m_signature(sig), m_name(name), m_location(-1),
176 m_rows(rows), m_columns(columns), m_count(castOrThrow<size_t, GLsizei>(count)),
177 m_bufferSize(0), m_bufferName(0), m_bufferGlobalBinding(GL_INVALID_INDEX) {}
178
179 /**
180 * For Buffer Objects
181 * @param name persistent std::string_view name of uniform, must be valid through the lifecycle of this instance
182 */
184 GLsizei rows, GLsizei columns, size_t count, GLsizeiptr bufferSize, GLuint globalBufferBinding)
185 : m_signature(bufferSignature()), m_name(name), m_bufferIndex(GL_INVALID_INDEX),
186 m_rows(rows), m_columns(columns), m_count(castOrThrow<size_t, GLsizei>(count)),
187 m_bufferSize(bufferSize), m_bufferName(0), m_bufferGlobalBinding(globalBufferBinding) {}
188
189 private:
190 const jau::type_info& m_signature;
191 stringview_t m_name;
192 union {
195 };
196 GLsizei m_rows, m_columns, m_count;
197 GLsizeiptr m_bufferSize;
198 GLuint m_bufferName;
199 /// global UBO binding point for glUniformBlockBinding and glBindBufferRange/glBindBufferBase
200 GLuint m_bufferGlobalBinding;
201 };
202 typedef std::shared_ptr<GLUniformData> GLUniformDataSRef;
203
204 inline std::ostream& operator<<(std::ostream& out, const GLUniformData& v) {
205 return out << v.toString();
206 }
207
209 public:
211
212 private:
213 PMVMat4f& m_mat;
214 mutable SyncMats4f m_data;
215
216 public:
217 /**
218 * GLUniformSyncPMVMat4fExt ctor
219 * @param name persistent std::string_view name of uniform, must be valid through the lifecycle of this instance
220 */
223 /*rows=*/4, /*columns=*/4, /*count=*/data.matrixCount()),
224 m_mat(mat), m_data(data) {}
225
228
229 /**
230 * Shared GLUniformSyncPMVMat4fExt ctor
231 * @param name persistent std::string_view name of uniform, must be valid through the lifecycle of this instance
232 */
233 static std::shared_ptr<GLUniformSyncPMVMat4fExt> createShared(stringview_t name, PMVMat4f &mat) {
234 return std::make_shared<GLUniformSyncPMVMat4fExt>(name, mat);
235 }
236 const void* data() const noexcept override { return m_data.syncedData(); }
237
238 constexpr const GLfloat* floats() const noexcept { return m_data.floats(); }
239
240 constexpr const PMVMat4f& pmv() const noexcept { return m_mat; }
241 constexpr PMVMat4f& pmv() noexcept { return m_mat; }
242 };
243 typedef std::shared_ptr<GLUniformSyncPMVMat4fExt> GLUniformSyncPMVMat4fExtSRef;
244
246 public:
248 private:
249 PMVMat4f m_mat;
250 mutable SyncMats4f m_data;
251
252 public:
253 /**
254 * GLUniformSyncPMVMat4f ctor
255 * @param name persistent std::string_view name of uniform, must be valid through the lifecycle of this instance
256 */
259 /*rows=*/4, /*columns=*/4, /*count=*/mat.matrixCount()),
260 m_mat(mat), m_data(m_mat.makeSyncPMvReq()) {}
261
262 /**
263 * GLUniformSyncPMVMat4f ctor
264 * @param name persistent std::string_view name of uniform, must be valid through the lifecycle of this instance
265 */
268
269 static std::shared_ptr<GLUniformSyncPMVMat4f> createShared(stringview_t name, PMVData derivedMatrices=PMVData::none) {
270 return std::make_shared<GLUniformSyncPMVMat4f>(name, derivedMatrices);
271 }
272 const void* data() const noexcept override { return m_data.syncedData(); }
273
274 constexpr const GLfloat* floats() const noexcept { return m_data.floats(); }
275
276 constexpr const PMVMat4f& pmv() const noexcept { return m_mat; }
277 constexpr PMVMat4f& pmv() noexcept { return m_mat; }
278 };
279 typedef std::shared_ptr<GLUniformSyncPMVMat4f> GLUniformSyncPMVMat4fSRef;
280
282 public:
284 private:
285 mutable SyncMats4f m_data;
286 public:
287 /**
288 * GLUniformSyncMatrices4f ctor
289 * @param name persistent std::string_view name of uniform, must be valid through the lifecycle of this instance
290 */
293 /*rows=*/4, /*columns=*/4, /*count=*/data.matrixCount()),
294 m_data(data) {}
295
296 /**
297 * Shared GLUniformSyncMatrices4f ctor
298 * @param name persistent std::string_view name of uniform, must be valid through the lifecycle of this instance
299 */
300 static std::shared_ptr<GLUniformSyncMatrices4f> createShared(stringview_t name, SyncMats4f &&data) {
301 return std::make_shared<GLUniformSyncMatrices4f>(name, std::move(data));
302 }
303 const void* data() const noexcept override { return m_data.syncedData(); }
304
305 constexpr const GLfloat* floats() const noexcept { return m_data.floats(); }
306 };
307 typedef std::shared_ptr<GLUniformSyncMatrices4f> GLUniformSyncMatrices4fSRef;
308
310 private:
311 jau::math::Vec4f m_data;
312
313 public:
314 /**
315 * GLUniformVec4f ctor
316 * @param name persistent std::string_view name of uniform, must be valid through the lifecycle of this instance
317 */
319 : GLUniformData(jau::float_ctti::f32(), name,
320 /*rows=*/1, /*columns=*/4, /*count=*/1),
321 m_data(v) {}
322
323 /**
324 * Shared GLUniformVec4f ctor
325 * @param name persistent std::string_view name of uniform, must be valid through the lifecycle of this instance
326 */
327 static std::shared_ptr<GLUniformVec4f> createShared(stringview_t name, const jau::math::Vec4f& v) {
328 return std::make_shared<GLUniformVec4f>(name, v);
329 }
330 const void* data() const noexcept override { return m_data.cbegin(); }
331
332 constexpr const jau::math::Vec4f& vec4f() const noexcept { return m_data; }
333 constexpr jau::math::Vec4f& vec4f() noexcept { return m_data; }
334 };
335 typedef std::shared_ptr<GLUniformVec4f> GLUniformVec4fSRef;
336
338 private:
339 jau::math::Vec3f m_data;
340
341 public:
342 /**
343 * GLUniformVec3f ctor
344 * @param name persistent std::string_view name of uniform, must be valid through the lifecycle of this instance
345 */
347 : GLUniformData(jau::float_ctti::f32(), name,
348 /*rows=*/1, /*columns=*/3, /*count=*/1),
349 m_data(v) {}
350
351 /**
352 * Shared GLUniformVec3f ctor
353 * @param name persistent std::string_view name of uniform, must be valid through the lifecycle of this instance
354 */
355 static std::shared_ptr<GLUniformVec3f> createShared(stringview_t name, const jau::math::Vec3f& v) {
356 return std::make_shared<GLUniformVec3f>(name, v);
357 }
358 const void* data() const noexcept override { return m_data.cbegin(); }
359
360 constexpr const jau::math::Vec3f& vec3f() const noexcept { return m_data; }
361 constexpr jau::math::Vec3f& vec3f() noexcept { return m_data; }
362 };
363 typedef std::shared_ptr<GLUniformVec3f> GLUniformVec3fSRef;
364
366 private:
367 jau::math::Vec2f m_data;
368
369 public:
370 /**
371 * GLUniformVec2f ctor
372 * @param name persistent std::string_view name of uniform, must be valid through the lifecycle of this instance
373 */
375 : GLUniformData(jau::float_ctti::f32(), name,
376 /*rows=*/1, /*columns=*/2, /*count=*/1),
377 m_data(v) {}
378
379 /**
380 * Shared GLUniformVec2f ctor
381 * @param name persistent std::string_view name of uniform, must be valid through the lifecycle of this instance
382 */
383 static std::shared_ptr<GLUniformVec2f> createShared(stringview_t name, const jau::math::Vec2f& v) {
384 return std::make_shared<GLUniformVec2f>(name, v);
385 }
386 const void* data() const noexcept override { return m_data.cbegin(); }
387
388 constexpr const jau::math::Vec2f& vec2f() const noexcept { return m_data; }
389 constexpr jau::math::Vec2f& vec2f() noexcept { return m_data; }
390 };
391 typedef std::shared_ptr<GLUniformVec2f> GLUniformVec2fSRef;
392
394 private:
395 float m_data;
396
397 public:
398 /**
399 * GLUniformF32 ctor
400 * @param name persistent std::string_view name of uniform, must be valid through the lifecycle of this instance
401 */
403 : GLUniformData(jau::float_ctti::f32(), name,
404 /*rows=*/1, /*columns=*/1, /*count=*/1),
405 m_data(v) {}
406
407 /**
408 * Shared GLUniformF32 ctor
409 * @param name persistent std::string_view name of uniform, must be valid through the lifecycle of this instance
410 */
411 static std::shared_ptr<GLUniformScalarF32> createShared(stringview_t name, float v) {
412 return std::make_shared<GLUniformScalarF32>(name, v);
413 }
414 const void* data() const noexcept override { return &m_data; }
415
416 constexpr float scalar() const noexcept { return m_data; }
417 constexpr float& scalar() noexcept { return m_data; }
418 };
419 typedef std::shared_ptr<GLUniformScalarF32> GLUniformScalarF32SRef;
420
421 template<typename T>
423 private:
424 T m_data;
425
426 public:
427 /**
428 * GLUniformBuffer ctor
429 * @param name persistent std::string_view name of uniform, must be valid through the lifecycle of this instance
430 */
431 GLUniformBuffer(stringview_t name, T &&instance, GLuint globalBufferBinding)
433 /*rows=*/1, /*columns=*/1, /*count=*/1,
434 sizeof(T), globalBufferBinding),
435 m_data(instance) {}
436
437 /**
438 * GLUniformBuffer ctor
439 * @param name persistent std::string_view name of uniform, must be valid through the lifecycle of this instance
440 */
441 static std::shared_ptr<GLUniformBuffer> createShared(stringview_t name, T &&instance) {
442 return std::make_shared<GLUniformBuffer>(name, instance);
443 }
444 const void* data() const noexcept override { return &m_data; }
445
446 constexpr const T& blob() const noexcept { return m_data; }
447 constexpr T& blob() noexcept { return m_data; }
448 };
449 template<typename T>
450 using GLUniformBufferRef = std::shared_ptr<GLUniformBuffer<T>>;
451
452 /**@}*/
453}
454
455#endif // GAMP_GLSLUNIFORMDATA_HPP_
static std::shared_ptr< GLUniformBuffer > createShared(stringview_t name, T &&instance)
GLUniformBuffer ctor.
const void * data() const noexcept override
Return the underlying data buffer pointer.
constexpr const T & blob() const noexcept
GLUniformBuffer(stringview_t name, T &&instance, GLuint globalBufferBinding)
GLUniformBuffer ctor.
GLSL uniform data wrapper encapsulating data to be uploaded to the GPU as a uniform.
constexpr GLint location() const noexcept
Returns the uniform's location, -1 if no location has been retrieved or set or if isBuffer()
constexpr GLsizeiptr bufferSize() const noexcept
const stringview_t name() const noexcept
Return the uniform name as used in the shader.
virtual const void * data() const noexcept=0
Return the underlying data buffer pointer.
constexpr GLsizei columns() const noexcept
Returns column count, i.e.
virtual ~GLUniformData() noexcept=default
GLUniformData(GLUniformData &&)=delete
GLUniformData & operator=(const GLUniformData &)=delete
constexpr GLsizei count() const noexcept
Returns element count.
GLUniformData(const jau::type_info &sig, stringview_t name, GLsizei rows, GLsizei columns, size_t count)
For plain uniforms.
bool hasLocation() const noexcept
Returns true if buffer index or location is valid, otherwise false.
constexpr bool isMatrix() const noexcept
Return true if rows > 1 && columns > 1.
constexpr GLsizei components() const noexcept
Returns component count per element, i.e.
constexpr GLuint bufferBinding() const noexcept
Returns the uniform buffer's global binding point, GL_INVALID_INDEX if !isBuffer()
constexpr bool isScalar() const noexcept
Return true if rows == 1 && columns == 1.
bool sendSub(const GL &gl, GLintptr offset, GLsizeiptr size) noexcept
Sends a subset of the uniform buffer to the GPU, specialization must have passed bufferSignature() fo...
Definition gamp_gl.cpp:359
constexpr GLsizei rows() const noexcept
Returns row count, i.e.
constexpr bool isBuffer() const noexcept
Returns true if instance refers to a uniform buffer object.
const jau::type_info & compSignature() const noexcept
Returns type signature of implementing class's stored component value type.
constexpr bool isVector() const noexcept
Return true if rows == 1 && columns > 1.
constexpr GLuint bufferName() const noexcept
void destroy(GL &)
Releases OpenGL resources, i.e.
GLUniformData(stringview_t name, GLsizei rows, GLsizei columns, size_t count, GLsizeiptr bufferSize, GLuint globalBufferBinding)
For Buffer Objects.
GLUniformData(const GLUniformData &)=delete
constexpr GLuint bufferIndex() const noexcept
Returns the uniform buffer's index, GL_INVALID_INDEX if no index has been retrieved or set or is if !...
bool resolveLocation(const GL &, GLuint program) noexcept
Retrieves the location or buffer-index of the shader uniform (buffer) with getName() from the linked ...
Definition gamp_gl.cpp:330
static const jau::type_info & bufferSignature()
Signature, denoting a uniform buffer, i.e.
bool send(const GL &gl) noexcept
Sends the uniform data to the GPU, i.e.
Definition gamp_gl.cpp:369
GLUniformScalarF32(stringview_t name, float v)
GLUniformF32 ctor.
static std::shared_ptr< GLUniformScalarF32 > createShared(stringview_t name, float v)
Shared GLUniformF32 ctor.
constexpr float scalar() const noexcept
const void * data() const noexcept override
Return the underlying data buffer pointer.
constexpr const GLfloat * floats() const noexcept
GLUniformSyncMatrices4f(stringview_t name, SyncMats4f &&data)
GLUniformSyncMatrices4f ctor.
const void * data() const noexcept override
Return the underlying data buffer pointer.
static std::shared_ptr< GLUniformSyncMatrices4f > createShared(stringview_t name, SyncMats4f &&data)
Shared GLUniformSyncMatrices4f ctor.
constexpr const GLfloat * floats() const noexcept
static std::shared_ptr< GLUniformSyncPMVMat4fExt > createShared(stringview_t name, PMVMat4f &mat)
Shared GLUniformSyncPMVMat4fExt ctor.
const void * data() const noexcept override
Return the underlying data buffer pointer.
GLUniformSyncPMVMat4fExt(stringview_t name, PMVMat4f &mat, SyncMats4f &&data)
GLUniformSyncPMVMat4fExt ctor.
constexpr const PMVMat4f & pmv() const noexcept
GLUniformSyncPMVMat4fExt(stringview_t name, PMVMat4f &mat)
constexpr const GLfloat * floats() const noexcept
const void * data() const noexcept override
Return the underlying data buffer pointer.
GLUniformSyncPMVMat4f(stringview_t name, PMVData derivedMatrices=PMVData::none)
GLUniformSyncPMVMat4f ctor.
GLUniformSyncPMVMat4f(stringview_t name, PMVMat4f &&mat)
GLUniformSyncPMVMat4f ctor.
static std::shared_ptr< GLUniformSyncPMVMat4f > createShared(stringview_t name, PMVData derivedMatrices=PMVData::none)
constexpr const PMVMat4f & pmv() const noexcept
GLUniformVec2f(stringview_t name, const jau::math::Vec2f &v)
GLUniformVec2f ctor.
constexpr jau::math::Vec2f & vec2f() noexcept
static std::shared_ptr< GLUniformVec2f > createShared(stringview_t name, const jau::math::Vec2f &v)
Shared GLUniformVec2f ctor.
constexpr const jau::math::Vec2f & vec2f() const noexcept
const void * data() const noexcept override
Return the underlying data buffer pointer.
constexpr jau::math::Vec3f & vec3f() noexcept
constexpr const jau::math::Vec3f & vec3f() const noexcept
const void * data() const noexcept override
Return the underlying data buffer pointer.
GLUniformVec3f(stringview_t name, const jau::math::Vec3f &v)
GLUniformVec3f ctor.
static std::shared_ptr< GLUniformVec3f > createShared(stringview_t name, const jau::math::Vec3f &v)
Shared GLUniformVec3f ctor.
static std::shared_ptr< GLUniformVec4f > createShared(stringview_t name, const jau::math::Vec4f &v)
Shared GLUniformVec4f ctor.
constexpr const jau::math::Vec4f & vec4f() const noexcept
GLUniformVec4f(stringview_t name, const jau::math::Vec4f &v)
GLUniformVec4f ctor.
const void * data() const noexcept override
Return the underlying data buffer pointer.
constexpr jau::math::Vec4f & vec4f() noexcept
static const jau::type_info & f32()
jau::float_32_t or just float
static const jau::type_info & i32()
int32_t
SyncBuffer interface with multiple underlying Matrix4.
Generic type information using either Runtime type information (RTTI) or Compile time type informatio...
std::ostream & operator<<(std::ostream &os, const T v)
const jau::type_info & static_ctti() noexcept
Returns a static global reference of make_ctti<T>(true) w/ identity instance.
std::string & row_to_string(std::string &sb, const std::string_view f, const T a[], const jau::nsize_t rows, const jau::nsize_t columns, const bool rowMajorOrder, const jau::nsize_t row) noexcept
Appends a row of floating points to the given string sb
std::string & mat_to_string(std::string &sb, const std::string &rowPrefix, const std::string_view f, const T a[], const jau::nsize_t rows, const jau::nsize_t columns, const bool rowMajorOrder) noexcept
Appends a matrix of floating points to the given string sb
std::shared_ptr< GLUniformSyncPMVMat4f > GLUniformSyncPMVMat4fSRef
std::shared_ptr< GLUniformScalarF32 > GLUniformScalarF32SRef
std::shared_ptr< GLUniformSyncPMVMat4fExt > GLUniformSyncPMVMat4fExtSRef
std::shared_ptr< GLUniformBuffer< T > > GLUniformBufferRef
std::shared_ptr< GLUniformVec4f > GLUniformVec4fSRef
std::shared_ptr< GLUniformVec2f > GLUniformVec2fSRef
std::shared_ptr< GLUniformData > GLUniformDataSRef
std::shared_ptr< GLUniformVec3f > GLUniformVec3fSRef
std::shared_ptr< GLUniformSyncMatrices4f > GLUniformSyncMatrices4fSRef
std::string_view stringview_t
U castOrThrow(T has)
Definition GampTypes.hpp:75
Vector4F< float > Vec4f
Definition vec4f.hpp:360
PMVData
PMVMatrix4 derived matrices and values.
Definition pmvmat4.hpp:57
Vector2F< float > Vec2f
Definition vec2f.hpp:404
Vector3F< float > Vec3f
Definition vec3f.hpp:422
PMVMatrix4< float > PMVMat4f
Definition pmvmat4.hpp:1463
std::string toHexString(const void *data, const nsize_t length, const lb_endian_t byteOrder=lb_endian_t::big, const LoUpCase capitalization=LoUpCase::lower, const PrefixOpt prefix=PrefixOpt::prefix) noexcept
Produce a hexadecimal string representation of the given lsb-first byte values.
__pack(...): Produces MSVC, clang and gcc compatible lead-in and -out macros.
Definition backtrace.hpp:32