Gawain: name struct's
Needed to reference without first including headers.
This commit is contained in:
parent
8644fce3b7
commit
4d93323b8a
@ -13,7 +13,7 @@
|
||||
|
||||
#include "gwn_common.h"
|
||||
|
||||
typedef struct {
|
||||
typedef struct Gwn_AttrBinding {
|
||||
uint64_t loc_bits; // store 4 bits for each of the 16 attribs
|
||||
uint16_t enabled_bits; // 1 bit for each attrib
|
||||
} Gwn_AttrBinding;
|
||||
|
@ -101,17 +101,17 @@ void GWN_batch_draw_stupid_instanced_with_batch(Gwn_Batch*, Gwn_Batch*);
|
||||
// We often need a batch with its own data, to be created and discarded together.
|
||||
// WithOwn variants reduce number of system allocations.
|
||||
|
||||
typedef struct {
|
||||
typedef struct BatchWithOwnVertexBuffer {
|
||||
Gwn_Batch batch;
|
||||
Gwn_VertBuf verts; // link batch.verts to this
|
||||
} BatchWithOwnVertexBuffer;
|
||||
|
||||
typedef struct {
|
||||
typedef struct BatchWithOwnElementList {
|
||||
Gwn_Batch batch;
|
||||
Gwn_IndexBuf elem; // link batch.elem to this
|
||||
} BatchWithOwnElementList;
|
||||
|
||||
typedef struct {
|
||||
typedef struct BatchWithOwnVertexBufferAndElementList {
|
||||
Gwn_Batch batch;
|
||||
Gwn_IndexBuf elem; // link batch.elem to this
|
||||
Gwn_VertBuf verts; // link batch.verts to this
|
||||
|
@ -21,7 +21,7 @@ typedef enum {
|
||||
GWN_INDEX_U32
|
||||
} Gwn_IndexBufType;
|
||||
|
||||
typedef struct {
|
||||
typedef struct Gwn_IndexBuf {
|
||||
unsigned index_ct;
|
||||
#if GWN_TRACK_INDEX_RANGE
|
||||
Gwn_IndexBufType index_type;
|
||||
@ -37,7 +37,7 @@ typedef struct {
|
||||
void GWN_indexbuf_use(Gwn_IndexBuf*);
|
||||
unsigned GWN_indexbuf_size_get(const Gwn_IndexBuf*);
|
||||
|
||||
typedef struct {
|
||||
typedef struct Gwn_IndexBufBuilder {
|
||||
unsigned max_allowed_index;
|
||||
unsigned max_index_ct;
|
||||
unsigned index_ct;
|
||||
|
@ -30,7 +30,7 @@ typedef enum {
|
||||
GWN_UNIFORM_CUSTOM // custom uniform, not one of the above built-ins
|
||||
} Gwn_UniformBuiltin;
|
||||
|
||||
typedef struct {
|
||||
typedef struct Gwn_ShaderInput {
|
||||
const char* name;
|
||||
unsigned name_hash;
|
||||
GLenum gl_type;
|
||||
@ -39,7 +39,7 @@ typedef struct {
|
||||
GLint location;
|
||||
} Gwn_ShaderInput;
|
||||
|
||||
typedef struct {
|
||||
typedef struct Gwn_ShaderInterface {
|
||||
uint16_t uniform_ct;
|
||||
uint16_t attrib_ct;
|
||||
Gwn_ShaderInput inputs[0]; // dynamic size, uniforms followed by attribs
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
// Is Gwn_VertBuf always used as part of a Gwn_Batch?
|
||||
|
||||
typedef struct {
|
||||
typedef struct Gwn_VertBuf {
|
||||
Gwn_VertFormat format;
|
||||
unsigned vertex_ct;
|
||||
GLubyte* data; // NULL indicates data in VRAM (unmapped) or not yet allocated
|
||||
@ -51,7 +51,7 @@ void GWN_vertbuf_attr_fill(Gwn_VertBuf*, unsigned a_idx, const void* data); // t
|
||||
void GWN_vertbuf_attr_fill_stride(Gwn_VertBuf*, unsigned a_idx, unsigned stride, const void* data);
|
||||
|
||||
// For low level access only
|
||||
typedef struct {
|
||||
typedef struct Gwn_VertBufRaw {
|
||||
unsigned size;
|
||||
unsigned stride;
|
||||
GLubyte* data;
|
||||
|
@ -38,7 +38,7 @@ typedef enum {
|
||||
GWN_FETCH_INT_TO_FLOAT // 127 (any int type) -> 127.0
|
||||
} Gwn_VertFetchMode;
|
||||
|
||||
typedef struct {
|
||||
typedef struct Gwn_VertAttr {
|
||||
Gwn_VertCompType comp_type;
|
||||
unsigned gl_comp_type;
|
||||
unsigned comp_ct; // 1 to 4
|
||||
@ -49,7 +49,7 @@ typedef struct {
|
||||
unsigned name_ct;
|
||||
} Gwn_VertAttr;
|
||||
|
||||
typedef struct {
|
||||
typedef struct Gwn_VertFormat {
|
||||
unsigned attrib_ct; // 0 to 16 (GWN_VERT_ATTR_MAX_LEN)
|
||||
unsigned name_ct; // total count of active vertex attrib
|
||||
unsigned stride; // stride in bytes, 1 to 256
|
||||
@ -67,7 +67,7 @@ void GWN_vertformat_alias_add(Gwn_VertFormat*, const char* alias);
|
||||
|
||||
// format conversion
|
||||
|
||||
typedef struct {
|
||||
typedef struct Gwn_PackedNormal {
|
||||
int x : 10;
|
||||
int y : 10;
|
||||
int z : 10;
|
||||
|
Loading…
Reference in New Issue
Block a user