52#define PB_SIZE (3*MAX_WIDTH)
79#define PB_INIT( PB, PRIM ) \
81 (PB)->mono = GL_FALSE; \
82 (PB)->primitive = (PRIM);
89#define PB_SET_COLOR( CTX, PB, R, G, B, A ) \
90 if ((PB)->color[0]!=(R) || (PB)->color[1]!=(G) \
91 || (PB)->color[2]!=(B) || (PB)->color[3]!=(A) \
105#define PB_SET_INDEX( CTX, PB, I ) \
106 if ((PB)->index!=(I) || !(PB)->mono) { \
107 gl_flush_pb( CTX ); \
110 (PB)->mono = GL_TRUE;
116#define PB_WRITE_PIXEL( PB, X, Y, Z ) \
117 (PB)->x[(PB)->count] = X; \
118 (PB)->y[(PB)->count] = Y; \
119 (PB)->z[(PB)->count] = Z; \
126#define PB_WRITE_RGBA_PIXEL( PB, X, Y, Z, R, G, B, A ) \
127 (PB)->x[(PB)->count] = X; \
128 (PB)->y[(PB)->count] = Y; \
129 (PB)->z[(PB)->count] = Z; \
130 (PB)->r[(PB)->count] = R; \
131 (PB)->g[(PB)->count] = G; \
132 (PB)->b[(PB)->count] = B; \
133 (PB)->a[(PB)->count] = A; \
139#define PB_WRITE_CI_PIXEL( PB, X, Y, Z, I ) \
140 (PB)->x[(PB)->count] = X; \
141 (PB)->y[(PB)->count] = Y; \
142 (PB)->z[(PB)->count] = Z; \
143 (PB)->i[(PB)->count] = I; \
150#define PB_WRITE_TEX_PIXEL( PB, X, Y, Z, R, G, B, A, S, T, U ) \
151 (PB)->x[(PB)->count] = X; \
152 (PB)->y[(PB)->count] = Y; \
153 (PB)->z[(PB)->count] = Z; \
154 (PB)->r[(PB)->count] = R; \
155 (PB)->g[(PB)->count] = G; \
156 (PB)->b[(PB)->count] = B; \
157 (PB)->a[(PB)->count] = A; \
158 (PB)->s[(PB)->count] = S; \
159 (PB)->t[(PB)->count] = T; \
160 (PB)->u[(PB)->count] = U; \
167#define PB_CHECK_FLUSH( CTX, PB ) \
168 if ((PB)->count>=PB_SIZE-MAX_WIDTH) { \
169 gl_flush_pb( CTX ); \
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
GLdouble GLdouble GLdouble r
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
struct pixel_buffer * gl_alloc_pb(void)
void gl_flush_pb(GLcontext *ctx)