I'm a total newbie to DirectX. I am programming a simple 3D game as of the moment. When I was trying to implement a backdrop for my scene, I encountered a problem. I can't display a textured quad, which serves as my "skybox" and my textured meshes at the same time.
The game is like a tail gunner. The camera is fixed looking at 0,0,1 (x,y,z left-hand coords). Enemies come toward the player from the positive z axis. The player just shoots the enemies that come toward him/her. It's game over when a number of enemies fly past the player.
I am almost done with the game. I am just implementing a skybox. I am quite aware of another method of creating a skybox for a game from one of my tutorial books, though I did not do it here because I was doing what I thought was a quick fix (by putting a plane facing the camera that is textured to serve as a background, mainly because the camera doesn't move and because I love experimenting).
The problem I am having is that I can't run the render code for the enemies (textured mesh) and the backdrop (quad made from primitives and then textured) at the same time. If I comment out one, I can view the other on screen. I am just getting a black screen if both are trying to render in one frame step.
More than just getting a decent backdrop, I guess I am interested in knowing why I can't render a textured mesh and a textured square made from primitives at the same time. Is it because of the SetFVF() call? So far, I can't think of any other possible reason. I tried experimenting with the lighting and z-buffer but I was unsuccessful in solving the mystery.
I have included the code I have for the lighting and the rendering of the problematic areas. I haven't read much material on DirectX and 3D programming in general yet and I think this could be a typical newbie pitfall but I hope you would be patient with me.
Thanks a lot in advance!
Here's a snippet of my problematic code: