View Full Version : How to start OpenGL coding?

09-28-2016, 02:24 AM
Hi. I am first user to opengl.

Where can I start?

I have used Unity engine and C#, Visual Studio.

OpenGL has also editor like visual studio? or?

Where should I start? and can I use C# with opengl?


09-28-2016, 11:17 AM
OpenGL is a standard, not a tool or a library or anything like that. You can use it with anything as long as you have a graphics card and a driver which implements the OpenGL standard. I would suggest you read up on OpenGL first, perhaps in some of the great online tutorials out there or perhaps a book if you prefer those.

09-28-2016, 04:39 PM
OpenGL is a standard which looks like a subroutine library when you get down to using it. It is not a development environment (IDE) and does not come with an editor. The good news is that most major IDE's such as Visual Studio and Code Blocks come with examples, sample projects, etc., which make it very easy to get started with OpenGL. How do you do your C# programming? What development environment do you use? There are probably tutorials with sample code that show you how to add an OpenGL window to a project in your IDE. Try Googling C# OpenGL.

Good luck.

09-28-2016, 07:48 PM
It is possible to do OpenGL with C# but it is very uncommon.

Most people who do OpenGL use C++ (usually with Visual Studio but there are other options) which is very much like C#.

I think this (http://learnopengl.com/) website gives a pretty good introduction to OpenGL.

09-29-2016, 12:40 AM
Here (https://www.opengl.org/wiki/Language_bindings#C.23) is a list of all implementation bindings of OpenGL for this language.

09-29-2016, 07:54 PM
I'm also somewhat of an OpenGL newcomer and used Unity a few years ago, so I know where you're coming from. As Carmine mentioned, OpenGL is a standard so don't expect any Unity hand holding. I remember just pressing "play" on Unity and getting a game running. I understand how some people find the benefit in that, but I personally get more ideas and inspiration building everything myself. Most people nowadays might call that "re-inventing the wheel", but don't listen to that trash, seriously. You're not re-inventing the wheel, you're learning.

You also might want to be prepared to learn some areas of maths. You don't have to become to the next Paul Erdős, but math is unavoidable. Like myself, I'm sure a lot of people fell in love with maths when they got into game development, so just embrace it and have fun. It took me a while since I had such a poor and embarrassing math background.

About c#. I actually enjoyed it during my Unity days, but I strongly recommend learning C++ for several reasons. You'll also get a greater understanding of programming in general. Plus, most OpenGL tutorials are written in C++.

The biggest challenge I had learning OpenGL was organizing my study material and finding the right tutorial sites and videos. Everything felt so scattered all over the place, I thought it might help sharing a short list of useful links to OpenGL and Math tutorial sites.

Oh and there's a YouTube chan I'm sharing called TheBennyBox. I seriously recommended starting there, since he guides you into drawing your first triangle , all the way to building your own game engine, not kidding...it's great. You'll also learn the necessary math.

Good luck to you, and hope this helps.


Video Material

TheBennyBox (https://www.youtube.com/channel/UCnlpv-hhcsAtEHKR2y2fW4Q): One of my favorites. I learned so much from this guy. I'd recommend starting with this chan.

Reading Material

LearnOpenGL (http://learnopengl.com/): BBeck mentioned this one and it's one of my favorites. They even offer an offline pdf book of the site. Great stuff.
OpenGL-Tutorial Dot Org (http://www.opengl-tutorial.org/): Also one of my favorites. Highly recommended after trying LearnOpenGL.
OGLDev (http://ogldev.atspace.co.uk/): I've never used this site much, but it looks very complete.
Anton's OpenGL 4 Tutorials (http://antongerdelan.net/opengl/): You'll love the quality of these tutorials. Although the rest of the tutorials are found in his book, but getting started is free at this site.
MbSoftworks OpenGL Tutorials (http://www.mbsoftworks.sk/index.php?page=tutorials&series=1): Another great OpenGL Tutorial. From drawing a triangle to creating landscapes. Excellent tutorial site and he's already working on a newer tut series.


Video Material

Math For Game Developers (https://www.youtube.com/channel/UCEhBM2x5MG9-e_JSOzU068w): You won't learn about OpenGL here, but once you learn to start a window and draw a triangle with one of the tutorial sites above, come back to this YouTube Chan. You'll find all the math you need to create a game. Oh and no boring school math teacher methodology, you'll learn from the point of view of a game dev.

Coding Math (https://www.youtube.com/channel/UCF6F8LdCSWlRwQm_hfA2bcQ): Although the tutorials are mostly are in 2D and JavaScript, it shouldn't be a problem porting it to C++, plus it's great excercise.