Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use current version of opengl in cygwin?

Tags:

cygwin

opengl

I have been using OpenGL with cygwin for a few months to program some 3d applications. I now want to attempt to write some slightly more advanced techniques using things like vertex buffer objects. However, I noticed that I ran into an obstacle: when I use glGetString(GL_VERSION) in my program it spits out 1.4.

I compile my program with these flags: -lGL -lglut -lGLU -lGLEW and have included these headers: freeglut.h glew.h. I have chosen to link against the X11 libraries vs. the windows ones as explained here. My current OpenGL programs build and are able to run (because up until now, I have used older functionality--pre-OpenGL 1.4).

I have a new desktop computer with an ATI FirePro V4800 (FireGL) graphics card that can support up to OpenGL 4.1. I have installed the latest drivers and it passes the tests supplied by the program: OpenGL Extensions Viewer. In addition, the program shows that all the extensions up to and including 4.1 are available for my graphics card.

There is a brief mention here under the last answer saying that cygwin may want to use older dlls (ones that don't support shaders, etc.). Is this a cygwin problem? Will cygwin just not recognize my latest drivers and offer me the cool stuff in OpenGL 4.1? Or am I not linking to the correct libraries?

UPDATE

After getting to know how Cygwin's X Server works I figured I should switch to freeglut's native windows libraries. I grabbed the pre-compiled binaries found here and put the files in appropriate directories to link against them. After recompiling I am able to use all the options found in OpenGL as my graphics card permits (4.1).

like image 838
chembrad Avatar asked Mar 28 '12 20:03

chembrad


1 Answers

When using Cygwin's X-server, start it with -wgl option (current versions do that automatically) then

export LIBGL_USE_WGL=1

On the machine I'm posting from, I get:

$ glxinfo | grep OpenGL
OpenGL vendor string: Intel
OpenGL renderer string: Intel(R) HD Graphics 2500
OpenGL version string: 4.0.0 - Build 9.17.10.3062
OpenGL shading language version string: 4.00 - Build 9.17.10.3062
[...]

Unsetting the environment variable:

$ glxinfo | grep OpenGL
OpenGL vendor string: VMware, Inc.
OpenGL renderer string: Gallium 0.4 on llvmpipe (LLVM 3.4, 256 bits)
OpenGL version string: 3.0 Mesa 10.3.5
OpenGL shading language version string: 1.30
[...]
like image 92
Shadocko Avatar answered Nov 11 '22 10:11

Shadocko