Simple opengl code (render to texture) works on mac but not on ubuntu -
i have simple opengl code written in cpp in qt 4.8 gl context, qt-creator.
the code render-to-texture fbo , show texture on screen. render-to-texture involves vertex buffer array. old-school immediate render (glpushmatrix
, glbegin(gl_points)
, glvertex
, etc) debug.
in macbookpro. no problem, code working perfectly.
then have tried port on ubuntu. changes in .pro files:
libs += -lglut -lglu -lgl -lglew #linux libs += -framework glut -framework opengl -lglew # mac
and in headers:
// linux #include <gl/glew.h> #include <gl/gl.h> #include <gl/glu.h> // mac #include <gl/glew.h> #include <gl.h> #include <glu.h>
in ubuntu immediate render works, showing has do, texture empty (both when draw them on screen both if pixel transfer texture buffer qimage, , in mac works perfectly).
the macbookpro has intel hd graphics 4000 512mb, , gl version 2.1 intel-8.12.47 while ubuntu (12.04, 3.5.0-36-generic #57~precise1-ubuntu) machine has geforce gtx 660, , gl version 1.4 (2.1.2 nvidia 319.23).
i think there problem on gl/nvidia drivers because when run qt application have warning:
libgl error: failed load driver: swrast libgl error: try again libgl_debug=verbose more details.
if worth, i'm using opengl command without _ext
suffix in end..
i'm not practical opengl , card capabilities , (especially) on installing driver under linux.
edit:
if, suggested, try call glewinfo debug verbose flag got:
libgl: screen 0 not appear dri2 capable libgl: opendriver: trying /usr/lib/i386-linux-gnu/dri/tls/swrast_dri.so libgl: opendriver: trying /usr/lib/i386-linux-gnu/dri/swrast_dri.so libgl error: failed load driver: swrast
geforce gtx 660, , gl version 1.4 (2.1.2 nvidia 319.23).
that screams there's no proper opengl driver installed. geforce 660gtx opengl-4 capable.
make sure have nvidia binary drivers installed (the open source nouveau drivers making progress, they're still far behind in features , performance).
apt-get install nvidia-glx nvidia-kernel-source nvidia-vdpau-driver libgl1-nvidia-glx libglx-nvidia-alternatives
should trick.
Comments
Post a Comment