-
Notifications
You must be signed in to change notification settings - Fork 3
/
SWprogram.h
56 lines (46 loc) · 2.64 KB
/
SWprogram.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef SW_PROGRAM_H
#define SW_PROGRAM_H
#include "SWcore.h"
#define SW_MAX_VTX_ATTRIBS 16
#define SW_MAX_UNIFORMS 32
typedef struct SWprogram {
vtx_shader_proc v_proc;
SWint v_out_size;
frag_shader_proc f_proc;
SWvtx_attribute vertex_attributes[SW_MAX_VTX_ATTRIBS];
SWuint num_attributes;
SWuniform uniforms[SW_MAX_UNIFORMS];
SWubyte *uniform_buf;
SWuint unifrom_buf_size;
} SWprogram;
void swProgInit(SWprogram *p, SWubyte *uniform_buf, vtx_shader_proc v_proc,
frag_shader_proc f_proc, SWint v_out_floats);
void swProgDestroy(SWprogram *p);
void swProgSetVtxAttribPointer(SWprogram *p, SWcontext *ctx, SWuint index, SWint size,
SWint stride, const void *pointer);
void swProgDisableVtxAttrib(SWprogram *p, SWuint index);
void swProgRegUniform(SWprogram *p, SWint index, SWenum type);
void swProgRegUniformv(SWprogram *p, SWint index, SWenum type, SWint num);
void swProgSetProgramUniform(SWprogram *p, SWint index, SWenum type, const void *data);
void swProgSetProgramUniformv(SWprogram *p, SWint index, SWenum type, SWint num,
const void *data);
void swProgDrawLinesArray(SWprogram *p, SWcontext *ctx, SWuint first, SWuint count);
void swProgDrawLineStripArray(SWprogram *p, SWcontext *ctx, SWuint first, SWuint count);
void swProgDrawLinesIndexed(SWprogram *p, SWcontext *ctx, SWuint count, SWenum index_type,
const void *indices);
void swProgDrawLineStripIndexed(SWprogram *p, SWcontext *ctx, SWuint count,
SWenum index_type, const void *indices);
void swProgDrawCurvesArray(SWprogram *p, SWcontext *ctx, SWuint first, SWuint count);
void swProgDrawCurveStripArray(SWprogram *p, SWcontext *ctx, SWuint first, SWuint count);
void swProgDrawCurvesIndexed(SWprogram *p, SWcontext *ctx, SWuint count,
SWenum index_type, const void *indices);
void swProgDrawCurveStripIndexed(SWprogram *p, SWcontext *ctx, SWuint count,
SWenum index_type, const void *indices);
void swProgDrawTrianglesArray(SWprogram *p, SWcontext *ctx, SWuint first, SWuint count);
void swProgDrawTriangleStripArray(SWprogram *p, SWcontext *ctx, SWuint first,
SWuint count);
void swProgDrawTrianglesIndexed(SWprogram *p, SWcontext *ctx, SWuint count,
SWenum index_type, const void *indices);
void swProgDrawTriangleStripIndexed(SWprogram *p, SWcontext *ctx, SWuint count,
SWenum index_type, const void *indices);
#endif /* SW_PROGRAM_H */