VisuTwin Canvas
C++ 3D Engine — Metal Backend
Loading...
Searching...
No Matches
vertexFormat.h
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2025-2026 Arnis Lektauers
3//
4// Created by Arnis Lektauers on 13.09.2025.
5//
6#pragma once
7
8#include <cstdint>
9#include <string>
10
11namespace visutwin::canvas
12{
13 // Vertex attribute semantic constants
47
48 // Vertex data type constants
59
64 {
65 public:
66 VertexFormat(int size, bool interleaved = true, bool instancing = false);
67
68 int size() const { return _size; }
69
70 int verticesByteSize() const { return _verticesByteSize; }
71
72 // Get the rendering hash for fast comparison
73 uint32_t renderingHash() const { return _renderingHash; }
74
75 const std::string& renderingHashString() const { return _renderingHashString; }
76
77 bool isInterleaved() const { return _interleaved; }
78
79 bool isInstancing() const { return _instancing; }
80
81 private:
82 int _verticesByteSize = 0;
83
84 int _size;
85
86 uint32_t _renderingHash;
87
88 std::string _renderingHashString;
89
90 bool _interleaved;
91 bool _instancing;
92 };
93}
const std::string & renderingHashString() const
VertexFormat(int size, bool interleaved=true, bool instancing=false)