Jump to content
  • Advertisement

Archived

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

Macke

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.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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:

// 00000000RRRRRRRRGGGGGGGGBBBBBBBB


unsigned long color = 0xFF00FF; // magenta

r = 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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!