I am trying to write an OpenGL program, but I am getting this error with freeglut. It used to work with xorg 6 but it is not working xorg 7. freeglut (./test): Unable to create direct context rendering for window 'test window' This may hurt performane * media-libs/freeglut Latest version available: 2.4.0-r1 Latest version installed: 2.4.0-r1
More likely it's because you updated freeglut from 2.2 to 2.4 -- can you back it down?
(In reply to comment #1) > More likely it's because you updated freeglut from 2.2 to 2.4 -- can you back > it down? > From :http://www.mathematik.uni-dortmund.de/~goeddeke/gpgpu/tutorial.html#setupgl2 "Cg 1.5 combined with the precompiled freeglut that ships with certain Linus distributions somehow breaks "true offscreen rendering" since a totally meaningless empty window pops up. There are three workarounds: Live with it. Use "real GLUT" instead of freeglut. Use plain X as described in the OpenGL.org wiki (just leave out the mapping of the created window to avoid it being displayed)." --I am going with "not free" GLUT, and that seems to work.
Yes, that works, but it sure doesn't fix the actual bug -- which is that freeglut can't get a direct rendering context for some reason.
(In reply to comment #3) > Yes, that works, but it sure doesn't fix the actual bug -- which is that > freeglut can't get a direct rendering context for some reason. > Okay, this is a complete n00b question, but how do I emerge a specific version? I added =media-libs/freeglut-2.2 ~amd64 to my package.keywords file, but it is still trying to merge 2.4
(In reply to comment #4) > Okay, this is a complete n00b question, but how do I emerge a specific version? > > I added =media-libs/freeglut-2.2 ~amd64 to my package.keywords file, but it is > still trying to merge 2.4 > 'emerge -1 =media-libs/freeglut-2.2*' will install it, though it will be lost the next update.
To keep it, add >=media-libs/freeglut-2.4 to /etc/portage/package.mask.
(In reply to comment #5) > (In reply to comment #4) > > Okay, this is a complete n00b question, but how do I emerge a specific version? > > > > I added =media-libs/freeglut-2.2 ~amd64 to my package.keywords file, but it is > > still trying to merge 2.4 > > > > 'emerge -1 =media-libs/freeglut-2.2*' will install it, though it will be lost > the next update. > freeglut 2.2 is not compiling gcc -DHAVE_CONFIG_H -I. -I. -I.. -march=nocona -O2 -pipe -c freeglut_cursor.c -MT libglut_la-freeglut_cursor.lo -MD -MP -MF .deps/libglut_la-freeglut_cursor.TPlo -o libglut_la-freeglut_cursor.o >/dev/null 2>&1 freeglut_callbacks.c: In function 'glutDisplayFunc': freeglut_callbacks.c:54: error: invalid lvalue in assignment freeglut_callbacks.c: In function 'glutReshapeFunc': freeglut_callbacks.c:63: error: invalid lvalue in assignment freeglut_callbacks.c: In function 'glutKeyboardFunc': freeglut_callbacks.c:72: error: invalid lvalue in assignment freeglut_callbacks.c: In function 'glutSpecialFunc': freeglut_callbacks.c:80: error: invalid lvalue in assignment freeglut_callbacks.c: In function 'glutVisibilityFunc': freeglut_callbacks.c:143: error: invalid lvalue in assignment freeglut_callbacks.c: In function 'glutKeyboardUpFunc': freeglut_callbacks.c:157: error: invalid lvalue in assignment freeglut_callbacks.c: In function 'glutSpecialUpFunc': freeglut_callbacks.c:165: error: invalid lvalue in assignment freeglut_callbacks.c: In function 'glutJoystickFunc': freeglut_callbacks.c:175: error: invalid lvalue in assignment freeglut_callbacks.c: In function 'glutMouseFunc': freeglut_callbacks.c:190: error: invalid lvalue in assignment freeglut_callbacks.c: In function 'glutMouseWheelFunc': freeglut_callbacks.c:198: error: invalid lvalue in assignment freeglut_callbacks.c: In function 'glutMotionFunc': freeglut_callbacks.c:207: error: invalid lvalue in assignment freeglut_callbacks.c: In function 'glutPassiveMotionFunc': freeglut_callbacks.c:216: error: invalid lvalue in assignment freeglut_callbacks.c: In function 'glutEntryFunc': freeglut_callbacks.c:224: error: invalid lvalue in assignment freeglut_callbacks.c: In function 'glutCloseFunc': freeglut_callbacks.c:232: error: invalid lvalue in assignment freeglut_callbacks.c: In function 'glutOverlayDisplayFunc': freeglut_callbacks.c:270: error: invalid lvalue in assignment freeglut_callbacks.c: In function 'glutWindowStatusFunc': freeglut_callbacks.c:278: error: invalid lvalue in assignment freeglut_callbacks.c: In function 'glutSpaceballMotionFunc': freeglut_callbacks.c:286: error: invalid lvalue in assignment freeglut_callbacks.c: In function 'glutSpaceballRotateFunc': freeglut_callbacks.c:294: error: invalid lvalue in assignment freeglut_callbacks.c: In function 'glutSpaceballButtonFunc': freeglut_callbacks.c:302: error: invalid lvalue in assignment freeglut_callbacks.c: In function 'glutButtonBoxFunc': freeglut_callbacks.c:310: error: invalid lvalue in assignment freeglut_callbacks.c: In function 'glutDialsFunc': freeglut_callbacks.c:318: error: invalid lvalue in assignment freeglut_callbacks.c: In function 'glutTabletMotionFunc': freeglut_callbacks.c:326: error: invalid lvalue in assignment freeglut_callbacks.c: In function 'glutTabletButtonFunc': freeglut_callbacks.c:334: error: invalid lvalue in assignment make[2]: *** [libglut_la-freeglut_callbacks.lo] Error 1 make[2]: *** Waiting for unfinished jobs.... mv -f .libs/libglut_la-freeglut_display.lo libglut_la-freeglut_display.lo mv -f .libs/libglut_la-freeglut_cursor.lo libglut_la-freeglut_cursor.lo make[2]: Leaving directory `/var/tmp/portage/media-libs/freeglut-2.2.0/work/freeglut-2.2.0/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/var/tmp/portage/media-libs/freeglut-2.2.0/work/freeglut-2.2.0' make: *** [all] Error 2 !!! ERROR: media-libs/freeglut-2.2.0 failed. Call stack: ebuild.sh, line 1568: Called dyn_compile ebuild.sh, line 937: Called src_compile ebuild.sh, line 608: Called die !!! emake failed !!! If you need support, post the topmost build error, and the call stack if relevant.
Switch back to gcc 3.4 if you still have it installed.
(In reply to comment #8) > Switch back to gcc 3.4 if you still have it installed. > I only have gcc 4.1.1, is there a way to have both installed. I used to do that on my Solaris box by just modifing path, making the one I wanted to use first.
(In reply to comment #9) > (In reply to comment #8) > > Switch back to gcc 3.4 if you still have it installed. > > > > I only have gcc 4.1.1, is there a way to have both installed. I used to do > that on my Solaris box by just modifing path, making the one I wanted to use > first. It's even easier on Gentoo. Just emerge =gcc-3*, and use gcc-config to switch between them.
(In reply to comment #8) > Switch back to gcc 3.4 if you still have it installed. > Okay, it compiled with gcc 3.4. The code seems to run ... at least it is not giving that error anymore. The thing is that it is supposed to only create a pseudo window so it can do X free rendering/calculations, but it is actually creating windows. Not free glut has the correct behavior of not creating a window. When I execute glTexImage2D() in my c code, it is producing and error. When I execute glGetError(), returns 1 which is not any of the return values documented in OpenGL man pages. Any ideas?
(In reply to comment #11) > Okay, it compiled with gcc 3.4. The code seems to run ... at least it is not > giving that error anymore. The thing is that it is supposed to only create a > pseudo window so it can do X free rendering/calculations, but it is actually > creating windows. Not free glut has the correct behavior of not creating a > window. Guess it's a bug. Might be fixed in 2.4, but we've got the other blocker issue there. > When I execute glTexImage2D() in my c code, it is producing and error. When I > execute glGetError(), returns 1 which is not any of the return values > documented in OpenGL man pages. Any ideas? Not really, but I am a bit surprised this would be specific to freeglut and not glut.
(In reply to comment #12) > (In reply to comment #11) > > Okay, it compiled with gcc 3.4. The code seems to run ... at least it is not > > giving that error anymore. The thing is that it is supposed to only create a > > pseudo window so it can do X free rendering/calculations, but it is actually > > creating windows. Not free glut has the correct behavior of not creating a > > window. > > Guess it's a bug. Might be fixed in 2.4, but we've got the other blocker issue > there. > > > When I execute glTexImage2D() in my c code, it is producing and error. When I > > execute glGetError(), returns 1 which is not any of the return values > > documented in OpenGL man pages. Any ideas? > > Not really, but I am a bit surprised this would be specific to freeglut and not > glut. > The thing about glTexImage2D() had to do with my configuration set to do cpu rendering instead of using the gpu/nvidia drivers. It was fixed by executing: # eselect opengl set nvidia
Closing as per comment #13. Thanks