OB3D Module
+ Collaboration diagram for OB3D Module:

Functions

long jit_gl_report_error (char *prefix)
 Tests for OpenGL error and reports to Max window. More...
 
const char * jit_gl_get_vendor ()
 Retrieves OpenGL vendor string. More...
 
const char * jit_gl_get_renderer ()
 Retrieves OpenGL renderer string. More...
 
const char * jit_gl_get_version ()
 Retrieves OpenGL version string. More...
 
const char * jit_gl_get_glu_version ()
 Retrieves OpenGL GL Utilities version string. More...
 
const char * jit_gl_get_extensions ()
 Retrieves OpenGL extensions string. More...
 
const char * jit_gl_get_glsl_version ()
 Retrieves OpenGL GLSL version string. More...
 
char jit_gl_is_min_version (int major, int minor, int release)
 Tests current OpenGL version to be greater than or equal to the version provided. More...
 
char jit_gl_is_extension_supported (t_jit_gl_context ctx, const char *ext)
 Given a t_jit_gl_context pointer, checks to see if it suppports the provided extension. More...
 
t_jit_glchunkjit_glchunk_new (t_symbol *prim, int planes, int vertices, int indices)
 Allocates and initializes a t_jit_glchunk struct. More...
 
t_jit_glchunkjit_glchunk_grid_new (t_symbol *prim, int planes, int width, int height)
 Allocates and initializes a t_jit_glchunk struct with 2D grid matrix. More...
 
void jit_glchunk_delete (t_jit_glchunk *x)
 Disposes t_jit_glchunk struct. More...
 
t_jit_err jit_glchunk_copy (t_jit_glchunk **new, t_jit_glchunk *orig)
 Allocates t_jit_glchunk struct, and copies from t_jit_gl_struct provided. More...
 
t_jit_err jit_gl_drawinfo_setup (void *x, t_jit_gl_drawinfo *drawinfo)
 Initializes t_jit_gl_drawinfo struct with the current context and ob3d. More...
 
long jit_gl_drawinfo_active_textures (t_jit_gl_drawinfo *drawinfo)
 Determine the number of active texture units to use. More...
 
void jit_gl_texcoord1f (t_jit_gl_drawinfo *drawinfo, float s)
 Set texture coordinate for all active texture units. More...
 
void jit_gl_texcoord2f (t_jit_gl_drawinfo *drawinfo, float s, float t)
 Set texture coordinate for all active texture units. More...
 
void jit_gl_texcoord3f (t_jit_gl_drawinfo *drawinfo, float s, float t, float r)
 Set texture coordinate for all active texture units. More...
 
void jit_gl_texcoord1fv (t_jit_gl_drawinfo *drawinfo, float *v)
 Set texture coordinate for all active texture units. More...
 
void jit_gl_texcoord2fv (t_jit_gl_drawinfo *drawinfo, float *v)
 Set texture coordinate for all active texture units. More...
 
void jit_gl_texcoord3fv (t_jit_gl_drawinfo *drawinfo, float *v)
 Set texture coordinate for all active texture units. More...
 
void jit_gl_bindtexture (t_jit_gl_drawinfo *drawinfo, t_symbol *s, long i)
 Bind texture for specified texture unit. More...
 
void jit_gl_unbindtexture (t_jit_gl_drawinfo *drawinfo, t_symbol *s, long i)
 Unbind texture for specified texture unit. More...
 
void jit_gl_begincapture (t_jit_gl_drawinfo *drawinfo, t_symbol *s, long i)
 Begin texture capture. More...
 
void jit_gl_endcapture (t_jit_gl_drawinfo *drawinfo, t_symbol *s, long i)
 End texture capture. More...
 
void * jit_ob3d_setup (void *jit_class, long oboffset, long flags)
 Adds default methods and attributes to the OB3D class. More...
 
void * jit_ob3d_new (void *x, t_symbol *dest_name)
 Allocates and initializes OB3D resources. More...
 
void jit_ob3d_free (void *jit_ob)
 Disposes OB3D resources. More...
 
t_jit_err jit_ob3d_set_context (void *jit_ob)
 Sets the current Open GL context to the context referenced by the OB3D drawto attribute. More...
 
void * ob3d_jitob_get (void *v)
 Retrieves parent Jitter object from opaque t_jit_ob3d struct. More...
 
void * ob3d_patcher_get (void *v)
 Retrieves containing patcher object from opaque t_jit_ob3d struct. More...
 
long ob3d_auto_get (void *v)
 Retrieves automatic flag from opaque t_jit_ob3d struct. More...
 
long ob3d_enable_get (void *v)
 Retrieves enable flag from opaque t_jit_ob3d struct. More...
 
long ob3d_ui_get (void *v)
 Retrieves UI flag from opaque t_jit_ob3d struct. More...
 
void * ob3d_outlet_get (void *v)
 Retrieves matrix outlet from opaque t_jit_ob3d struct. More...
 
long ob3d_dirty_get (void *v)
 Retrieves dirty flag from opaque t_jit_ob3d struct. More...
 
void ob3d_dirty_set (void *v, long c)
 Sets dirty flag from opaque t_jit_ob3d struct. More...
 
void ob3d_dest_dim_set (void *v, long width, long height)
 Sets destination dimensions in opaque t_jit_ob3d struct. More...
 
void ob3d_dest_dim_get (void *v, long *width, long *height)
 Gets destination dimensions from opaque t_jit_ob3d struct. More...
 
void ob3d_render_ptr_set (void *v, void *render_ptr)
 Sets renderer pointer in opaque t_jit_ob3d struct. More...
 
void * ob3d_render_ptr_get (void *v)
 Gets renderer pointer from opaque t_jit_ob3d struct. More...
 
void max_ob3d_setup (void)
 Adds default methods and OB3D Max wrapper class.
 
void max_jit_class_ob3d_wrap (t_class *c)
 Adds default methods and OB3D Max wrapper class.
 
void max_jit_ob3d_attach (void *x, t_jit_object *jit_ob, void *outlet)
 Allocates and initializes OB3D Max wrapper related resources. More...
 
void max_jit_ob3d_detach (void *x)
 Disposes OB3D Max wrapper related resources. More...
 
t_jit_err max_jit_ob3d_assist (void *x, void *b, long m, long a, char *s)
 Default OB3D Max wrapper assistance method. More...
 
void max_ob3d_bang (t_max_object *x)
 Default OB3D Max wrapper bang method. More...
 
void max_ob3d_notify (t_max_object *x, t_symbol *sender_name, t_symbol *msg, void *p_sender)
 Default OB3D Max wrapper notification method. More...
 
t_jit_err jit_ob3d_draw_chunk (void *v, t_jit_glchunk *chunk)
 Draws one t_jit_glchunk If the OB3D is not in matrixoutput mode, the drawing call is made directly to the renderer. More...
 

Detailed Description

Function Documentation

void jit_gl_begincapture ( t_jit_gl_drawinfo drawinfo,
t_symbol s,
long  i 
)

Begin texture capture.

Parameters
drawinfot_jit_gl_drawinfo pointer
stexture name
iignored

References error(), jit_atom_setobj(), jit_gl_report_error(), jit_object_classname(), jit_object_findregistered(), t_jit_gl_drawinfo::ob3d, sysmem_freeptr(), and sysmem_newptr().

+ Here is the call graph for this function:

void jit_gl_bindtexture ( t_jit_gl_drawinfo drawinfo,
t_symbol s,
long  i 
)

Bind texture for specified texture unit.

Parameters
drawinfot_jit_gl_drawinfo pointer
stexture name
itexture unit

References t_jit_gl_drawinfo::ob3d.

long jit_gl_drawinfo_active_textures ( t_jit_gl_drawinfo drawinfo)

Determine the number of active texture units to use.

Parameters
drawinfot_jit_gl_drawinfo pointer
Returns
number of active texture units

References t_jit_gl_drawinfo::ctx, and t_jit_gl_drawinfo::ob3d.

t_jit_err jit_gl_drawinfo_setup ( void *  x,
t_jit_gl_drawinfo drawinfo 
)

Initializes t_jit_gl_drawinfo struct with the current context and ob3d.

Parameters
xJitter object pointer
drawinfot_jit_gl_drawinfo pointer
Returns
t_jit_err error code

References t_jit_gl_drawinfo::ctx, and t_jit_gl_drawinfo::ob3d.

void jit_gl_endcapture ( t_jit_gl_drawinfo drawinfo,
t_symbol s,
long  i 
)

End texture capture.

Parameters
drawinfot_jit_gl_drawinfo pointer
stexture name
iignored

References t_jit_gl_drawinfo::ob3d.

const char* jit_gl_get_extensions ( )

Retrieves OpenGL extensions string.

Equivalent to glGetString(GL_EXTENSIONS). Assumes a valid context has been set.

Returns
OpenGL GL extensions string
const char* jit_gl_get_glsl_version ( )

Retrieves OpenGL GLSL version string.

Equivalent to glGetString(GL_SHADING_LANGUAGE_VERSION). Assumes a valid context has been set and the OpenGL renderer supports GLSL.

Returns
OpenGL GL GLSL version string
const char* jit_gl_get_glu_version ( )

Retrieves OpenGL GL Utilities version string.

Equivalent to glGetString(GL_GLU_VERSION). Assumes a valid context has been set.

Returns
OpenGL GL Utilities version string
const char* jit_gl_get_renderer ( )

Retrieves OpenGL renderer string.

Equivalent to glGetString(GL_RENDERER). Assumes a valid context has been set.

Returns
OpenGL renderer string
const char* jit_gl_get_vendor ( )

Retrieves OpenGL vendor string.

Equivalent to glGetString(GL_VENDOR). Assumes a valid context has been set.

Returns
OpenGL vendor string
const char* jit_gl_get_version ( )

Retrieves OpenGL version string.

Equivalent to glGetString(GL_VERSION). Assumes a valid context has been set.

Returns
OpenGL version string

Referenced by jit_gl_is_min_version().

char jit_gl_is_extension_supported ( t_jit_gl_context  ctx,
const char *  ext 
)

Given a t_jit_gl_context pointer, checks to see if it suppports the provided extension.

Equivalent to testing for the substring within the string returned by glGetString(GL_EXTENSIONS).

Parameters
ctxt_jit_gl_context pointer
extextension string
Returns
1 if true, 0 if false.
char jit_gl_is_min_version ( int  major,
int  minor,
int  release 
)

Tests current OpenGL version to be greater than or equal to the version provided.

Assumes a valid context has been set.

Parameters
majormajor version number
minorminor version number
releaserelease version number
Returns
1 if true, 0 if false.

References jit_gl_get_version().

+ Here is the call graph for this function:

long jit_gl_report_error ( char *  prefix)

Tests for OpenGL error and reports to Max window.

Parameters
prefixprefix string
Returns
OpenGL error code

References error(), and post().

Referenced by jit_gl_begincapture().

+ Here is the call graph for this function:

void jit_gl_texcoord1f ( t_jit_gl_drawinfo drawinfo,
float  s 
)

Set texture coordinate for all active texture units.

Equivalent to glMultiTexCoord1fARB for each active texture unit.

Parameters
drawinfot_jit_gl_drawinfo pointer
ss texture coordinate

References t_jit_gl_drawinfo::ctx, MIN, and t_jit_gl_drawinfo::ob3d.

void jit_gl_texcoord1fv ( t_jit_gl_drawinfo drawinfo,
float *  v 
)

Set texture coordinate for all active texture units.

Equivalent to glMultiTexCoord1fvARB for each active texture unit.

Parameters
drawinfot_jit_gl_drawinfo pointer
vtexture coordinate vector

References t_jit_gl_drawinfo::ctx, MIN, and t_jit_gl_drawinfo::ob3d.

void jit_gl_texcoord2f ( t_jit_gl_drawinfo drawinfo,
float  s,
float  t 
)

Set texture coordinate for all active texture units.

Equivalent to glMultiTexCoord2fARB for each active texture unit.

Parameters
drawinfot_jit_gl_drawinfo pointer
ss texture coordinate
tt texture coordinate

References t_jit_gl_drawinfo::ctx, MAX, MIN, and t_jit_gl_drawinfo::ob3d.

void jit_gl_texcoord2fv ( t_jit_gl_drawinfo drawinfo,
float *  v 
)

Set texture coordinate for all active texture units.

Equivalent to glMultiTexCoord2fvARB for each active texture unit.

Parameters
drawinfot_jit_gl_drawinfo pointer
vtexture coordinate vector

References t_jit_gl_drawinfo::ctx, MIN, and t_jit_gl_drawinfo::ob3d.

void jit_gl_texcoord3f ( t_jit_gl_drawinfo drawinfo,
float  s,
float  t,
float  r 
)

Set texture coordinate for all active texture units.

Equivalent to glMultiTexCoord3fARB for each active texture unit.

Parameters
drawinfot_jit_gl_drawinfo pointer
ss texture coordinate
tt texture coordinate
rr texture coordinate

References t_jit_gl_drawinfo::ctx, MIN, and t_jit_gl_drawinfo::ob3d.

void jit_gl_texcoord3fv ( t_jit_gl_drawinfo drawinfo,
float *  v 
)

Set texture coordinate for all active texture units.

Equivalent to glMultiTexCoord3fvARB for each active texture unit.

Parameters
drawinfot_jit_gl_drawinfo pointer
vtexture coordinate vector

References t_jit_gl_drawinfo::ctx, MIN, and t_jit_gl_drawinfo::ob3d.

void jit_gl_unbindtexture ( t_jit_gl_drawinfo drawinfo,
t_symbol s,
long  i 
)

Unbind texture for specified texture unit.

Parameters
drawinfot_jit_gl_drawinfo pointer
stexture name
itexture unit

References t_jit_gl_drawinfo::ob3d.

t_jit_err jit_glchunk_copy ( t_jit_glchunk **  new,
t_jit_glchunk orig 
)

Allocates t_jit_glchunk struct, and copies from t_jit_gl_struct provided.

Parameters
newpointer to new t_jit_glchunk pointer
origpriginal t_jit_glchunk pointer
Returns
t_jit_err error code

References _jit_sym_frommatrix, _jit_sym_getinfo, _jit_sym_jit_matrix, _jit_sym_nothing, jit_getbytes(), jit_glchunk_copy(), jit_glchunk_delete(), t_jit_glchunk::m_flags, t_jit_glchunk::m_index, t_jit_glchunk::m_index_name, t_jit_glchunk::m_vertex, t_jit_glchunk::m_vertex_name, t_jit_glchunk::next_chunk, and t_jit_glchunk::prim.

Referenced by jit_glchunk_copy(), and jit_ob3d_draw_chunk().

+ Here is the call graph for this function:

t_jit_glchunk* jit_glchunk_grid_new ( t_symbol prim,
int  planes,
int  width,
int  height 
)

Allocates and initializes a t_jit_glchunk struct with 2D grid matrix.

Parameters
primdrawing primitive name
planesnumber of planes to allocate in vertex matrix
widthwidth of vertex matrix to allocate
heightheight of vertex matrix to allocate
Returns
t_jit_glchunk pointer

References _jit_sym_float32, _jit_sym_jit_matrix, _jit_sym_nothing, t_jit_matrix_info::dim, t_jit_matrix_info::dimcount, jit_getbytes(), jit_glchunk_delete(), jit_matrix_info_default(), t_jit_glchunk::m_flags, t_jit_glchunk::m_index, t_jit_glchunk::m_index_name, t_jit_glchunk::m_vertex, t_jit_glchunk::m_vertex_name, t_jit_glchunk::next_chunk, t_jit_matrix_info::planecount, t_jit_glchunk::prim, and t_jit_matrix_info::type.

+ Here is the call graph for this function:

t_jit_glchunk* jit_glchunk_new ( t_symbol prim,
int  planes,
int  vertices,
int  indices 
)

Allocates and initializes a t_jit_glchunk struct.

Parameters
primdrawing primitive name
planesnumber of planes to allocate in vertex matrix
verticesnumber of vertices to allocate in vertex matrix
indicesnumber of indices to allocate in index matrix, if used
Returns
t_jit_glchunk pointer

References _jit_sym_float32, _jit_sym_jit_matrix, _jit_sym_long, _jit_sym_nothing, t_jit_matrix_info::dim, t_jit_matrix_info::dimcount, jit_getbytes(), jit_glchunk_delete(), jit_matrix_info_default(), t_jit_glchunk::m_flags, t_jit_glchunk::m_index, t_jit_glchunk::m_index_name, t_jit_glchunk::m_vertex, t_jit_glchunk::m_vertex_name, t_jit_glchunk::next_chunk, t_jit_matrix_info::planecount, t_jit_glchunk::prim, and t_jit_matrix_info::type.

+ Here is the call graph for this function:

t_jit_err jit_ob3d_draw_chunk ( void *  v,
t_jit_glchunk chunk 
)

Draws one t_jit_glchunk If the OB3D is not in matrixoutput mode, the drawing call is made directly to the renderer.

Otherwise, the chunk is sent out the OB3D's outlet as a message compatible with jit.gl.render.

Parameters
vt_jit_ob3d pointer
chunkt_jit_glchunk pointer
Returns
t_jit_err error code

References _jit_sym_nothing, _jit_sym_register, jit_atom_setlong(), jit_glchunk_copy(), jit_glchunk_delete(), and jit_object_notify().

+ Here is the call graph for this function:

void jit_ob3d_free ( void *  jit_ob)

Disposes OB3D resources.

Parameters
jit_obJitter object pointer

References _jit_sym_nothing, gensym(), jit_attr_getsym(), jit_attr_setsym(), jit_freebytes(), jit_glchunk_delete(), jit_object_classname(), and jit_object_free().

+ Here is the call graph for this function:

void* jit_ob3d_new ( void *  x,
t_symbol dest_name 
)

Allocates and initializes OB3D resources.

Parameters
xJitter object pointer
dest_namedrawing destination name
Returns
t_jit_ob3d pointer (opaque)

References _jit_sym_name, _jit_sym_nothing, gensym(), jit_atom_setsym(), jit_attr_getsym(), jit_attr_setsym(), jit_getbytes(), jit_object_classname(), and jit_object_getmethod().

+ Here is the call graph for this function:

t_jit_err jit_ob3d_set_context ( void *  jit_ob)

Sets the current Open GL context to the context referenced by the OB3D drawto attribute.

Warning
Not recommended for use within the draw method, as it can have adverse effects when rendering to alternate contexts as is the case when capturing to a texture.
Parameters
jit_obJitter object pointer
Returns
t_jit_err error code
void* jit_ob3d_setup ( void *  jit_class,
long  oboffset,
long  flags 
)
t_jit_err max_jit_ob3d_assist ( void *  x,
void *  b,
long  m,
long  a,
char *  s 
)

Default OB3D Max wrapper assistance method.

Parameters
xMax object pointer
bignored
minlet or outlet type
aindex
soutput string
Returns
t_jit_err error code
void max_jit_ob3d_attach ( void *  x,
t_jit_object jit_ob,
void *  outlet 
)

Allocates and initializes OB3D Max wrapper related resources.

Parameters
xMax wrapper object pointer
jit_obJitter object pointer
outletmatrix outlet pointer

References _jit_sym_name, jit_attr_getsym(), and jit_object_attach().

+ Here is the call graph for this function:

void max_jit_ob3d_detach ( void *  x)

Disposes OB3D Max wrapper related resources.

Parameters
xMax wrapper object pointer

References _jit_sym_name, jit_attr_getsym(), jit_object_detach(), and max_jit_obex_jitob_get().

+ Here is the call graph for this function:

void max_ob3d_bang ( t_max_object x)

Default OB3D Max wrapper bang method.

Parameters
xMax object pointer

References typedmess().

Referenced by max_jit_class_ob3d_wrap(), and max_ob3d_setup().

+ Here is the call graph for this function:

void max_ob3d_notify ( t_max_object x,
t_symbol sender_name,
t_symbol msg,
void *  p_sender 
)

Default OB3D Max wrapper notification method.

Parameters
xMax object pointer
sender_namesender's object name
msgnotification message
p_sendersender's object pointer

Referenced by max_jit_class_ob3d_wrap(), and max_ob3d_setup().

long ob3d_auto_get ( void *  v)

Retrieves automatic flag from opaque t_jit_ob3d struct.

Parameters
vt_jit_ob3d pointer
Returns
automatic flag
void ob3d_dest_dim_get ( void *  v,
long *  width,
long *  height 
)

Gets destination dimensions from opaque t_jit_ob3d struct.

Parameters
vt_jit_ob3d pointer
widthdestination dimensions width pointer
heightdestination dimensions height pointer
void ob3d_dest_dim_set ( void *  v,
long  width,
long  height 
)

Sets destination dimensions in opaque t_jit_ob3d struct.

Parameters
vt_jit_ob3d pointer
widthdestination dimensions width
heightdestination dimensions height
long ob3d_dirty_get ( void *  v)

Retrieves dirty flag from opaque t_jit_ob3d struct.

Parameters
vt_jit_ob3d pointer
Returns
dirty flag
void ob3d_dirty_set ( void *  v,
long  c 
)

Sets dirty flag from opaque t_jit_ob3d struct.

Parameters
vt_jit_ob3d pointer
cdirty flag state
long ob3d_enable_get ( void *  v)

Retrieves enable flag from opaque t_jit_ob3d struct.

Parameters
vt_jit_ob3d pointer
Returns
enable flag
void* ob3d_jitob_get ( void *  v)

Retrieves parent Jitter object from opaque t_jit_ob3d struct.

Parameters
vt_jit_ob3d pointer
Returns
parent Jitter object pointer
void* ob3d_outlet_get ( void *  v)

Retrieves matrix outlet from opaque t_jit_ob3d struct.

Parameters
vt_jit_ob3d pointer
Returns
matrix outlet
void* ob3d_patcher_get ( void *  v)

Retrieves containing patcher object from opaque t_jit_ob3d struct.

Parameters
vt_jit_ob3d pointer
Returns
containing patcher object
void* ob3d_render_ptr_get ( void *  v)

Gets renderer pointer from opaque t_jit_ob3d struct.

Parameters
vt_jit_ob3d pointer
Returns
renderer pointer
void ob3d_render_ptr_set ( void *  v,
void *  render_ptr 
)

Sets renderer pointer in opaque t_jit_ob3d struct.

Parameters
vt_jit_ob3d pointer
render_ptrrenderer pointer
long ob3d_ui_get ( void *  v)

Retrieves UI flag from opaque t_jit_ob3d struct.

Parameters
vt_jit_ob3d pointer
Returns
UI flag
  Copyright © 2015, Cycling '74