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
51
53const MeshId CreateMesh(const MeshCreateInfo& info);
55void DestroyMesh(const MeshId id);
56
62const BufferId MeshGetVertexBuffer(const MeshId id, const IndexT stream);
64const void MeshSetVertexBuffer(const MeshId id, const BufferId buffer, const IndexT stream);
66const uint MeshGetVertexOffset(const MeshId id, const IndexT stream);
68const BufferId MeshGetIndexBuffer(const MeshId id);
70const uint MeshGetIndexOffset(const MeshId id);
77
79const void MeshBind(const MeshId id, const CoreGraphics::CmdBufferId cmd);
80
81enum
82{
85};
86
98
100 0xFFFF,
102 __Mesh
105
107
108extern MeshId RectangleMesh;
109extern MeshId DiskMesh;
110
111} // 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
A StringAtom.
Definition stringatom.h:22
#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:155
MeshId RectangleMesh
Definition mesh.cc:12
MeshAllocator meshAllocator
Definition mesh.cc:17
const uint MeshGetVertexOffset(const MeshId id, const IndexT stream)
Get mesh vertex offset.
Definition mesh.cc:101
const CoreGraphics::VertexLayoutId MeshGetVertexLayout(const MeshId id)
Get vertex layout.
Definition mesh.cc:146
MeshId DiskMesh
Definition mesh.cc:13
void DestroyMesh(const MeshId id)
destroy mesh
Definition mesh.cc:51
Ids::IdAllocatorSafe< 0xFFFF, Resources::ResourceName, __Mesh > MeshAllocator
Definition mesh.h:103
@ Mesh_Name
Definition mesh.h:83
@ Mesh_Internals
Definition mesh.h:84
const CoreGraphics::PrimitiveGroup MeshGetPrimitiveGroup(const MeshId id, const IndexT group)
get primitive group
Definition mesh.cc:74
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:128
const BufferId MeshGetVertexBuffer(const MeshId id, const IndexT stream)
get vertex buffer
Definition mesh.cc:83
const CoreGraphics::PrimitiveTopology::Code MeshGetTopology(const MeshId id)
Get topology.
Definition mesh.cc:137
const void MeshSetVertexBuffer(const MeshId id, const BufferId buffer, const IndexT stream)
Set vertex buffer.
Definition mesh.cc:92
const BufferId MeshGetIndexBuffer(const MeshId id)
get index buffer
Definition mesh.cc:110
const uint MeshGetIndexOffset(const MeshId id)
Get index buffer base offset.
Definition mesh.cc:119
const Util::Array< CoreGraphics::PrimitiveGroup > & MeshGetPrimitiveGroups(const MeshId id)
get number of primitive groups
Definition mesh.cc:65
Util::StringAtom ResourceName
Definition resourceid.h:33
Compile time configuration options for the CoreGraphics subsystem.
Definition mesh.h:88
CoreGraphics::PrimitiveTopology::Code primitiveTopology
Definition mesh.h:94
Util::StackArray< VertexStream, 4 > streams
Definition mesh.h:89
CoreGraphics::VertexAlloc indexAllocation
Definition mesh.h:96
IndexType::Code indexType
Definition mesh.h:92
Util::Array< CoreGraphics::PrimitiveGroup > primitiveGroups
Definition mesh.h:95
VertexLayoutId vertexLayout
Definition mesh.h:93
BufferId indexBuffer
Definition mesh.h:91
CoreGraphics::VertexAlloc vertexAllocation
Definition mesh.h:96
SizeT indexBufferOffset
Definition mesh.h:90
Definition buffer.h:23
Definition commandbuffer.h:155
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
CoreGraphics::VertexAlloc indexBufferAllocation
Definition mesh.h:49
VertexLayoutId vertexLayout
Definition mesh.h:45
Util::StackArray< VertexStream, 4 > streams
Definition mesh.h:41
CoreGraphics::VertexAlloc vertexBufferAllocation
Definition mesh.h:49
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
int IndexT
Definition types.h:48