Command-line Options and Third-party Libraries |
% yum list available '*<pkg>*'
to check if pkg
is available.
Last I checked, all of GLEW
, libexpat
,
libpng
, and libjpeg
are available
for:
% yum install <pkg>
If you want the latest version of these, you can download them
from their project pages:
GLEW,
Expat XML Parser,
libpng,
libjpeg.
If you don't have root privileges to install these packages
system wide, install them on your home directory and tell
gcc/g++
to link against the static version of
these libraries by simply listing them on the command-line:
gcc . . . <your local lib path>/lib<pkg>.a
You may also need to tell gcc/g++
where to search
for header files using the command-line option:
-I <your local include path>
(which may be specified multiple times, once per directory.
To display OpenGL windows remotely, run:
client% ssh -Y server
It displays faster if you let the client OpenGL do
the rendering on local GPU with:
server% setenv LIBGL_ALWAYS_INDIRECT 1
If your remote OpenGL terminates with the error message:
X Error of failed request: BadWindow (invalid Window parameter)
Major opcode of failed request: 4 (X_DestroyWindow)
when you try to create a double-buffered glut window
or just because the client is running Mac OS X,
indirect is the only way to get the remote OpenGL app
to display. Unfortunately, code using shader usually
crashes on glCreateProgram()
or, on Mac OS X client,
glGenVertexArrays()
(perhaps due to Apple's
use of glGenVertexArraysAPPLE()
?). So if your code
relies on shaders, vertex array, object buffers, or any of
the "modern" OpenGL features, you should try to just run it
locally (3D gaming setups usually send the frames as a video
stream, not rendering each frame remotely).
/usr/local/include/
and
the libraries in /usr/local/lib/
. You'll need to add
these paths to your header and library search paths respectively,
per instructions above.
In my experience using ARB GLSL extensions, they are already part
of OpenGL.framework
, so you don't need GLEW to use
these extensions. The only caveat is that the four
gl*VertexArray*()
functions have APPLE
appended to them and that GL_RGB*F
still need
_ARB
appended.
*.vcxproj
file is.include\GL
folder to:
C:\Program Files (x86)\Microsoft Visual Studio *\VC\include\GL\{glew,glxew,wglew}.h
[You may have to create the "GL" directory]
C:\Program Files (x86)\Microsoft Visual Studio *\VC\bin\
lib\Release\Win32\glew32*.lib
to:
C:\Program Files (x86)\Microsoft Visual Studio *\VC\lib\
C:\Program Files (x86)\Microsoft Visual Studio *\VC\bin\amd64\
lib\Release\x64\glew32*.lib
to:
C:\Program Files (x86)\Microsoft Visual Studio *\VC\lib\amd64\
glew32.lib;
to your "Additional Dependencies"
under the "Configuration Properties→Linker→Input"
for "All Configurations".
In your OpenGL source files, include in order:
#include <GL/glew.h>
#include <GL/glut.h>
[or
#include <GLFW/glfw3.h>
]
and call glewInit()
after glutCreateWindow()
.
Some of our projects require the following libraries: the Expat XML Parser,
libpng, and libjpeg. Only the 32-bit version of
libexpat for Windows is available pre-built from sourceforge.
Similarly, the pre-built Windows binaries of libpng and
libjpeg are either 32-bit only, not the latest version,
and/or are not MinGW compatible. I've prepared
libexpat,
libpng, and
libjpeg packages that are
of the latest version as of the time of writing and support
both 32-bit and 64-bit MSVC and MinGW builds (the 32-bit
version of libexpat is the one from sourceforge).
You could install the dll, lib, and .h
files of these libraries into your VC or MinGW toolchain directories
similar to the installation of GLEW above, or of GLUT
or GLFW.
-lntdll
Last updated Dec. 7, 2015 by Sugih Jamin