VisuTwin Canvas
C++ 3D Engine — Metal Backend
Loading...
Searching...
No Matches
metalVertexBuffer.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 25.10.2025.
5//
6#pragma once
7
8#include "metalBuffer.h"
10
11namespace visutwin::canvas
12{
17 {
18 public:
19 MetalVertexBuffer(GraphicsDevice* graphicsDevice, const std::shared_ptr<VertexFormat>& format, int numVertices,
20 const VertexBufferOptions& options = VertexBufferOptions{});
21
25 MetalVertexBuffer(GraphicsDevice* device, const std::shared_ptr<VertexFormat>& format,
26 int numVertices, MTL::Buffer* externalBuffer);
27
28 void unlock() override;
29
30 [[nodiscard]] MTL::Buffer* raw() const { return gpu::MetalBuffer::raw(); }
31
32 void* nativeBuffer() const override { return raw(); }
33 };
34}
Abstract GPU interface for resource creation, state management, and draw submission.
MetalVertexBuffer(GraphicsDevice *graphicsDevice, const std::shared_ptr< VertexFormat > &format, int numVertices, const VertexBufferOptions &options=VertexBufferOptions{})
std::shared_ptr< VertexFormat > format() const
VertexBuffer(GraphicsDevice *graphicsDevice, std::shared_ptr< VertexFormat > format, int numVertices, const VertexBufferOptions &options=VertexBufferOptions{})