I'm currently working on an image-based visual servoing application in C++. Since two months I
try to include a robot simulator in this program. The simulator is an OpenGL application from our

I try to render the OpenGL stuff directly on the video card. Therefor I use the OpenGL extension
GLEW (version 1.4.0). The basic work is done in the following function:

int CVirtualRobot::GetImage(CImageBase *img, GLuint *fbo, GLuint *depthb, GLuint *colorb) {
  // get display infos
  int width = glutGet(GLUT_WINDOW_WIDTH);
  int height = glutGet(GLUT_WINDOW_HEIGHT);
  int bpp =  glutGet(GLUT_WINDOW_RGBA) ? 4 : 3;
  GLenum format = (bpp==4) ? GL_RGBA : GL_RGB; 

  // select on which FBO to operate
  glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, *fbo);
  glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, *depthb);
  glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT32, width, height);

  // attach renderbuffer to framebuffer depth buffer
  glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, *colorb);
  glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, format, width, height);
  // attach renderbuffer to framebuffer color buffer
  // Draw Scene
  // create buffer
  unsigned char *buf = new unsigned char[width*height*bpp];

  // read from front buffer

  // read pixels from framebuffer, FIXME: better use "render to texture"

  // make everything fit into the image

  if (bpp==3) {
    for (int x=0;x<width;x++)
      for (int y=0;y<height;y++) {
		for (int c=0;c<bpp;c++) {
		  (*reinterpret_cast<unsigned char*>((*img)(x,height-y-1,c))) = buf[(x+width*y)*bpp+c];		  
  } else {
    for (int x=0;x<width;x++)
      for (int y=0;y<height;y++) {
		for (int c=0;c<bpp-1;c++) {
		  (*reinterpret_cast<unsigned char*>((*img)(x,height-y-1,c))) = buf[(x+width*y)*bpp+c];

  return 0;
This works perfectly on my desktop computer (Kubuntu 7.10, Radeon X1800). But on the
computer of our chair (SUSE Linux 10.3, GeForce PCX 5300/PCI/SSE2) I only get a black image.
I also tried to run the application on two other computers. One with an ATI video card, the other
with a NVDIA video card and both with Ubuntu 7.10. Only the computer with an ATI card works.
So we just install an ATI card (ATI Radeon HD 2400 PRO) on the computer of our chair. But that
doesen't change anything.

Does anybody have an explanation for this strange behavior and as the case may be an answer
for this problem?

Thanks in advance.