Divide Framework 0.1
A free and open-source 3D Framework under heavy development
Loading...
Searching...
No Matches
glimBatchData.h
Go to the documentation of this file.
1/*
2** GLIM - OpenGL Immediate Mode
3** Copyright Jan Krassnigg (Jan@Krassnigg.de)
4** For more details, see the included Readme.txt.
5*/
6
7#ifndef GLIM_GLIMBATCHDATA_H
8#define GLIM_GLIMBATCHDATA_H
9
10#include "Declarations.h"
14
15namespace NS_GLIM
16{
17 // holds one element of attribute data
19 {
20 Glim4ByteData () noexcept : Int (0) {}
21 Glim4ByteData(int Int_) noexcept : Int(Int_) {}
22 Glim4ByteData(float Float_) noexcept : Float(Float_) {}
23
24 int Int;
25 float Float;
26 unsigned char Bytes[4];
27 };
28
29 // one attribute array
31 {
33
34 void Reset (void);
35 void PushElement (void);
36
37 // what kind of data this array holds (1 float, 2 floats, 4 unsigned byte, etc.)
39 // the current value that shall be used for all new elements
41 // the actual array of accumulated elements
43 };
44
45 // used for tracking erroneous use of the interface
46 enum class GLIM_BATCH_STATE : unsigned int
47 {
53
54 };
55
56 // the data of one entire batch
58 {
61
62 // Deletes all allocated data and resets default states
63 void Reset(bool reserveBuffers = false, unsigned int vertexCount = 64 * 3, unsigned int attributeCount = 1);
64
65 // Returns the index of the just added vertex.
66 unsigned int AddVertex (float x, float y, float z);
67
68 // Used for error detection.
70
71 // All attributes accessible by name.
73
74 // Position data is stored separately, not as an attribute.
76
77 // Index Buffer for points.
79 // Index Buffer for Lines.
81 // Index Buffer for Triangles.
83 // Index Buffer for wireframe rendering of polygons.
85 };
86}
87
88
89#pragma once
90
91#endif
92
93
94
eastl::vector< Type > vector
Definition: Vector.h:42
hashAlg::unordered_map< K, V, HashFun, Predicate > hashMap
Definition: HashMap.h:55
GLIM_ENUM
The enum holding all important GLIM configuration values.
Definition: Declarations.h:17
Divide::vector< Glim4ByteData > m_ArrayData
Definition: glimBatchData.h:42
Glim4ByteData m_CurrentValue[4]
Definition: glimBatchData.h:40
Divide::vector< unsigned int > m_IndexBuffer_Triangles
Definition: glimBatchData.h:82
void Reset(bool reserveBuffers=false, unsigned int vertexCount=64 *3, unsigned int attributeCount=1)
unsigned int AddVertex(float x, float y, float z)
Divide::vector< unsigned int > m_IndexBuffer_Lines
Definition: glimBatchData.h:80
Divide::vector< unsigned int > m_IndexBuffer_Wireframe
Definition: glimBatchData.h:84
Divide::vector< Glim4ByteData > m_PositionData
Definition: glimBatchData.h:75
Divide::hashMap< unsigned int, GlimArrayData > m_Attributes
Definition: glimBatchData.h:72
Divide::vector< unsigned int > m_IndexBuffer_Points
Definition: glimBatchData.h:78
GLIM_BATCH_STATE m_State
Definition: glimBatchData.h:69
Glim4ByteData(float Float_) noexcept
Definition: glimBatchData.h:22
unsigned char Bytes[4]
Definition: glimBatchData.h:26
Glim4ByteData(int Int_) noexcept
Definition: glimBatchData.h:21