Click here to Skip to main content
15,881,757 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello,

I am working on a C++ application under Visual Studio 2003 using DirectX 8.1 that uses 3D graphics to displays various elements. For Eg: I have a beach ball on a sunny day. I am able to draw the ball using graphics, but I am interested in drawing the sunny day background using any available color code, or any other input I can have in order to execute this. At the moment, I have basic colored backgrounds implemented in my code, like I can get the basic colors from Black(0,0,0) to white(255,255,255). What would be the best way to go about this executing and rendering the climate background (like sunny day, dark night, cloudy day) through the code using DirectX 8.1? Hope someone can help here.
Posted
Updated 15-Mar-12 4:41am
v2
Comments
Nelek 14-Mar-12 13:59pm    
Can you show part of the code you have running and explain a bit better what do you mean?
Mobile.Instinct 15-Mar-12 10:41am    
Yes, I have updated the question. Do you have any suggestions?

1 solution

I can't help you with 8.1, but with 9+ the process is this

Load your bitmap into a texture

Get the size of the backplane using GetBackBuffer

Create a square textured backplane (vertex format = D3DFVF_XYZRHW | D3DFVF_TEX1), using D3DXVECTOR4 with w set to 1.0

In your render function, the first thing you draw is your backplane

D3DRS_ZENABLE OFF
Draw backplane
D3DRS_ZENABLE ON


The only caveat is you have to catch a window resize, and regenerate your backplane texture
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900