Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

ChaosPhoenix

Let me see if I have this correct.

This topic is 5560 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

Been reading Focus on 2D in 3D and was expecting it to give me a slightly better init Direct3D chapter than what it has, especially since he has his own code in there to output to a txt file and create the window for output, so let me go over this and check if I have the DirectX initialization process correct. IDirect3D is used to create a pointer to set up the following steps. D3DDISPLAYMODE is used to create an object to hold information about your display adapter. EnumAdapterModes is used to fill your D3DDISPLAYMODE object with the information of your current adapter configuration and window settings. D3DPRESENT_PARAMETERS is the parameters used by your DirectX application while it is running and you can pull the settings from your D3DDISPLAYMODE variable if you do not wish to set them manually. IDirect3DDevice8 is used to create a pointer which is finally used to create the actually device you will be using in your DirectX application. Correct? No extra or missed steps? I''m trying to create a simple, first time DirectX App(although I''ve played with it off an on from other books codes, first attempt from scratch) so I''m not looking to create something fancy. I just want to set up DirectX correctly. I see no reason to poll for how many adapters the user has or to enumerate the amount of display modes he can support. May add that once things are going and working properly.

Share this post


Link to post
Share on other sites
Advertisement
Sounds right, though the phrase "if you do not wish to set them manually" is a bit scary.

You can''t rely on a system having any specific display mode or resolution, do you have to enum the modes if you''re doing a release of your software.

For your own personal testing, sure, just plug in whatever values you like.

Also, if you''re just starting out, make sure you use debug DirectX drivers (the SDK should install them if you ask it to, but you''ll have to use the control panel to enable it), and crank the debug level to full. When something fails it will often tell you what''s wrong in the Output window in MSVC.

GetDXErrorString8(hr) is your friend too.

Share this post


Link to post
Share on other sites
yea yea, this is a personal thing that''s just going on my system for now.

Once it''s up and running then more functionality and a more robust graphics support can be added.

Thanks for the tips btw.

Share this post


Link to post
Share on other sites
I have been pooling over my initialization function for the last 1 1/2 hours. I had it create and initialize a device,test using the FAILED macro and if something was wrong it did a message box saying it failed, if it was okay it would do a message box saying it was successful. I kept getting a failed message.

...I just ran the debug to see why I was get a failed message box. I got the hex code 0x0. Ran it through the DX Error look up and it''s H_RESULT OK.

I forgot the ! infront of my FAILED macro, so although it was succeeding it would always skip the success message box and display the failed one

Damn you Exclamation mark! Damn you!

Share this post


Link to post
Share on other sites
Yea I know. I just am in a habit of using !FAILED.

I tried it with SUCCEEDED and it gave me the same result so everything appears to be working great and it''s time to move forward.

Oh well, Program and learn I suppose.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!