Box2D Forums

It is currently Sun May 19, 2013 11:29 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Thu Apr 17, 2008 1:36 pm 
Offline

Joined: Sat Feb 09, 2008 4:00 pm
Posts: 75
a "nice to have" for me would be an additional int32 variable as colorpalette info in the struct b2Color.
I'm using this actually for gif rendering with libgd.

regards, nimodo


Top
 Profile  
 
PostPosted: Thu Apr 17, 2008 4:34 pm 
Offline
Site Admin

Joined: Thu Sep 06, 2007 12:34 am
Posts: 2931
I don't quite understand. The colors are specified by Box2D and passed to the debug drawer as const references. How would Box2D know about your color pallette? Can you convert the 3 floats into a color pallette entry?


Top
 Profile  
 
PostPosted: Thu Apr 17, 2008 11:16 pm 
Offline

Joined: Sat Feb 09, 2008 4:00 pm
Posts: 75
Yes, I actually do
Code:
void GIFDraw::SetColorPalette(gdImagePtr im, b2Color* c)
{
    c->color = gdImageColorAllocate(im, int32(255.f * c->r),                                                     int32(255.f * c->g) , int32(255.f * c->b) );
}

before starting physics engine and gif rendering.
So i have the same variable (b2Color) as DebugDraw to pass to the GIF drawing functions.
But its only nth, for comfort, not really important.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group