Jump to content
  • Advertisement
Sign in to follow this  
annoyer101

OpenGL help with OpenGL

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

Hello. Would someone be kind enough to tell me what to type OpenGL code on. Does it go on a C compiler, doesn't have it's own compiler or does it go on something completly different?

Share this post


Link to post
Share on other sites
Advertisement
OpenGL provides a C API (and is written in C), so you can write OpenGL programs in C, C++, Python, Java... pretty much any language you want.

Share this post


Link to post
Share on other sites
OpenGL is an API. That means that it is a collection of functions, classes, enums, etc. that you call in your program. OpenGL is available for many languages. You 'type it in' the compiler of the language that you're working on. So, if you're using C++, you might put this in your program:

//Draw a triangle
glBegin(GL_TRIANGLES);
glVertex3f(1.0f,0.0f,-5.0f);
glVertex3f(1.0f,1.0f,-5.0f);
glVertex3f(0.0f,1.0f,-5.0f);
glEnd();


and compile it just like a regular C++ program. You will have to include the proper .h files and link to the proper libraries for this to work(plus initialization code).

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!