An easy way to get the equivalent of GLUT compiled with MinGW is to use freeglut. See the Community_Supplied_Links page and look under Libraries for the link to the freeglut home page and source code. Build with commands such as the following./configure --with-x=no.
I am trying to install opengl on windows 8 64 bit machine I did not find any libraries containing gl.h glu.h files I found glut libraries/headers...,Through some stack overflow posts I came to know that opengl is a part of windows then where is it found.help
user2493476
3 Answers
OpenGL-1.1 has been part of the Win32 ABI (ABI = Application Binary Interface, i.e. the set of functions guaranteed to be available and specification how these are to be called by the compiler (calling conventions)) since Windows-NT4 (and got included retroactively into Windows 95-B).
As such every compiler toolchain that targets the Win32 API (which BTW also covers 64 bit versions) must include the necessary symbol declarations (headers in C) and API linkage stubs. Or in other words: There's no need to download or install anything to develop for OpenGL.Never(!), I repeat, never(!), download anything named
opengl32.dll
, opengl32.lib
, gl.h
, wgl.h
or similar and don't even think about replacing the perfectly fine files you already have with them; doing so will just break your system (either the operating system or the compiler toolchain). It's unnecessary and actually harmful to do so. Hence the page you thought giving you good information is in fact very harmful. Completely disregard its information.OpenGL itself is not a library, but a specification which so called implementations follow. The OpenGL implementations for Windows are part of the graphics cards' drivers! There's also a software rasterizer fallback that covers OpenGL-1.1 in case no graphics card support is available. Note that modern OpenGL support is not included in the drivers installed through Windows Update; GPU drivers with OpenGL support must be downloaded directly from the GPU vendor's website and installed manually.
Functionality that goes beyond OpenGL-1.1 in Windows must be loaded at runtime through the so called 'extension mechanism'. Since this is a tedious process there are several 3rd party libraries that get this job done. The most popular is probably GLEW but it has a number of issues.
(EDIT for further clarification:) It is notable, that nothing beyond the functions already provided by the Windows OpenGL-1.1 ABI (i.e. the WGL API as it was specified for Windows-NT4) is required to get access to even the most modern OpenGL features. Of course newly introduced function pointer types and numeric token values must be defined somehow so that they can be used in source code, but there is no 'mandated' way (i.e. library) to do it. This makes it possible that a program which makes use of – for example – pure modern OpenGL-4 core profile that could be built with Visual C++ 4 (VC++ 4 got released in 1995), assuming it uses only language features and OS APIs that were available back then. The actual steps to create modern OpenGL contexts in Windows are pretty well documented at the OpenGL Wiki and the reader is referred to this resource as elaborating on the details here would largely leave the scope of this answer.
Also OpenGL itself does not deal with creating windows, handling user input and the likes. You can of course program against the native OS API for doing that. But often you just want to use some framework. Popular choices for OpenGL development are GLFW, FreeGLUT, SDL2 and SMFL.
datenwolfdatenwolf
Short answer: Install your compiler, find an OpenGL tutorial for that compiler. (eg. Google: Visual Studio OpenGL tutorial) And get started. No more downloads needed. It's included with the compiler.
The Long Answer:
The OpenGL SDK is not something you install. The Basic SDK (OpenGL 2.1) should come prepackaged with any standard compiler (Visual Studio, and GCC both do.)
You should be able to use the prepackaged version by using
#include <gl/gl.h>
, and adding the appropriate libraries to your lib path (Those libraries also come with the compiler. You should be able to find tutorials on this.)To use any version of OpenGL above 2.1, does not require a library either. You use
wglGetProcAddress(...)
to get appropriate functions to allow you use of those functions, IF THEY ARE SUPPORTED. Even then though, you still need to create an OpenGL 2.1 context.![Glut Glut](https://nafsadh.wordpress.com/files/2009/09/glut.jpg)
However, to easily use OpenGL3, you might want to download the
gl3.h
header. However, there is no gl3.lib
file to download. You just use the libs that come with your compiler.The reason for this is because OpenGL is not implemented in an SDK. It's implemented in the driver for your graphics card, and your program communicates directly with the driver. Starting with a basic API for querying supported functions and the pointers to those functions, so you can call them.
Wolfgang SkylerWolfgang Skyler
GLUT does that for you, you don't need to include it yourself. It seems like there's an issue with your set up. There are also other libraries that can be used in place of GLUT, but you need to use one of them, since you can't deal with OpenGL directly.
MKIIMKII