Christos,
Scrive Christos Dimitrakakis <ole...@fa...>:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hello, if I have an ssgVtxTable, how can I make it render with a
> glPolygonOffset?
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFJcOeryBv6kELa61sRAlz+AJ9UoLP09HBQEN9P50mn8ULSlif38ACeLi1M
> 4f/gnSGXNd0RxknmschYmew=
> =c1mq
> -----END PGP SIGNATURE-----
Just put it in a leaf's pre-draw callback, and possibly restore it in a
post-draw callback.
If 'leaf' is the variable name of your ssgVtxTable, define/set a pre-draw
callback once as follows:
int leaf_pre_cb( ssgEntity *obj )
{
// do whatever
glPolygonOffset( ... );
return TRUE; // otherwise the leaf doesn't get drawn
}
// in your scene graph initialization code
leaf->setCallback( SSG_CALLBACK_PREDRAW, leaf_pre_cb );
The post-draw callback can be defined/set exactly the same (post in place of
pre).
Greetings -
Paolo Leoncini
|