Sign in to follow this  

DirectX Questions

This topic is 3101 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm using DirectX 9 for VC++ Express 2008, and I just have a bunch of little questions I need answers to. Any help at all, even just a link to another sight, would be very much appreciated. 1. Is there a way to access individual pixels on the screen (to change their color)? 2. How can I make my applications fullscreen? 3. (Not sure if this has to do with DirectX) Does anybody know how to make a program that doesn't use the normal window style (The frame around program windows that has the title, maximize/minimize/exit buttons). Kind of like Adobe's CS programs (with the gray look) 4. Is there an RGB value for transparency? 5. How do I texture a 3D triangle? 6. Is it possible to just draw a line defined by two points and a color? (without loading any external textures/other resources) Thanks in advance for any help.

Share this post


Link to post
Share on other sites
Hi,

1-IDK.
2-While creating your D3D Device, set PresentParemeters.Windowed to false.
3-IDK.
4-No. Transparency is about the A (alpha) channel of color values.
5-While drawing your triangle, use a texture. Like:
mD3DDevice->SetTexture (0, yourTexture);
YourTri->Draw ();
6-Yes. Use a color value when declaring your vertices, then set D3DRS_SHADEMODE render state to D3DSHADE_GOURAUD. And draw these vertices. They will be connected automatically.

Share this post


Link to post
Share on other sites
Quote:
Original post by programci_84
Hi,

1-IDK.
2-While creating your D3D Device, set PresentParemeters.Windowed to false.
3-IDK.
4-No. Transparency is about the A (alpha) channel of color values.
5-While drawing your triangle, use a texture. Like:
mD3DDevice->SetTexture (0, yourTexture);
YourTri->Draw ();
6-Yes. Use a color value when declaring your vertices, then set D3DRS_SHADEMODE render state to D3DSHADE_GOURAUD. And draw these vertices. They will be connected automatically.


Thank you for the help, but now I have a few more quuestions:

2-I already tried changing PresentParameters.Windowed to false, but there must be something else because I get run time errors. Is there something I have to do with the window? Do I even need a window?

6-You lost me here. What exactly do you do? (I'm n00bish :-)

Share this post


Link to post
Share on other sites
1. You can create a lockable back buffer, but it's better to draw your pixels using rendering commands with point primitives, or whatever is suitable for what you're trying to do.

2. What errors are you getting?

6. You can use either ID3DXLine or a normal DrawPrimitive (or DrawPrimitiveUP) command with a line primitive (D3DPT_LINELIST).

Share this post


Link to post
Share on other sites
1. Yes, but you really don't want to.
2. As others have said, you just need to set the Windowed flag to false. If you get errors, what do the Debug Runtimes say? Are you correctly checking for support of all formats (See This article for example)
3. Use WS_POPUP instead of WS_OVERLAPPEDWINDOW when you create the window.
4. As programci_84 said - no, there's just alpha.
5. You create and load a texture, call IDirect3DDevice9::SetTexture(0, pTexture);, set up texture coordinates then draw your triangle. See This article.
6. Yes.

Share this post


Link to post
Share on other sites

This topic is 3101 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this