You are not logged in.
Have a DELL Inspiron E1405 with Intel 945GMS, xorg 1.6.3, direct rendering on, xorg configured totally with hal, last packages, gnome. -- no compiz!
So, interested in GLUT but cant render the contents of a single buffered window. The code is about right, and runned in Windows when I had one. Double buffered windows and everything else works just fine.
Find some interesting comments at: http://dev.haiku-os.org/ticket/3191
Heres the code:
#include <GL/freeglut.h>
void RenderScene(void) {
// Clear the window with current clearing color
glClear(GL_COLOR_BUFFER_BIT);
// Set current drawing color to red
// R G B
glColor3f(1.0f, 0.0f, 0.0f);
// Draw a filled rectangle with current color
glRectf(-25.0f, 25.0f, 25.0f, -25.0f);
// Flush drawing commands
glFlush();
}
void SetupRC(void) {
// Set clear color to blue
glClearColor(0.0f, 0.0f, 1.0f, 1.0f);
}
int main(int argc, char* argv[]) {
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
glutCreateWindow("GLRect");
glutDisplayFunc(RenderScene);
SetupRC();
glutMainLoop();
return 0;
}
If you know some work-around that doesnt involve sucumb to SDL or tricky double buffered swaps, please tell me
Thank you all!
Last edited by kronig (2009-08-25 23:06:14)
Offline
That's weird because I just compiled your code and it works, red window and all, rendering fine.
Wait, what does Haiku OS have to do with this? It works on Arch for me.
Last edited by Hohoho (2009-08-05 22:03:09)
Offline
Nearly nothing Haiku OS has to do with this problem, least that was the closest reference to my problem, so I posted. =/
I dont know even which log file to look for this problem. Xorg dont tell me nothing, neither everything or other log files in /var.
How I said, if I use double buffered methods, like all the glutSwap-kind-of-function, works. But with glFlush() and glFinish() in a single buffered window just nothing seems to happen! The window is created but with the pixels of other windows in it, like taking a printscreen and post it inside the opengl window.
Offline
-- and sorry for my brazilian english,
Offline
Perhaps its the video card acting up? Is it possible to try the vesa driver for this, or is software GL rendering impossible with it?
Offline
Perhaps its the video card acting up? Is it possible to try the vesa driver for this, or is software GL rendering impossible with it?
Likely drivers or something. It doesn't work for me either (also on Intel).
Why not just do double-buffering? Isn't that the better option anyway?
Offline
Same card as I? 945GMS?
Offline
Same card as I? 945GMS?
No, 915GM. Same problem though.
Offline
Same problem on intel x3100. I guess that means it's the linux drivers.
Offline
I found a workaround on the web,
just type
LIBGL_ALWAYS_SOFTWARE=1 ./[program]
They have been using this for blender.
Offline
I found a workaround on the web,
just type
LIBGL_ALWAYS_SOFTWARE=1 ./[program]They have been using this for blender.
like this?
$ LIBGL_ALWAYS_SOFTWARE=1
Offline
I set that, but doenst work for me.
Offline
if your program is named gasket.c, and you type this to compile
gcc gasket.c -o gasket -I/usr/X11R6/include/ -L/usr/X11R6/lib -lX11 -lXi -lXmu -lglut -lGL -lGLU
once compiled, you would type
LIBGL_ALWAYS_SOFTWARE=1 ./gasket
you would have to run LIBGL_ALWAYS_SOFTWARE=1 every time in front of your program.
This command switches the program you wish to run into software mode.
Last edited by brynstntn (2009-08-25 18:37:14)
Offline
it works, indeed.
thank you for the support and patience
Offline