Click here to Skip to main content
13,048,805 members (86,064 online)
Rate this:
Please Sign up or sign in to vote.

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 14-Mar-12 2:22am
Updated 15-Mar-12 4:41am
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

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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

Draw backplane

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

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170713.1 | Last Updated 15 Mar 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100