ae335eeff1
This should be much faster as matrix loading is now minimized. Also splits transform from perspective divisionn to lay the groundwork for near-z clipping. This also fixes GL_POLYGON submission. Lighting can be made faster, this doesn't change the lighting algorithm, but the matrix changes should speed things up.
32 lines
997 B
C
32 lines
997 B
C
#ifndef ALIGNED_VECTOR_H
|
|
#define ALIGNED_VECTOR_H
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef struct {
|
|
unsigned int size;
|
|
unsigned int capacity;
|
|
unsigned char* data;
|
|
unsigned int element_size;
|
|
} AlignedVector;
|
|
|
|
#define ALIGNED_VECTOR_INITIAL_CAPACITY 256u
|
|
|
|
void aligned_vector_init(AlignedVector* vector, unsigned int element_size);
|
|
void aligned_vector_reserve(AlignedVector* vector, unsigned int element_count);
|
|
void aligned_vector_push_back(AlignedVector* vector, const void* objs, unsigned int count);
|
|
void aligned_vector_resize(AlignedVector* vector, const unsigned int element_count);
|
|
void* aligned_vector_at(const AlignedVector* vector, const unsigned int index);
|
|
void* aligned_vector_extend(AlignedVector* vector, const unsigned int additional_count);
|
|
void aligned_vector_clear(AlignedVector* vector);
|
|
void aligned_vector_shrink_to_fit(AlignedVector* vector);
|
|
void aligned_vector_cleanup(AlignedVector* vector);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif // ALIGNED_VECTOR_H
|