Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / int iColor How do you select colours?

Author
Message
bigbrother 2000
21
Years of Service
User Offline
Joined: 15th Oct 2003
Location: UK
Posted: 26th Oct 2006 21:19
hello,

i'm new to the SDK, when setting the background colour i need to pass one int the color, what are the values to be given for white,

the r,g,b are not passed so what determines what colour is what value, e.g. black is lower, white higher etc?

cheers

SNOW ISLAND : www.snowisland.co.uk
BEWARE THE MOON : www.bewarethemoon.co.uk
ALIEN INVASION : www.alien-invasion.co.uk
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 26th Oct 2006 22:03 Edited at: 26th Oct 2006 22:06
In the DarkSDKBasic2D.h file, there's a function called dbRgb()

Use this to convert an r, g, b value into the int you need

Paul.

OSX Using Happy Dude
21
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 26th Oct 2006 22:07 Edited at: 26th Oct 2006 22:42
Its a 32-bit colour (the top 8 are ignored), thus :

xxxxxxxbbbbbbbbggggggggrrrrrrrr

it could be the other way around (rgb).

Anyway, the intensity of these 8 bits define the colour - hence by RGB values are passed, and not usually just any old integer. Higher values produce a lighter colour.

Visit my web site for real bangin' stuff. Word.
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 26th Oct 2006 22:29
Well said

bigbrother 2000
21
Years of Service
User Offline
Joined: 15th Oct 2003
Location: UK
Posted: 27th Oct 2006 00:22
Thanks guys that worked great.

On another issue, i have used dbLockObjectOn on some plains to create some icons for my program, however the pick object command does not seem to work on these objects. It is working on objects in the scene so must be because they have been locked to screen, any reason for this?


My FPS also stay around 60 even with just 1 rotating cube on screen. Sync rate is set to 100 so it isnt the cap of sync rate, my graphics card normally produces higher on dbpro, is this common?

SNOW ISLAND : www.snowisland.co.uk
BEWARE THE MOON : www.bewarethemoon.co.uk
ALIEN INVASION : www.alien-invasion.co.uk
Morcilla
21
Years of Service
User Offline
Joined: 1st Dec 2002
Location: Spain
Posted: 28th Oct 2006 17:45 Edited at: 28th Oct 2006 17:46
As far as I know, locked objects cannot be picked. The reason is the way the engine handles these objects.
However you can use some manual locking, there are some snippets for this at the code snippet forum.

About the FPS question, you may know that this is an already published bug for 1.6.2c
It shows always 60, because that is the refresh rate of your monitor. So setting sync rate is kind of useless.

[Edit] I suggest you to start a different thread for each different question.

Login to post a reply

Server time is: 2024-11-19 09:49:28
Your offset time is: 2024-11-19 09:49:28