Max 5 obex
When using Attributes, is it no longer in Max 5 (or was it never really) necessary to have a:
in our object struct, and call:
class_obexoffset_set(myclass, calcoffset(myobject, obex));
I think I’ve looked at all the new examples as none seem to use this. Although I see the t_jbox struct contains a field which is called "obex".
Very observant. It is correct that you no longer need to define an
obex explicitly. Now one will be allocated automatically in a top
secret location the first time you need one. If you don’t want to
change your code, or if you still want access to it for some reason in
the older way, caching it in your object struct, it is perfectly fine
as well. So no need to change it if you’ve already written your object
in this way, and no need to add it if you haven’t. Simply use
object_obex_lookup/store() as usual, and the magic is handled for you.
On Nov 16, 2008, at 4:47 AM, Joshua Kit Clayton wrote:
> So no need to change it if you’ve already written your object in
> this way, and no need to add it if you haven’t. Simply use
> object_obex_lookup/store() as usual, and the magic is handled for you.
Sorry, there is one reason you might want to still use void *obex in
your object struct, and call class_obexoffset_set(myclass,
calcoffset(myobject, obex)); If you want your object to work in Max 4
and Max5 and have attributes. Max 4 doesn’t implicitly create this
resource behind the scenes when necessary, and it needs the storage in
I just wanted to clarify – as I’ll be teaching this to others.