Re: [F4-users] trying to set opcode callbacks
Status: Pre-Alpha
Brought to you by:
starkos
|
From: Pierre T. <p.t...@wa...> - 2002-08-29 08:59:47
|
Are you using Opcode 1.2 ? In this version you can use callbacks -or- plain
pointers. And "shipped" code uses plain pointers. To use callbacks instead
you must uncomment this line in OPC_Settings.h :
// Use callbacks or direct pointers
// #define OPC_USE_CALLBACKS
OPCODE_API and ICECORE_API are mainly useful in the original Opcode library,
when it gets compiled as a DLL. If you don't use DLLs or if you just want to
statically link the code to your exe with your favorite compiler, just
define them to nothing.
Pierre
PS: BTW, it's OPC_CALLBACK, not OBJ_CALLBACK......
----- Original Message -----
From: Charles James Leonardo Quarra Cappiello <cha...@ho...>
To: <fla...@li...>; <alq...@us...>
Sent: Thursday, August 29, 2002 10:43 AM
Subject: [F4-users] trying to set opcode callbacks
>
> Hi!
>
> thanks to Jason and Pierre for your prompt help!
>
> Now i have a problem setting the mesh callbacks, look at my code:
>
>
> // this is the callback
>
> static void _opcodeCallback(udword triangleIndex, VertexPointers&
> triangle, udword userdata)
> {
> udword *tri_array =((csOPCODECollider *)userdata)->indexholder;
> Point *vertholder =((csOPCODECollider *)userdata)->vertholder;
> int index = 3*triangleIndex;
> triangle.Vertex[0]=&vertholder [ tri_array[ index ] ] ;
> triangle.Vertex[1]=&vertholder [ tri_array[ index + 1 ] ];
> triangle.Vertex[2]=&vertholder [ tri_array[ index + 2 ] ];
>
> };
>
> and this is how i set them:
>
> AABBTreeCollider.SetCallback0 ( _opcodeCallback , udword(col1) );
> AABBTreeCollider.SetCallback1 ( _opcodeCallback , udword(col2) );
>
> but at compile, i get this error:
>
> CSopcode.cpp:76: no matching function for call to
> `Opcode::AABBTreeCollider::SetCallback0 (void (&) (unsigned int,
> Opcode::VertexPointers &, unsigned int), udword)'
> CSopcode.cpp:77: no matching function for call to
> `Opcode::AABBTreeCollider::SetCallback1 (void (&) (unsigned int,
> Opcode::VertexPointers &, unsigned int), udword)'
> CSopcode.cpp:79: no matching function for call to
> `Opcode::AABBTreeCollider::SetUserData0 (udword)'
> CSopcode.cpp:80: no matching function for call to
> `Opcode::AABBTreeCollider::SetUserData1 (udword)'
>
> anyway, i tried two things, first to change the type of the callback to
the
> mysterious macro OBJ_CALLBACK, and i say mysterious because i couldn't
grep
> the define nowhere! =) .... well, but then it said that i should give a
> return, since the type is non-void, hmmm.. weird indeed, any ideas?
>
> the other thing i tried was to set individually the
> AABBTreeCollider::mObjCallback0, mObjCallback1 and mUserdata0&1, but then
it
> said something like:
>
> CSopcode.cpp:78: `class Opcode::AABBTreeCollider' has no member named
> `mObjCallback0'
> CSopcode.cpp:79: `class Opcode::AABBTreeCollider' has no member named
> `mObjCallback1'
> CSopcode.cpp:80: `class Opcode::AABBTreeCollider' has no member named
> `mUserData0'
> CSopcode.cpp:81: `class Opcode::AABBTreeCollider' has no member named
> `mUserData1'
>
>
>
> hmmm, no member, btw, i had to comment all the ICECORE_API and OPCODE_API
> macros on class declarations because it was giving errors such as,.. err..
> oops i should increase the terminal buffer size.. well, anyways, could
that
> have something to do?
>
> Regards,
>
> Charlls
>
>
>
>
>
>
>
> _________________________________________________________________
> Join the world's largest e-mail service with MSN Hotmail.
> http://www.hotmail.com
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> flatfour-users mailing list
> fla...@li...
> https://lists.sourceforge.net/lists/listinfo/flatfour-users
|