I love creating games, and I've always made games using OpenGL and not with game engines such as Unity or Unreal. Can I legally sell the games I made with OpenGL?
Yes, you can sell OpenGL-rendered games.
The specifics depend on the library you're using. I'll get back to that.
First: OpenGL is an open standard and related API-set that establishes the protocol for communication between your application and video card / GPU. Typically this communication protocol is implemented by means of an operating system driver, and a supporting library which gets shipped with your game. OpenGL is fairly ubiquitous: Linux, Mac, Windows, iOS, and Android all typically have it pre-installed in the system. Loads of things you buy and that people sell are rendered using OpenGL.
It's the people making the operating systems and GPUs that have to worry about OpenGL licensing. OpenGL clarifies in its About section on Licensing that “End users, independent software vendors, and others writing code based on the OpenGL API are free from licensing requirements.” (That's you.)
(Thanks Jimmy for pointing out the About section.)
The library's license is what matters.
There's probably a library you're using to render via OpenGL though. It might be GLFW, freeglut, Allegro, SDL, SFML, Ogre3D, or others. Your library's license has more relevance here because your program has to ship with the library and the license will control how you can do that.
If you're not actually using any library at all, you have no licensing expectations in this area.
If you are, fortunately all the OpenGL libraries I know of are fine with this:
- All the ones I just mentioned use the zlib license.
- Except for Freeglut and Ogre3D, which use the MIT license (the X Consortium variant in Freeglut's case).
- Older versions of Ogre3D (before 1.6) used Gnu LGPL.
- Older versions of Allegro used a giftware license (summarily “do whatever you want with it”).
Check the license for the exact version of the libraries you're using to know what your obligations are.
You'd have some problems if you used Gnu GPL (as opposed to LGPL) licensed libraries, since that can bind you to redistribute your software's source code. There may also be issues if the library required royalties but this is also not the case. (You could still sell your game, you'd just be obligated to fork some of the profit elsewhere.)
The specific license involved may bind you to give attribution to the library, or to ship the library's license with your source code, so check the license and see what it instructs you to do. Usually people have buried in their app somewhere an "About" section that contains a "Boring legal stuff" link which itself is just a long scrolling textbox full of all the licenses they have to reproduce, and usually that is enough. Consult your library's license.