OpenGL - Using modern libraries - opengl

Upon successful compilation of a recent program I wrote from the openGL-book using openGL 4.0 I wasn't able to run the program due to an error that stated " error XX - unsupported hardware.."
However according to a previous question I asked if I could compile/run openGL programs on my computer I got an answer that I could:
Wiki claims you can do GL 4.0 with your HD 4000 [Graphics Chip] on Windows.
My question is - is that I am using the libraries freeglut 2.8 and GLEW 1.10 (newest versions) but the tutorial I followed used functions that came with 4.0 could the reason that my program does not run follow because I am linking modern versions of openGL libaries?

Things you have to check to run modern OpenGL:
Graphics driver: Do you have the latest and most up to date drivers?
Graphics card/chipset: Can your graphics hardware support the latest OpenGL even with its most recent drivers?
Using Proper Hardware: Some laptops come with a low powered graphics chipset and a high powered alternate graphics card/chipset. The low powered one may not support new stuff, but the high powered one definitely should. Have you instructed your computer to use the right one?
Libraries: Have you properly linked to something like GLEW that gives you the ability to use modern OpenGL?
Since you're on Windows, do note that they purposefully don't give you preinstalled access to modern OpenGL, so you have to do it yourself. Usually that just means checking your drivers and downloading GLEW.
From your error message, it looks like your graphics drivers aren't up to date or the graphics card/chipset/whatever you're using doesn't support the OpenGL version you want.

Related

How to set up mac for graphics programming to use openGL?

I am a new to programming and also to this platform so i apologize if
my question is not proper or seems stupid but i need help .None of the
resources on internet have been useful to me . If possible please
provide step by step instrction to set up mac for graphics
programming. thank you in advance.
I am a new to programming and i am trying to learn graphics programming .Till now i write c/c++ code in a text editor and compile and execute them to see the output in shell . I searched the web for setting up mac for opengl projects but none of them come close to clearing my doubts . Here are the doubts/questions :
my computer: macOS-Mojave :macbook pro mid 2012 (intel hd graphics 4000) supports openGL 4.1 according to apple website
1. do i have to download some files to use openGL ? or is it just a an api implemented by the computer hardware manufacturer(here apple in my case ).
2. according to recent news apple deprecated openGL. And i don't know which version of openGL is on my macbook . is there a way to find out ?None of the answers listed have worked for me.
3.Can i compile openGL code through terminal like i have been doing till now or do i have to use xcode ?
1. do i have to download some files to use openGL?
So far, not yet. Everything required ships with the compilers by default. You just add -framework OpenGL to your compiler invocations and are good to go.
2. according to recent news apple deprecated OpenGL. And i don't know which version of openGL is on my macbook. is there a way to find out? None of the answers listed have worked for me.
You're mixing two different concepts here:
The deprecation of OpenGL in the macOS platform means, that OpenGL will disappear from that OS altogether, irrespective of what OpenGL version actually is supported. Eventually you'll have to either move to Metal, or use some wrapper like MoltenGL (which implements OpenGL on top of Metal) or MoltenVK (which implements Vulkan on top of Metal).
With macOS the highest OpenGL version supported is determined entirely by the version of macOS installed. That is different from other OS, where a mere driver update may give you a higher OpenGL version, as long as the installed graphics hardware meets the requirements of that higher OpenGL version.
3. Can i compile openGL code through terminal like i have been doing till now or do i have to use xcode?
Yes. And there's no difference between compiling from the command line, and through Xcode, because Xcode is just doing the very same command calls as you'd do through the terminal.

Using Mesa3d with C++ in Ubuntu

I'm doing an OpenGL course but only have integrated graphics with my Intel processor. Upon doing some research it seems I can use the Mesa implementation of OpenGL with my integrated graphics.
On the installation page it says it requires python, but my course will be practicing OpenGL in a C++ environment.
I've also been looking at OpenGL tutorials online in C++, and there are many libraries used for simplifying common tasks in OpenGL. Will I be able to use these libraries with Mesa in C++, and if so, how would I approach this?

OpenGL version is few years older than laptop

When I write a java program using LWJGL, and get the OpenGL version using glGetString(GL_VERSION);. Then it displays: 2.1.0 - Build 8.15.10.1892
When I open my windows console (using the famous 'cmd' run), and I use systeminfo, it gives me not just any information about the installation date of windows.
I want to get the installation date of windows because then I know how old my laptop is. After searching the internet, I used WMIC OS GET installdate and I finally got a date: 11 November 2010.
And I assume that's true because I can remember at least the same year. And of course the device may have been some time at the factory or in the store.
When I lookup how old OpenGL 2.1.0 is, I see it's of around 2006 https://www.opengl.org/wiki/History_of_OpenGL#OpenGL_2.1_.282006.29
I'm disappointed of my OpenGL version.
I'm running 64 bit Windows 7. The device is probably at least from the end of 2010, but java displays an OpenGL version of 2006.
There are newer OpenGL versions from widely before November 2010, like version 3.0 (2008), 3.1 (2009) and 3.2 (also 2009)
Could it perhaps be that the JVM only has access to an older version of OpenGL?
Some time ago I played a CD-rom game on this laptop. I think that game would never be playable if it used OpenGL 2.1.0...
Or is this an unfair comparision?
OpenGL by itself is just a specification. The actual thing running on your computer is called an implementation which are usually part of the graphics driver. Also each OpenGL specification has very specific requirements on the implementation. And there are many things in OpenGL-3.x that simply are not supported even by hardware that were "modern" in 2010. For example Intel GPUs from around that time simply don't have everything that's required for OpenGL-3 support. Hence you'll get only OpenGL-2.x support for those and nothing more.
You could look up your laptop specification and see your gfx hardware. This will tell you which version of OpenGL your hardware supports (this information will be available from the gfx chip vendor most likely).
Using an API that supports the version of GL that you hardware does is another issue and may be with the way you have initialized or used the openGL graphics lib.
I would have thought most drivers these days support older versions. They may not support the API natively, but I would have thought provide wrappers for the functionality in the driver. Certainly I can code in OpenGL 1.1 and see the results on the same machine as an OpenGL 4.5 program (On a quadro K2200M).

Is it possible to use OpenGL 4.5 features with latest mesa libraries?

I want to use latest OpenGL features on Ubuntu. And I have installed mesa-common-dev but as far as I understand mesa does not support OpenGL 4.5 features. Also how can I use OpenGL via hardware without any API ?
Note :
glxinfo | grep "OpenGL version"
OpenGL version string: 4.5.13397 Compatibility Profile Context 15.20.1046
I want to use latest OpenGL features on Ubuntu. And I have installed mesa-common-dev but as far as I understand mesa does not support OpenGL 4.5 features.
All that matters is, that your actual OpenGL implementation supports the profile you want. The Linux ABI on OpenGL is pinned to OpenGL-1.2 (LSB5 has been released recently, so expect upcoming distribution releases to follow it, which bumped it to OpenGL-2.1).
Anything that goes beyond the ABI requirements is done through the extension mechanism. I.e. use load function pointers through …GetProcAddress and introduce new tokens with a glext.h. This processes has been repacked into OpenGL extension wrapper-loader libraries like GLEW.
The stuff mesa-common-dev provides is what's written down in the Linux LSB ABI specs… in a vendor neutral way, so you can compile your program using mesa-common-dev stuff, but it will work with the NVidia or AMD/ATI drivers as well.
Also how can I use OpenGL via hardware without any API ?
By definition you can't. OpenGL is an API. If you remove the API you remove OpenGL. If your intention is working the naked GPU on the bare metal, well, that would boil down to writing a full driver. In a few weeks/months Vulkan will be released and this gets you much closer to the GPU than OpenGL.

Getting started with OpenGL ES 2.0 on Windows

This is a very specific questions about the steps necessary to Build a simple OpenGL ES 2.0 program on the Windows platform. The environment is Visual Studio with unmanaged C++.
I go to the Khronos.org site and, frankly, find it a bit opaque because it reads like something written by a standards body. I don't want to download a "reference" or a "specification", etc.
All I'm looking for are the links and steps to get me from A to B. In other words, "Download these files or run this setup at this URL. Create a new Visual studio project with references to these libraries. Include this header file."
Again, I'm interested in ES 2.0.
I have been using googles Angle Project. It converts opengles 2.0 to DirectX 9 calls for win32. It works fairly well and even has quite a few examples. Its also the BSD licence so anything you make you can use the source for your own projects.
After alot of digging around for the same thing. I found an emulator for openGL es 2 from PowerVR: http://www.imgtec.com/powervr/insider/sdkdownloads/index.asp
The AMD one linked above is no longer available or supported.
AMD bundle OpenGL ES with their normal Catalyst drivers (for Win & Lin).
You just need to use EGL to get OpenGL ES context! (And have to use headers/includes from AMD OpenGL ES SDK).
AMD users already have everything they need to run your app.
Every doc about EGL and OGL ES is valid.
It work on AMD only.
PS Yes it is different from OLD/DEPRECATED OpenGL ES emulator. Because it is native!!!
AMD now ship a desktop OpenGL ES 2.0 version with EGL library
http://developer.amd.com/tools/graphics-development/amd-opengl-es-sdk/
You can have a look at Angle Project which brings OpenGL ES to desktops. It works pretty good and not that hard to setup: http://code.google.com/p/angleproject/
OpenGL ES is not generally available for Desktop machines. It is intended for embedded systems, hence the name - ES: Embedded Systems.
There isn't a native implementation available (the ES stands for Embedded Systems after all), but you could try ATI's OpenGL ES Emulator.
edit: 3/3/12 It looks like AMD has discontinued their support of the simulator.