| Flutter Impeller |

vertex_buffer.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #pragma once
6
7 #include "impeller/core/buffer_view.h"
8 #include "impeller/core/formats.h"
9
10 namespace impeller {
11
12 struct VertexBuffer {
13 BufferView vertex_buffer;
14 BufferView index_buffer;
15 // The total count of vertices, either in the vertex_buffer if the
16 // index_type is IndexType::kNone or in the index_buffer otherwise.
17 size_t vertex_count = 0u;
18 IndexType index_type = IndexType::kUnknown;
19
20 constexpr operator bool() const {
21 return static_cast<bool>(vertex_buffer) &&
22 (index_type == IndexType::kNone || static_cast<bool>(index_buffer));
23 }
24 };
25
26 } // namespace impeller
impeller::VertexBuffer::index_type
IndexType index_type
Definition: vertex_buffer.h:18
impeller::VertexBuffer
Definition: vertex_buffer.h:12
formats.h
impeller::VertexBuffer::vertex_buffer
BufferView vertex_buffer
Definition: vertex_buffer.h:13
impeller::VertexBuffer::vertex_count
size_t vertex_count
Definition: vertex_buffer.h:17
impeller::IndexType
IndexType
Definition: formats.h:320
impeller::IndexType::kNone
@ kNone
Does not use the index buffer.
impeller::VertexBuffer::index_buffer
BufferView index_buffer
Definition: vertex_buffer.h:14
impeller::BufferView
Definition: buffer_view.h:13
buffer_view.h
impeller
Definition: aiks_context.cc:10
impeller::IndexType::kUnknown
@ kUnknown