Jump to content
  • Advertisement
Sign in to follow this  
Konnor

openGL and Visual Studio.net

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

Really pulling my hair out with this error trying to get set up in visual studio.net 2003. This is just a simple code example that draws a square. But it keeps throwing this exception. As I am an ultra beginner I don't have the foggiest idea how to fix it or what settings to change. Here are 2 screenies depicting the error: [URL=http://img443.imageshack.us/img443/1002/secondwringscreenie5xr.jpg I've literally just installed visual studio.net 2003, put all the GLUT files in the right place, and found the simplest example to try and run, and it doesnt work. help would be MUCH obliged, or direction to somewhere where my problem can be answered. Thanks,

Share this post


Link to post
Share on other sites
Advertisement
What language are you using? Most people do OpenGL in C++ (and a code example you found online is almost certainly C++) But "System.NullReferenceException" sounds like C# to me....

This is just a guess, but perhaps you did a ".Net" Solution when you should do:

"Win32 -> Windows Application"

From the new project menu.

Hope this helped.

Share this post


Link to post
Share on other sites
unfortunately not, but thanks for your swift response. Again, I'm a total beginner here so I hope this makes sense....

Yep its C++. I am trying to load a .sln project file with a C++ code example for drawing a square. So I'm not creating a new project. I am trying to use GLUT as oppose to windows32 (as far as I know) and am just falling short at the first hurdle.

I did try copying the code into a new win32 project. I got a new error, which is different but probly still related.

The result is here....

http://img435.imageshack.us/img435/5253/screenie31cs.jpg

Thanks,

Share this post


Link to post
Share on other sites
Sorry - I did not catch that you were using GLUT!

In that case you will need to do a "Win32 -> Console Application" (Because in glut you have "main" and not "WinMain")

I would try creating a fresh project:

  1. Create a new Win32 Console Project (empty)

  2. Create the new .cpp file Paste in the code

  3. Be sure to link to "Opengl32.lib glu32.lib and glut32.lib"

  4. Build it



I'm thinking that should work...

Share this post


Link to post
Share on other sites
Still not working unfortunately. The last screenshot on the list is the result I get when trying your suggestion SM.

Is a complete windows reinstall likely to fix this do you think? Frustration levels are reaching an all time high and I have work to be doing.

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.

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

Sign me up!