Nebula
Loading...
Searching...
No Matches
mesh.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
11//------------------------------------------------------------------------------
12#include "coregraphics/config.h"
14#include "ids/id.h"
15#include "ids/idallocator.h"
16#include "coregraphics/buffer.h"
20namespace CoreGraphics
21{
23{
25};
26
27struct CmdBufferId;
28
30
37
49
51const MeshId CreateMesh(const MeshCreateInfo& info);
53void DestroyMesh(const MeshId id);
54
60const BufferId MeshGetVertexBuffer(const MeshId id, const IndexT stream);
62const void MeshSetVertexBuffer(const MeshId id, const BufferId buffer, const IndexT stream);
64const uint64 MeshGetVertexOffset(const MeshId id, const IndexT stream);
66const BufferId MeshGetIndexBuffer(const MeshId id);
68const uint64 MeshGetIndexOffset(const MeshId id);
75
77const void MeshBind(const MeshId id, const CoreGraphics::CmdBufferId cmd);
78
79enum
80{
83};
84
95
97 0xFFFF,
99 __Mesh
102
104
105extern MeshId RectangleMesh;
106extern MeshId DiskMesh;
107
108} // CoreGraphics
Code
index types enum
Definition indextype.h:22
Defines a group of primitives as a subset of a vertex buffer and index buffer plus the primitive topo...
Definition primitivegroup.h:20
Code
enumeration
Definition primitivetopology.h:23
Definition idallocator.h:106
Nebula's dynamic array class.
Definition array.h:60
#define _DECL_ACQUIRE_RELEASE(ty)
Definition idallocator.h:88
#define ID_24_8_TYPE(x)
Definition id.h:132
Acceleration structures are used to enable ray tracing on the GPU by dividing the scene into a BVH.
Definition accelerationstructure.h:24
const void MeshBind(const MeshId id, const CoreGraphics::CmdBufferId cmd)
Bind mesh on command buffer.
Definition mesh.cc:148
MeshId RectangleMesh
Definition mesh.cc:12
MeshAllocator meshAllocator
Definition mesh.cc:17
const CoreGraphics::VertexLayoutId MeshGetVertexLayout(const MeshId id)
Get vertex layout.
Definition mesh.cc:139
MeshId DiskMesh
Definition mesh.cc:13
void DestroyMesh(const MeshId id)
destroy mesh
Definition mesh.cc:49
Ids::IdAllocatorSafe< 0xFFFF, Resources::ResourceName, __Mesh > MeshAllocator
Definition mesh.h:100
const CoreGraphics::PrimitiveGroup MeshGetPrimitiveGroup(const MeshId id, const IndexT group)
get primitive group
Definition mesh.cc:67
const MeshId CreateMesh(const MeshCreateInfo &info)
create new mesh
Definition mesh.cc:23
const IndexType::Code MeshGetIndexType(const MeshId id)
Get index type.
Definition mesh.cc:121
@ Mesh_Name
Definition mesh.h:81
@ Mesh_Internals
Definition mesh.h:82
const BufferId MeshGetVertexBuffer(const MeshId id, const IndexT stream)
get vertex buffer
Definition mesh.cc:76
const CoreGraphics::PrimitiveTopology::Code MeshGetTopology(const MeshId id)
Get topology.
Definition mesh.cc:130
const uint64 MeshGetIndexOffset(const MeshId id)
Get index buffer base offset.
Definition mesh.cc:112
const void MeshSetVertexBuffer(const MeshId id, const BufferId buffer, const IndexT stream)
Set vertex buffer.
Definition mesh.cc:85
const uint64 MeshGetVertexOffset(const MeshId id, const IndexT stream)
Get mesh vertex offset.
Definition mesh.cc:94
const BufferId MeshGetIndexBuffer(const MeshId id)
get index buffer
Definition mesh.cc:103
const Util::Array< CoreGraphics::PrimitiveGroup > & MeshGetPrimitiveGroups(const MeshId id)
get number of primitive groups
Definition mesh.cc:58
Util::StringAtom ResourceName
Definition resourceid.h:33
Array< TYPE, STACK_SIZE > StackArray
Definition array.h:1881
Compile time configuration options for the CoreGraphics subsystem.
Definition mesh.h:86
CoreGraphics::PrimitiveTopology::Code primitiveTopology
Definition mesh.h:92
Util::StackArray< VertexStream, 4 > streams
Definition mesh.h:87
IndexType::Code indexType
Definition mesh.h:90
Util::Array< CoreGraphics::PrimitiveGroup > primitiveGroups
Definition mesh.h:93
VertexLayoutId vertexLayout
Definition mesh.h:91
BufferId indexBuffer
Definition mesh.h:89
SizeT indexBufferOffset
Definition mesh.h:88
Definition buffer.h:23
Definition commandbuffer.h:167
Mesh collects vertex and index buffers with primitive groups which can be used to render with.
Definition mesh.h:39
Resources::ResourceName name
Definition mesh.h:40
Util::Array< CoreGraphics::PrimitiveGroup > primitiveGroups
Definition mesh.h:47
BufferId indexBuffer
Definition mesh.h:43
IndexType::Code indexType
Definition mesh.h:44
SizeT indexBufferOffset
Definition mesh.h:42
CoreGraphics::PrimitiveTopology::Code topology
Definition mesh.h:46
VertexLayoutId vertexLayout
Definition mesh.h:45
Util::StackArray< VertexStream, 4 > streams
Definition mesh.h:41
Definition mesh.h:29
Definition mesh.h:23
uint size
Definition mesh.h:24
uint offset
Definition mesh.h:24
uint node
Definition mesh.h:24
Definition vertexlayout.h:16
Definition mesh.h:32
IndexT index
Definition mesh.h:35
SizeT offset
Definition mesh.h:34
BufferId vertexBuffer
Definition mesh.h:33
int SizeT
Definition types.h:49
unsigned int uint
Definition types.h:31
uint64_t uint64
Definition types.h:36
int IndexT
Definition types.h:48