Skip to main content
GameDev.net gamedev.net
🔒 Locked

DX coding tip (auto list members)

Started by FrigidHelix Jan 2, 2002 at 6:52 PM 9 replies 500+ views
Original Post
FrigidHelix
FrigidHelix
DirectX has many structures and functions; remembering all of them can be difficult. When writing code in the Visual C++ source editor, you can have the members of a class automatically listed as you access members of a class. I think this feature is pretty cool, and would just like to point out, that in order to have the shortcut work for DX, you need to include the header files to your project. For example, if you want the following code to generate useful shortcuts:
  
D3DPRESENT_PARAMETERS d3dpp;
d3dp.SwapEffect;
  
You would need to add the file "d3d8types.h" to your project.
Void
Void
Including external headers inside the project workspace (those you include using #include <>) is a bad idea because the next machine compiling the code may not install the SDK in the same location.

To work around your problem, check out Visual Assist from (sadly it''s not free)
Forcas
Forcas
Wow! I had no idea of that! Thanks for the tip!
-Forcas writeln("Does this actually work?");
wazoo69
wazoo69
Or another way (If I''m reading this thread right) is to define the "include" directory of the sdk\samples\common\include into the compiler header directory path...

then in your projects you simply #include "dxutil.h"....

those compiling your code in the future are then free to install the SDK on their machine wherever they want, then only have to provide the same path in their compiler "header directory path" area....

Oluseyi
Oluseyi
quote:
Original post by wazoo69
then in your projects you simply #include "dxutil.h"....

The point is that MSVC will not parse files simply "included" in the project (ie external dependencies). So you have to add them for IntelliSense to work.

[ GDNet Start Here | GDNet FAQ | MS RTFM | STL | Google ]
Thanks to Kylotan for the idea!
steg
steg
You can download visual assist 30 day free trial at www.wholetomato.com

Reg''ds,
sTeVe
If it isn't working, take a bath, have a think and try again...
JonStelly
JonStelly
Oluseyi, there is a trick that seems to work for me. If you #include a header file in your project, then build the project, the newly included file will show up in ''External Dependencies''. If you then drag that file up to ''Header Files'', everything declared in that file will intellisense correctly. I''ve moved the same project between multiple machines with the Platform SDK installed at different locations and it seems to work on both machines.
CaptainJester
CaptainJester
Why pay for visual assist when MSVC++ does the job for you. Just include the header files as part of your project, then when you send it on to someone else, remove them from the project. I believe the MSVC++ can read environment variables, so another option would be for everyone who works on the same project to define an envronment variable, with an agreed upon name, then point that to the DirectX include path.

---
Make it work.
Make it fast.
"None of us learn in a vacuum; we all stand on the shoulders of giants such as Wirth and Knuth and thousands of others. Lend your shoulders to building the future!" - Michael Abrash[JavaGaming.org][The Java Tutorial][Slick][LWJGL][
Void
Void
quote:
Original post by JonStelly
Oluseyi, there is a trick that seems to work for me. If you #include a header file in your project, then build the project, the newly included file will show up in ''External Dependencies''. If you then drag that file up to ''Header Files'', everything declared in that file will intellisense correctly. I''ve moved the same project between multiple machines with the Platform SDK installed at different locations and it seems to work on both machines.



If you drag a file like that, it will persist as a file in location ./../../theheader.h

Check your properties of the file (Rightclick in workspace view)

If your platform sdk is installed in a different drive or possible different directory structure, then it wouldn''t work.
Yours work probably because your sdk is setup using the same structure.

Besides, Visual Assist has so much more features that makes it worth its price. Don''t believe? Try it.
JonStelly
JonStelly
Yeah, I was looking thru the feature list. It does seem to add a lot.
FrigidHelix
FrigidHelix
Thanks for all the comments guys!

I didn''t know about the Visual Assist thing; it looks promising, im certainly going to try it out.

happy new year everyone

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.