Alot of tutorials but they dont help....

Started by
15 comments, last by Macke 23 years, 9 months ago
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/

- Thomas Cowellwebsite | journal | engine video

Advertisement
- 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
RPD=Role-Playing-Dialogue. It's not a game,it never was. Deal with it.
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/

- Thomas Cowellwebsite | journal | engine video

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.
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
- 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
RPD=Role-Playing-Dialogue. It's not a game,it never was. Deal with it.
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

This topic is closed to new replies.

Advertisement