smooth color transition with d3d
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.
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement