Jump to content
  • Advertisement
Sign in to follow this  
judge dreadz

Cg and DevC++

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

Advertisement
If you need the libraries for Dev-C++, look at http://devpaks.org/

And if you're searching for tutorials, look at the DirectX/OpenGL Tutorials at www.codesampler.com!

Share this post


Link to post
Share on other sites
I'm really sorry: The CG devpak is offline cause it violates some foolish agreements (that's why the DirectX devpak is offline either!).

I guess you have to test the original CG Toolkit from developer.nvidia.com, it maybe works with Dev-C++ 4.9.9.x!

Share this post


Link to post
Share on other sites
Ok, i've managed to get something to work, but i am having to write the Cg file in notepad. Shouldnt i be able to write the Cg program in the DevC++ editor?

also, shouldnt i get some kind of error report if the Cg program doesnt compile? at the moment the DevC++ project will compile and run even if the Cg program is complete gibberish.

I'm sorry if these are stupid questions, but i'm finding it really difficult to understand how everything is supposed to fit together.

Share this post


Link to post
Share on other sites
Cg is compiled at run-time when you load the shader program. DevC++ has nothing to do with compiling it, that's why it is not giving you errors.
You might be able to use DevC++ to edit the Cg program, can't you just load it from the File menu (I've never tried this so I might be totally wrong)?

As Cg is compiled at run-time, error messages also occur at run-time. You can try something like this to get the error messages:
void cgErrorCallback()
{
CGerror err = cgGetError();

if ( err != CG_NO_ERROR )
{
// Output error string obtained by: cgGetErrorString(err);
// eg. std::cout << cgGetErrorString(err);
exit(1);
}
}
...
// In Cg initialization code
cgSetErrorCallback(cgErrorCallback);

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!