Jump to content
  • Advertisement
Sign in to follow this  
Zische

CgFXCreateEffectFromFileA fails

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

Hi, I want to use CgFX files for my game engine. I have included CgFXParser.lib and ICgFXEffect.h but when i call const char* Errors = NULL; ICgFXEffect* test = NULL; CgFXCreateEffectFromFileA("C:\\Default.fx", 0, &test, &Errors); the debugger stops the application and an error message shows: "Unhandled exception at 0x003ba420 (CgFXParser.dll) in main.exe: 0xC0000005: Access violation reading location 0x00000000." I have tried other fx files which work with other applications.

Share this post


Link to post
Share on other sites
Advertisement
This is a wild guess, I've NEVER worked with Cg Before, but I think, logically, it's trying to access a null value. and you have two. my guess is that it needs one of them, or both, initialised and pointing to existing objects. how about making one pointer = NULL and the other 0xFFFFFFFF, and see which one pops up in the error message, then initialize that? (My money's on the ICgFXEffect).

Share this post


Link to post
Share on other sites
Quote:
Original post by Code-R
my guess is that it needs one of them, or both, initialised and pointing to existing objects.

i have found some examples on the internet, which use the function the same way. the first 0 in the function parameters is a parameter for the compiler which may be zero. &test must point to NULL, because you cannot initiate an ICgFXEffect interface class (ie. by new ICgFXEffect).
I have changed the pointer to 0x0000000F but the errormessage still shows 0x00000000.
since i use direct3d, i decided to switch to microsoft's fx format and its interface which works without any strange errors, has more features and should be perfectly connected to the d3ddevice.

Share this post


Link to post
Share on other sites
CgFX is not good right now. The 1.4 beta is buggy and incomplete, and nVidia's been really dragging their feet on a 1.4 final (at SIGGRAPH their rep promised it by the beginning of September). For DirectX, nVidia themselves suggest you just use DX's effect files.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!