VisuTwin Canvas
C++ 3D Engine — Metal Backend
Loading...
Searching...
No Matches
mesh.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 08.11.2025.
5//
6#include "mesh.h"
7
8namespace visutwin::canvas
9{
10 void Mesh::initGeometryData()
11 {
12 if (!_geometryData) {
13 _geometryData = std::make_unique<GeometryData>();
14
15 // Store existing sizes if buffers exist
16 if (_vertexBuffer) {
17 _geometryData->vertexCount = _vertexBuffer->numVertices();
18 _geometryData->maxVertices = _vertexBuffer->numVertices();
19 }
20
21 if (!_indexBuffer.empty() && _indexBuffer[0]) {
22 _geometryData->indexCount = _indexBuffer[0]->numIndices();
23 _geometryData->maxIndices = _indexBuffer[0]->numIndices();
24 }
25 }
26 }
27}