I’m a C++ application developer on Windows system. I’m developing an application using EGL 1.4 and OpenGL ES 2.0.
In a certain kind of a OpenGL32.DLL version, I found that a PVR error message occurred. The versions of OpenGL32.DLL that cause this problem are 6.3.9600.16384 on Win8.1 and 4.0.1379.1. And the message says :
PVR Message
PVR: VFrame attempted to use one of these functions:
PVR: wglChoosePixelFormatARB
PVR: but they are not present on you machine.
Ignore?
This message appeared when I call eglChooseConfig() or eglGetConfigs() functions in EGL API to get system configs.
I think this problem occurred because OpenGL32.dll versions mentioned above don’t support wglChoosePixelFormatARB() function.
Most of versions that I tested worked well. List of working version is :
5.2.3790.3959
6.1.7600.16385
6.3.9600.16384(1000kb)
10.0.10130.0
And list of not working version is :
4.0.1379.1
5.1.2600.1280
5.1.2600.5512
6.3.9600.16384 (720kb)
To solve this problem, I want to include this dll file in my product for a commercial use. I want to know that distributing a working version of OpenGL32.dll is possible. And can you know me the list of OpenGL32.dll version without this error and license information about OpenGL32.dll?
The issue is not about the opengl32.dll (in fact its inner working hasn't changed since Windows NT-4 some 19 years ago). Your system is simply missing a graphics driver with full OpenGL support:
The graphics drivers that are installed by default on Windows (and Windows Update) have only a very limited, stripped down OpenGL support (in fact they hardly support GPU acceleration). To get proper, full OpenGL support you must download the driver package for your GPU from the GPU vendor's website and install it manually.
Using Windows standard, automatic driver installation and Windows Update will not give you proper OpenGL support.
I am trying to develop a C++ application that uses OpenGL. I set up everything in XCode 6.4 (running on OS X 10.10.5) and I was able to get the OpenGL framework working. However, I can't figure out how to draw the graphics to a GUI window.
I know that GLUT is available, but it is deprecated and I'd rather avoid using it. Instead, is there a way of using some of Apple's native windowing systems (I assume there should be something available in the Cocoa API)?
I would rather avoid downloading additional libraries like SDL or Qt since I do not have root access on this machine and maintaining third-party libraries those may be challenging.
I set up OpenGl with DevC++ following a tutorial and everything works. I've looked into the main OpenGl project page (https://www.opengl.org/) but I can't find an official repository where I can download the packages that I need (I've found .zip but I can't understand the correct files that I need :(). I have seen many tutorials but they use unofficial repositories and they install packages in so many different ways even for the same IDE! :(. Is there an official repository? What files do I need? Is there a unique way to install OpenGL and if not could you tell me the most important steps of the installation ?
Is there a unique way to install OpenGL and if not could you tell me the most important steps of the installation?
Install drivers for your graphics card with OpenGL support. Done!
OpenGL is different than Direct3D or Mantle (or, soon to come, Vulkan): Back in 1996 OpenGL-1.1 was included into the Windows 32 bit platform ABI (Application Binary Interface). That means that for every Windows version after "Windows 95B" and "Windows NT 4.0" programs are assured for OpenGL-1.1 to be available.
Being part of the platform ABI has the nice side effect and consequence, that everything that's required for OpenGL development must be included in every compiler package that targets the Windows 32 bit (and by heritage the 64 bit) platform.
However the ABI covers only OpenGL-1.1. For everything that comes after the so called "extension mechanism" is provided. By using the extension mechanism programs can determine at runtime, which OpenGL capabilities (beyond v1.1) are available and load them. No extra libraries or SDKs are required for this!
Yet, since the process of enumerating available OpenGL capabilities and loading them is so tedious, a number of helper libraries exists that alleviate one from this annoying task.
you probably have OpenGL in your system as a part of your graphic card... You can see how to have a project running for different OS by taking a look at the OpenGL superbible:
https://sgar91.files.wordpress.com/2010/11/opengl-superbible-comprehensive-tutorial-and-reference-5th-edition-2010.pdf
Page 48 starts to talk about how to have a program running with OpenGL
I'm a bit confused about when exactly I need to use an OpenGL function loader like GLEW. In general, it seems like you first obtain a window and valid OpenGL context and then attempt to load functions.
Sometimes these functions are referred to as extensions, sometimes they are called core functions as well. It seems like what's loaded and classified as 'core' and 'extension' is platform dependent. Are the functions that are loaded in addition to some base set?
Do you need to load functions in the same way on OpenGL ES platforms as well? Taking a quick look at GLEW, I don't see any explicit support for Open GL ES. Other GL function loader libs do explicitly mention support specifically for ES however (like https://github.com/Dav1dde/glad)
OpenGL functions (core or extension) must be loaded at runtime, dynamically, whenever the function in question is not part of the platforms original OpenGL ABI (application binary interface).
For Windows the ABI covers is OpenGL-1.1
For Linux the ABI covers OpenGL-1.2 (there's no official OpenGL ABI for other *nixes, but they usually require OpenGL-1.2 as well)
For MacOS X the OpenGL version available and with it the ABI is defined by the OS version.
This leads to the following rules:
In Windows you're going to need a function loader for pretty much everything, except single textured, shaderless, fixed function drawing; it may be possible to load further functionality, but this is not a given.
In Linux you're going to need a function loader for pretty much everything, except basic multitextured with just the basic texenv modes, shaderless, fixed function drawing; it may be possible to load further functionality, but this is not a given.
In MacOS X you don't need a function loader at all, but the OpenGL features you can use are strictly determined by the OS version, either you have it, or you don't.
The difference between core OpenGL functions and extensions is, that core functions are found in the OpenGL specification, while extensions are functionality that may or may be not available in addition to what the OpenGL version available provides.
Both extensions and newer version core functions are loaded through the same mechanism.
datenwolf's answer is great, but I wanted to clarify something you said in the first bullet point of your question.
Core and extension status is not platform-dependent or even mutually exclusive.
Core means that some feature was introduced in a certain version of OpenGL. There are core functions, which are things that are guaranteed to exist in version X.Y and there are even core extensions, which are extensions that were introduced alongside version X.Y. Core extensions provide the same functions, types, enums, etc. as the core feature only in an extension form that does not require a specific version.
Framebuffer Objects went core in OpenGL 3.0, and are slightly less restrictive than the EXT extension (GL_EXT_framebuffer_object) that predates OpenGL 3.0. However, it is not necessary to have an OpenGL 3.0 implementation to have access to the core version of FBOs - an OpenGL 2.1 implementation might offer the core functionality.
In the extension specification for GL_ARB_framebuffer_object, you will find:
Issues
(8) Why don't the new tokens and entry points in this extension have
"ARB" suffixes like other ARB extensions?
RESOLVED: Unlike most ARB extensions, this is a strict subset of
functionality already approved in OpenGL 3.0. This extension
exists only to support that functionality on older hardware that
cannot implement a full OpenGL 3.0 driver. Since there are no
possible behavior changes between the ARB extension and core
features, source code compatibility is improved by not using
suffixes on the extension.
That is the first mention of a core extension that I can recall, but it is not the last. Since then many ARB extensions have been created that "backport" (if you will) core functionality from a higher version.
Here is some sample output gathered by parsing gl.xml for another core extension:
>> Command: void glBufferStorage (GLenum target, GLsizeiptr size, const void *
data, GLbitfield flags)
* Provided by GL_ARB_buffer_storage (gl|glcore)
* Core in GL_VERSION_4_4 ( gl 4.4)
It is core in 4.4 (guaranteed to exist in a 4.4 implementation), but because the extension that provides it is glcore, this core function may be available in older implementations if the core extension is available.
The simple piece of software I wrote to parse gl.xml for this information can be found here if you are interested.
Function loaders are only needed on Windows and Linux. Here's a quick overview of how you build for various OpenGL versions on different platforms.
Windows
The Windows development tools only contain headers for OpenGL 1.1. The conspiracy theorists would probably claim that Microsoft is not interested in making the use of OpenGL easy because it wants developers to use a proprietary API instead.
For anything beyond 1.1, you need to load the entry points dynamically by calling wglGetProcAddress(). Libraries like GLEW provide header files for higher OpenGL versions, and encapsulate the logic for loading the entry points.
Linux
I haven't done OpenGL programming on Linux. From what I hear, it requires function loading similar to Windows. I'll defer to #datenwolf's answer for the details.
Mac OS
Mac OS supports two main OpenGL feature sets:
OpenGL 2.1 with legacy features. This is used by including <OpenGL/gl.h>.
OpenGL 3.x and higher, Core Profile only. Used by including <OpenGL/gl3.h>.
In both cases, you don't need any dynamic function loading. The header files contain all the declarations/definitions for the maximum version that can be supported, and the framework you link against (using -framework OpenGL) resolves the function names.
The maximum version you can use at build time is determined by the platform SDK you build against. By default, this is he platform SDK that matches the OS of your build machine. But you can change it by using the -isysroot build option.
At runtime, the machine has to run at least the OS matching the platform SDK used at build time, and you can only use features up to the version supported by the GPU. You can get an overview of what version is supported on which hardware on:
https://developer.apple.com/opengl/capabilities/
http://support.apple.com/en-us/HT202823
Android, NDK
With native code on Android, you choose the OpenGL version while setting up the context and surface. Your code then includes the desired header (like <GLES2/gl2.h> or <GLES3/gl3.h>) and links against the matching libraries. There is no dynamic function loading needed.
If the target device does not support the version you are trying to use, the context creation will fail. You can have an entry in the manifest that prevents the app from being installed on devices that will not support the required ES version.
Android, Java
This is very similar to the NDK case. The desired version is specified during setup, e.g. while creating a GLSurfaceView.
The GLES20 class contains the definitions for ES 2.0. GLES30 derives from GLES20, and adds the additional definitions for ES 3.0.
iOS
Not surprisingly, this is very similar to Mac OS. You include the header file that matches the desired OpenGL ES version (e.g. <OpenGLES/ES3/gl.h>), link against the framework, and you're all done.
Also matching Mac OS, the maximum version you can build against is determined by the platform SDK version you choose. Devices you want to run on then have to use at least the OS version that matches this platform SDK version, and support the OpenGL ES version you are using.
One main difference is obviously that you cross compile the app on a Mac. iOS uses a different set of platform SDKs with different headers and frameworks, but the overall process is pretty much the same as building for Mac OS.
I am trying to experiment with the Qt library on Windows. On their downloads page, I notice that the binaries built using VS2012 are available in two forms, with and without OpenGL. What exactly is the difference between the two? In the OpenGL version, do they have some special API implemented using OpenGL or does all of Qt rendering depend on OpenGL? Also, is there a version of Qt that uses DirectX?
#Raman: The opengl variant is using the desktop opengl version just like with Qt4.
The non-opengl variant is using angle, and you need to have that installed alongside the DirectX SDK to get it working. Angle is an adapter between the directx and the opengles API. Only the latter is support directly by Qt, but unfortunately directx drivers tend to work better on Windows than the opengl(es) ones. There are no plans to support a directx backend inside Qt, so we leave with Google's Angle work in that regard.
As for providing some extra bit, there was a discussion about it recently on the mailing list, that this decision should not be build time, but more like run time. However, no one has stood up just yet to make that work. Hopefully, that will change soon. It is causing confusion for the end users just like, so do not feel alone. ;-)
Hope this explanation helps.
DirectX is supported via the ANGLE based library.
Note that this has changed and as of Qt 5.5 the prebuilt binaries you can download from the Qt website are configured with the -opengl dynamic option. This is what #lpapp above was talking about. Qt defaults to choosing either native OpenGL drivers or ANGLE at run time now.
Qt internally uses OpenGL to render unless you specify otherwise now. You can also render custom OpenGL content using Qt's QOpenGLxxx functions and classes.
For a simple introduction to Qt and OpenGL that covers this and more click here.