[PD-dev] External interaction speed + deconstructor methods
Ben Bogart - FMPM/F1999
bbogart at acs.ryerson.ca
Thu Jun 27 22:05:56 CEST 2002
My SDL external blits and updates the render window each time the
"blender_alpha"
method is called (by the alpha selector). As far as I can tell the render
speed is quite sufficient, but seems to lag behind what the number box is
doing. Its like my number box goes through a pipe object before it gets
to the external. Its just not quite as responsive as i would like. Is it
more likely my SDL rendering speed or does an external have a built-in
input buffer causing the lag? Here is my blender_setup function:
void blender_setup(void)
{
myclass = class_new(gensym("blender"), /* symname is the
symbolic name */
(t_newmethod)blender_new, /* Constructor
Function */
0, /* Destructor Function */
sizeof(mystruct), /* Size of the
structure */
CLASS_DEFAULT, /* Graphical
Representation */
0); /* 0 Terminates
Argument List */
class_addmethod(myclass, /* Add function
as method */
(t_method)new_blender_window, /* Bind
method to function */
gensym("create"), /* symbol to
invoke method */
0); /* method arguments */
class_addmethod(myclass, /* Add function
as method */
(t_method)blender_close, /* Bind
method to function */
gensym("destroy"), /* symbol to
invoke method */
0); /* method arguments */
class_addmethod(myclass, /* Add function
as method */
(t_method)blender_alpha, /* Bind
method to function */
gensym("alpha"), /* symbol to
invoke method */
A_DEFFLOAT, 0); /* method
arguments */
}
While I'm on the topic, what is the proper way to create a deconstructor
function? (to close my SDL process when PD closes) I tried passing
(t_newmethod)sdl_close as the 3rd argument to my class_new function, but
that causes the following compile error:
blender.c: In function `blender_setup':
blender.c:82: warning: passing arg 3 of `class_new' from incompatible
pointer type
Thanks!
Ben
B. Bogart
---------
More information about the Pd-dev
mailing list