Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using only C (no C++) for OpenGL? [duplicate]

Tags:

c

opengl

I want to know if there is a possibility of using OpenGL in C without even scratching c++, tutorials or basic source codes are most welcome!

And if it is possible, how deep would my C skills have to be to understand and use it? I'm currently still mostly learning, and I like to do that by biting off more than I can chew.

like image 809
BigBadWolf Avatar asked Nov 16 '13 20:11

BigBadWolf


People also ask

Can you use C with OpenGL?

Yes, in fact OpenGL is a C library. You can perfectly use it with C.

Is OpenGL an AC library?

OpenGL is a C library, not a C++ one. The only thing why almost all programs use C++ for OpenGL is there is a higher and simpler level manipulating it through some wrappers, libraries or frameworks.

How do I run a program in OpenGL?

Install OpenGL on windows in Code::Blocks Go to the link and download zip file from the download link that appears after freeglut MinGW package with having link name as Download freeglut 3.0. 0 for MinGW and extract it. Next, open glut. cbp and search all glut32 and replace with freeglut.


1 Answers

OpenGL is a C library, not a C++ one.

The only thing why almost all programs use C++ for OpenGL is there is a higher and simpler level manipulating it through some wrappers, libraries or frameworks. It's just more comfortable.

Here are some good examples which were distributed along with the OpenGL "Redbook" (version 2.0).

However, those examples use old-style OpenGL (rendering through functions), which is deprecated, you should always use shaders and buffers instead. Although I think for beginning it can help.

Here on StackOverflow was also discussed where to find new OpenGL examples.

like image 174
Zaffy Avatar answered Sep 22 '22 04:09

Zaffy