smooth color transition with d3d

Started by
1 comment, last by eal 19 years, 4 months ago
i've been learning d3d, so my first program is a triangle that moves around and changes colors: http://members.aol.com/ealang12345/triangle.zip and the source: http://members.aol.com/ealang12345/triangle_source.zip the only thing i'm wondering, is there a way to make the colors of the triangle blend together more smoothly? it also seems like it runs pretty slowly considering the program is unrestricted in terms of speed.
Advertisement
I'm not sure so this is a random suggestion.

These lines look suspect:
D3DDISPLAYMODE mode ;
D3D8OBJ->EnumAdapterModes ( D3DADAPTER_DEFAULT , 0 , &mode ) ;

You haven't initialised the 'mode' variable, and D3DADAPTER_DEFAULT isn't listed in my docs as being an acceptable parameter to EnumAdapterModes. Try replacing it with 'D3DFMT_A8R8G8B8' for 32bpp or 'D3DFMT_A1R5G5B5' for 15bpp.
Ah thanks, it looks awesome now. I can't believe the guy who wrote the book I'm studying didn't do that.

[Edited by - eal on August 2, 2005 11:37:16 PM]

This topic is closed to new replies.

Advertisement