Max 5 API Reference
00001 #ifndef JIT_GL_VBO_H 00002 #define JIT_GL_VBO_H 00003 00004 /* 00005 * Copyright 2001-2005 - Cycling '74 00006 * Derek Gerstmann - derek@cycling74.com 00007 * 00008 * Struct and associated methods for maintaining an OpenGL 00009 * vertex buffer object (vbo). 00010 * 00011 */ 00012 00013 /****************************************************************************/ 00014 00015 #include "jit.gl.h" 00016 #include "jit.common.h" 00017 00018 /****************************************************************************/ 00019 00020 #ifdef __cplusplus 00021 extern "C" { 00022 #endif 00023 00024 #if C74_PRAGMA_STRUCT_PACKPUSH 00025 #pragma pack(push, 2) 00026 #elif C74_PRAGMA_STRUCT_PACK 00027 #pragma pack(2) 00028 #endif 00029 00030 /****************************************************************************/ 00031 00032 #define JIT_GL_VBO_TYPE_INDEX (1) 00033 #define JIT_GL_VBO_TYPE_VERTEX (2) 00034 #define JIT_GL_VBO_TYPE_TEXCOORD (3) 00035 #define JIT_GL_VBO_TYPE_NORMAL (4) 00036 #define JIT_GL_VBO_TYPE_COLOR (5) 00037 #define JIT_GL_VBO_TYPE_EDGEFLAG (6) 00038 #define JIT_GL_VBO_TYPE_TANGENT (7) 00039 #define JIT_GL_VBO_TYPE_BINORMAL (8) 00040 #define JIT_GL_VBO_TYPE_AUX0 (9) 00041 #define JIT_GL_VBO_TYPE_AUX1 (10) 00042 #define JIT_GL_VBO_TYPE_AUX2 (11) 00043 #define JIT_GL_VBO_TYPE_AUX3 (12) 00044 #define JIT_GL_VBO_TYPE_AUX4 (13) 00045 #define JIT_GL_VBO_TYPE_AUX5 (14) 00046 #define JIT_GL_VBO_TYPE_AUX6 (15) 00047 #define JIT_GL_VBO_TYPE_AUX7 (16) 00048 00049 /****************************************************************************/ 00050 00051 typedef struct _jit_gl_vbo 00052 { 00053 t_object ob; 00054 void *handle; // handle to buffer object 00055 long type; // buffer type (VERTEX_ARRAY) 00056 long datatype; // enum opengl datatype (GL_FLOAT, etc) 00057 long buffer; // GL_ELEMENT_ARRAY_BUFFER_ARB or GL_ARRAY_BUFFER_ARB 00058 long mode; // update mode (GL_STREAM_WRITE, etc) 00059 long coords; // number of coordinates per element 00060 long stride; // stride of data elements 00061 long size; // total size of buffer object in bytes 00062 long id; // id of buffer object 00063 } t_jit_gl_vbo; 00064 00065 t_jit_err jit_gl_vbo_init(void); 00066 t_jit_gl_vbo *jit_gl_vbo_new(void); 00067 t_jit_err jit_gl_vbo_create(t_jit_gl_vbo *x, long type, long mode, long datatype, long coords, long stride, long size, void *data); 00068 t_jit_err jit_gl_vbo_bind(t_jit_gl_vbo *x); 00069 t_jit_err jit_gl_vbo_unbind(t_jit_gl_vbo *x); 00070 t_jit_err jit_gl_vbo_destroy(t_jit_gl_vbo *x); 00071 t_jit_err jit_gl_vbo_reset(t_jit_gl_vbo *x); 00072 void jit_gl_vbo_free(t_jit_gl_vbo *x); 00073 00074 /****************************************************************************/ 00075 00076 00077 #if C74_PRAGMA_STRUCT_PACKPUSH 00078 #pragma pack(pop) 00079 #elif C74_PRAGMA_STRUCT_PACK 00080 #pragma pack() 00081 #endif 00082 00083 #ifdef __cplusplus 00084 } 00085 #endif 00086 00087 /****************************************************************************/ 00088 00089 #endif // JIT_GL_VBO_H
Copyright © 2008, Cycling '74