#### Archived

This topic is now archived and is closed to further replies.

# Alot of tutorials but they dont help....

This topic is 6813 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Just a Q...how would you GET the pixel RGB values from a DWORD or whatever it is?

-----------------------------
-cow_in_the_well

http://cowswell.gda.ods.org/

##### Share on other sites
- Speaking of tutorials that don''t help, , ,
The second example in the MS D3D book (the first to use D3D) returns 385 errors when attempting to compile it, after following the book''s own instructions. Many of the errors are themselves obviously wrong; such as for the line
LPDIRECTDRAW7        m_pDD;

the first eror says ''no ";" before identifier m_pDD''.
?
Book: P 54, file CD3DFramework7. There ain''t supposed to be no ";" there.
The compiler is set to the DX7 search paths. The instructions (on page xxii) say nothing else to do. I yam stumped. - Lubb

##### Share on other sites
Lubb: you obviously havn''t included

#include

and make sure its ddraw 7 u r using.

-----------------------------
-cow_in_the_well

http://cowswell.gda.ods.org/

##### Share on other sites
to Gladiator: If you think % is too slow for you, try to replace %n with &(n-1) -- assuming that the compiler isn''t intelligent enogh to replace the modulo by an and.
Should be faster than the extra shifts Staffan used.

##### Share on other sites
I'm speaking of % in general... so you optimization is not going to work at all times (it's gonna work with 2^n only)... and yes, it's going to work in this case, so it'd be pretty fast... I've never debuged on the % operator, so I have no idea what the assembly code looks like, but if VC++ is smart enough to optimize it ..-=[]=-.. that'd be great...

Edited by - Gladiator on June 27, 2000 3:39:40 PM

##### Share on other sites
- Okay, some days I be a stupid. I toyed with a DXMedia sample proj and then a D3D sample proj, and even tho'' I changed the dirs, the include and lib dir''s were still on DXmedia when I looked again.
I don''t know why , but anyway.
Some days I''m just special .
I do appreciate the tolerance though. - Lubb

##### Share on other sites
quote:
Just a Q...how would you GET the pixel RGB values from a DWORD or whatever it is?

For a 24 bit colordepth (0888) it''d be something like this:

  // The colorcoding goes according to this:// 00000000RRRRRRRRGGGGGGGGBBBBBBBBunsigned long color = 0xFF00FF; // magentar = color >> 16; // 0xFF00FF >> 16 -> 0x0000FF (255)g = (color & 0x00FF00) >> 8; // (0xFF00FF & 0x00FF00) >> 8 -> 0x000000 (0)b = color & 0x0000FF; // 0xFF00FF & 0x0000FF -> 0x0000FF (255)

"Paranoia is the belief in a hidden order behind the visible." - Anonymous

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 10
• 22
• 13
• 10
• 9
• ### Forum Statistics

• Total Topics
634469
• Total Posts
3017682
×