Max 5 API Reference
00001 #ifndef JIT_GL_PBO_H 00002 #define JIT_GL_PBO_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 * pixel buffer object (PBO). 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 typedef struct _jit_gl_pbo 00033 { 00034 t_object ob; // jitter object 00035 void *ob3d; // jitter ob3d 00036 long id; // id of buffer object 00037 long size; // size of buffer object in bytes 00038 long planecount; // planecount e.g. XYZ / ARGB etc. 00039 long offset[2]; // offset into an opengl buffer when reading 00040 long dim[2]; // dimensions of PBO 00041 void *handle; // handle to buffer objecy 00042 t_symbol *type; // type as a symbol in Jitter terms 00043 GLenum gltype; // data format type in OpenGL 00044 t_symbol *target; // target of PBO in sym form 00045 GLenum gltarget; // target of PBO 00046 t_symbol *usage; // usage in sym form 00047 GLenum glusage; // how the PBO interacts with OpenGL 00048 long destroy; // destroy flag 00049 long recreate; // create after destruction flag 00050 } t_jit_gl_pbo; 00051 00052 t_jit_gl_pbo *jit_gl_pbo_new(void); 00053 GLenum jit_gl_pbo_gltarget_from_target(t_symbol *target); 00054 GLenum jit_gl_pbo_glusage_from_usage(t_symbol *usage); 00055 GLenum jit_gl_pbo_gltype_from_type(t_symbol *type); 00056 long jit_gl_pbo_datasize_from_gltype(GLenum gltype); 00057 t_jit_err jit_gl_pbo_create(t_jit_gl_pbo *x); 00058 t_jit_err jit_gl_pbo_from_matrix(t_jit_gl_pbo *x, t_jit_matrix_info *minfo, char *bp); 00059 t_jit_err jit_gl_pbo_to_matrix(t_jit_gl_pbo *x, t_jit_matrix_info *minfo, char *bp); 00060 t_jit_err jit_gl_pbo_dest_changed(t_jit_gl_pbo *x); 00061 t_jit_err jit_gl_pbo_dest_closing(t_jit_gl_pbo *x); 00062 t_jit_err jit_gl_pbo_draw(t_jit_gl_pbo *x); 00063 t_jit_err jit_gl_pbo_bind(t_jit_gl_pbo *x); 00064 t_jit_err jit_gl_pbo_unbind(t_jit_gl_pbo *x); 00065 t_jit_err jit_gl_pbo_destroy(t_jit_gl_pbo *x); 00066 t_jit_err jit_gl_pbo_readpixels(t_jit_gl_pbo *x); 00067 t_jit_err jit_gl_pbo_getteximage(t_jit_gl_pbo *x, GLenum tex_target); 00068 t_jit_err jit_gl_pbo_reset(t_jit_gl_pbo *x); 00069 void jit_gl_pbo_free(t_jit_gl_pbo *x); 00070 00071 t_jit_err jit_gl_pbo_setattr_dim(t_jit_gl_pbo *x, void *attr, long argc, t_atom *argv); 00072 t_jit_err jit_gl_pbo_setattr_offset(t_jit_gl_pbo *x, void *attr, long argc, t_atom *argv); 00073 t_jit_err jit_gl_pbo_setattr_target(t_jit_gl_pbo *x, void *attr, long argc, t_atom *argv); 00074 t_jit_err jit_gl_pbo_setattr_usage(t_jit_gl_pbo *x, void *attr, long argc, t_atom *argv); 00075 t_jit_err jit_gl_pbo_setattr_planecount(t_jit_gl_pbo *x, void *attr, long argc, t_atom *argv); 00076 t_jit_err jit_gl_pbo_setattr_type(t_jit_gl_pbo *x, void *attr, long argc, t_atom *argv); 00077 00078 /****************************************************************************/ 00079 00080 00081 #if C74_PRAGMA_STRUCT_PACKPUSH 00082 #pragma pack(pop) 00083 #elif C74_PRAGMA_STRUCT_PACK 00084 #pragma pack() 00085 #endif 00086 00087 #ifdef __cplusplus 00088 } 00089 #endif 00090 00091 /****************************************************************************/ 00092 00093 #endif // JIT_GL_PBO_H
Copyright © 2008, Cycling '74