VisuTwin Canvas
C++ 3D Engine — Metal Backend
Loading...
Searching...
No Matches
vertexFormat.cpp
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#include "vertexFormat.h"
7
8#include <functional>
9
10namespace visutwin::canvas
11{
12 VertexFormat::VertexFormat(const int size, const bool interleaved, const bool instancing)
13 : _size(size), _interleaved(interleaved), _instancing(instancing)
14 {
15 _verticesByteSize = 0;
16 _renderingHashString = std::to_string(size) + ":" + (interleaved ? "i" : "ni") + ":" + (instancing ? "1" : "0");
17 _renderingHash = static_cast<uint32_t>(std::hash<std::string>{}(_renderingHashString));
18 }
19}
VertexFormat(int size, bool interleaved=true, bool instancing=false)