Click here to Skip to main content
11,790,021 members (54,832 online)
Rate this: bad
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
Edited 15-Mar-12 4:41am
Nelek at 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 at 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
0 OriginalGriff 1,029
1 Maciej Los 790
2 KrunalRohit 686
3 CPallini 606
4 Richard MacCutchan 460

Advertise | Privacy | Mobile
Web02 | 2.8.1509028.1 | Last Updated 15 Mar 2012
Copyright © CodeProject, 1999-2015
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