00001 #ifndef Z_DBPROC_H
00002 #define Z_DBPROC_H
00003
00021 typedef struct _gtcBufferSwapper gtcBufferSwapper;
00022
00023
00024 enum gtcDBCommands {
00025 gtcDBNop=0,
00026 gtcDBLoadMatrix,
00027 gtcDBPerspective,
00028 gtcDBOrtho,
00029 gtcDBSwapBuffers,
00030 gtcDBLight,
00031 gtcDBLightv,
00032 gtcDBVertices,
00033 gtcDBNormals,
00034 gtcDBTexCoords,
00035 gtcDBColors,
00036 gtcDBEnableClientState,
00037 gtcDBDisableClientState,
00038 gtcDBDrawElements,
00039 gtcDBViewport,
00040 gtcDBClear,
00041 gtcDBColor,
00042 gtcDBEnable,
00043 gtcDBDisable,
00044 gtcDBDepthFunc,
00045 gtcDBLoadIdentity,
00046 gtcDBTexImage2D,
00047 gtcDBBindTexture,
00048 gtcDBDeleteTextures,
00049
00050 gtcDBNoCommand
00051 };
00052
00053 typedef struct _gtcIntList gtcIntList;
00054 struct _gtcIntList
00055 {
00056 int i;
00057 gtcIntList *next;
00058 };
00059
00060 typedef struct _gtcDBBuf
00061 {
00062 gtcIntList first,*last;
00063 gtcDB *db;
00064 int refcount;
00065 } gtcDBBuf;
00066
00067 struct _gtcBufferSwapper
00068 {
00069 void (*car)(gtcBufferSwapper *);
00070
00071 };
00072
00074 gtcDBBuf *gtc_new_buf(void);
00076 void gtc_buf_delete(gtcDBBuf *buf);
00078 gtcDB *gtc_pack_buf(gtcDBBuf *foo);
00080 void gtc_exec_db(gtcDB *db, gtcBufferSwapper *bs, int fast_flag);
00082 int gtc_load_matrix(gtcDBBuf *buf, gtcReal m[4][4]);
00084 int gtc_perspective(gtcDBBuf *buf, gtcReal fovy, gtcReal aspect,
00085 gtcReal zNear, gtcReal zFar);
00087 int gtc_ortho(gtcDBBuf *buf, gtcReal left, gtcReal right,
00088 gtcReal bottom, gtcReal top,
00089 gtcReal zNear, gtcReal zFar);
00091 int gtc_swapbuffers(gtcDBBuf *buf);
00093 int gtc_light(gtcDBBuf *buf, int light, int pname, gtcReal param);
00095 int gtc_lightv(gtcDBBuf *buf, int light, int pname, gtcReal params[]);
00097 int gtc_vertices(gtcDBBuf *buf, int n, gtcReal V[][3]);
00099 int gtc_normals(gtcDBBuf *buf, int n, gtcReal N[][3]);
00101 int gtc_tex_coords(gtcDBBuf *buf, int n, gtcReal T[][2]);
00103 int gtc_colors(gtcDBBuf *buf, int size, int n, char C[]);
00105 int gtc_enable_client_state(gtcDBBuf *buf, int state);
00107 int gtc_disable_client_state(gtcDBBuf *buf, int state);
00109 int gtc_draw_elements(gtcDBBuf *buf, int mode, int n,
00110 unsigned index[]);
00112 int gtc_viewport(gtcDBBuf *buf, unsigned x, unsigned y,
00113 unsigned w, unsigned h);
00115 int gtc_tex_image_2d(gtcDBBuf *buf, unsigned level, unsigned internalformat,
00116 unsigned width, unsigned height, unsigned border,
00117 unsigned format, unsigned type, unsigned bytes_of_pixels,
00118 unsigned char *pixels);
00120 int gtc_clear(gtcDBBuf *buf, int mask);
00122 int gtc_color(gtcDBBuf *buf, int n, char c[]);
00124 int gtc_enable(gtcDBBuf *buf, int cap);
00126 int gtc_disable(gtcDBBuf *buf, int cap);
00128 int gtc_depth_func(gtcDBBuf *buf, int func);
00130 int gtc_load_identity(gtcDBBuf *buf);
00132 int gtc_bind_texture(gtcDBBuf *buf, unsigned target, unsigned texture);
00134 int gtc_delete_textures(gtcDBBuf *buf, unsigned n, unsigned textures[]);
00136 void gtc_client_send(gtcClient *cli, gtcDBBuf *buf);
00137
00139 void gtc_server_send(gtcServer *s, int client, gtcDBBuf *buf);
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153 #include <gtcglsyms.h>
00154
00155 #define gtcColorBufferBit 1
00156 #define gtcDepthBufferBit 2
00157 #define gtcAccumBufferBit 4
00158 #define gtcStencilBufferBit 8
00159
00160 #endif