Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
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 14-Mar-12 3:22am
Edited 15-Mar-12 5:41am
v2
Comments
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
good
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
 
D3DRS_ZENABLE OFF
Draw backplane
D3DRS_ZENABLE ON
 

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

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

  Print Answers RSS
0 BillWoodruff 330
1 Mathew Soji 309
2 Maciej Los 295
3 DamithSL 225
4 Afzaal Ahmad Zeeshan 217
0 OriginalGriff 6,369
1 Sergey Alexandrovich Kryukov 5,973
2 DamithSL 5,183
3 Manas Bhardwaj 4,673
4 Maciej Los 4,025


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