2015-07-25 03:29:45 +00:00
|
|
|
//
|
|
|
|
// CRTFrame.h
|
|
|
|
// Clock Signal
|
|
|
|
//
|
|
|
|
// Created by Thomas Harte on 24/07/2015.
|
|
|
|
// Copyright © 2015 Thomas Harte. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef CRTFrame_h
|
|
|
|
#define CRTFrame_h
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2015-07-26 19:13:46 +00:00
|
|
|
typedef struct {
|
2015-07-25 03:29:45 +00:00
|
|
|
uint8_t *data;
|
2015-08-16 20:08:29 +00:00
|
|
|
unsigned int depth;
|
2015-07-26 19:13:46 +00:00
|
|
|
} CRTBuffer;
|
2015-07-25 03:29:45 +00:00
|
|
|
|
|
|
|
typedef struct {
|
2015-08-16 20:08:29 +00:00
|
|
|
uint16_t width, height;
|
2015-07-25 03:29:45 +00:00
|
|
|
} CRTSize;
|
|
|
|
|
2016-01-20 13:21:33 +00:00
|
|
|
typedef enum {
|
|
|
|
CRTGeometryModeTriangles
|
|
|
|
} CRTGeometryMode;
|
|
|
|
|
2015-07-26 19:13:46 +00:00
|
|
|
typedef struct {
|
2016-01-20 13:21:33 +00:00
|
|
|
/** The total size, in pixels, of the pixel buffer storage. Guaranteed to be a power of two. */
|
|
|
|
CRTSize size;
|
|
|
|
|
|
|
|
/** The portion of the pixel buffer that has been changed since the last time this set of buffers was provided. */
|
|
|
|
CRTSize dirty_size;
|
2015-07-25 03:29:45 +00:00
|
|
|
|
2016-01-20 13:21:33 +00:00
|
|
|
/** The number of individual buffers that adds up to the complete pixel buffer. */
|
2015-08-16 20:08:29 +00:00
|
|
|
unsigned int number_of_buffers;
|
2016-01-20 13:21:33 +00:00
|
|
|
|
|
|
|
/** A C array of those buffers. */
|
2015-07-25 03:29:45 +00:00
|
|
|
CRTBuffer *buffers;
|
|
|
|
|
2016-01-20 13:21:33 +00:00
|
|
|
/** The number of vertices that constitute the output. */
|
|
|
|
unsigned int number_of_vertices;
|
2015-07-25 03:29:45 +00:00
|
|
|
|
2016-01-20 13:21:33 +00:00
|
|
|
/** The type of output. */
|
|
|
|
CRTGeometryMode geometry_mode;
|
|
|
|
|
|
|
|
/** The size of each vertex in bytes. */
|
|
|
|
size_t size_per_vertex;
|
|
|
|
|
|
|
|
/** The vertex data. */
|
|
|
|
uint8_t *vertices;
|
|
|
|
} CRTFrame;
|
2015-08-06 01:12:33 +00:00
|
|
|
|
2016-01-20 13:21:33 +00:00
|
|
|
// TODO: these should be private to whomever builds the shaders
|
2015-08-06 01:12:33 +00:00
|
|
|
static const size_t kCRTVertexOffsetOfPosition = 0;
|
|
|
|
static const size_t kCRTVertexOffsetOfTexCoord = 4;
|
|
|
|
static const size_t kCRTVertexOffsetOfLateral = 8;
|
|
|
|
static const size_t kCRTVertexOffsetOfPhase = 9;
|
|
|
|
|
|
|
|
static const int kCRTSizeOfVertex = 10;
|
2015-08-02 18:25:21 +00:00
|
|
|
|
2015-08-19 00:33:59 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2015-07-25 03:29:45 +00:00
|
|
|
#endif /* CRTFrame_h */
|