   GL context without a window?
  Hello guys. Is it possible to render to an offscreen surface (I use pbuffers) without opening a window? My environment is Sdl+OpenGL, under Linux (Redhat 9) and Windows XP. I know that in any case I need an openGL context, but what is absolutely not necessary in my application is an opened window. I want my application to render to the offscreen surface and readback from it in background. The application infact is meant to be a client that evaluate the fitness of a robot controller, in a process of evolutionary improvement of it. It will run thousands of times for days without human intervention, in background on someone else''s computer, that''s way I don''t want a window. Thank you,Stefano Lanzaicq: 32987714 
Mesa have an offscreen renderer (look for OSMesa). You just give it a buffer and it will render into it.I use it on my webserver (experimental use only) to generate PNG-images from a scene, and send them to the browser as normal images. Works great, although speed could be an issue for complex scenes, as it''s software only. ;  Just create the window as normal but omit the call to show the window - not sure how you do this in Linux but in windows you just drop the call to ShowWindow.James ;  Well, all you really need to set-up a render context is not a window, but actually a HDC. In Windows there is a CreateCompatibleDC(NULL) call that will give you a valid DC, ''tough IIRC you are restricted to using the color depth of your desktop in this case. If this is not a problem, this is a snip from a OGL that I used to draw to a bitmap HDChDC2;HGLRC  hRC;HBITMAPhBMP;GLuint PixelFormat;  BITMAPINFOHEADER BIH;int iSize=sizeof(BITMAPINFOHEADER);BIH.biSize=iSize;BIH.biWidth=160;//size of the memory screenBIH.biHeight=160;BIH.biPlanes=1;BIH.biBitCount=16;  //default is 16 bitBIH.biCompression=BI_RGB;BIH.biSizeImage=0;void* m_pBits;hDC2=CreateCompatibleDC(NULL);//we make a new DC and DIbitmap for OpenGL to draw ontostatic  PIXELFORMATDESCRIPTOR pfd2;DescribePixelFormat(hDC2,1,sizeof(PIXELFORMATDESCRIPTOR),&pfd2);//just get a random pixel format.. BIH.biBitCount=pfd2.cColorBits;//to get the current bit depth.. !?hBMP=CreateDIBSection(hDC2,(BITMAPINFO*)&BIH,DIB_RGB_COLORS,&m_pBits,NULL,0);hBMP_old=(HBITMAP)SelectObject(hDC2,hBMP);static  PIXELFORMATDESCRIPTOR pfd={    // pfd Tells Windows How We Want Things To Be sizeof(PIXELFORMATDESCRIPTOR),// Size Of This Pixel Format Descriptor   1,   // Version NumberPFD_DRAW_TO_BITMAP |// Format Must Support Bitmap Rendering   PFD_SUPPORT_OPENGL |PFD_SUPPORT_GDI,// Format Must Support OpenGL,   0,//   PFD_TYPE_RGBA, // Request An RGBA Format   16,// Select Our Color Depth   0, 0, 0, 0, 0, 0,   // Color Bits Ignored   0,//1,   // No Alpha Buffer   0,   // Shift Bit Ignored   0,   // No Accumulation Buffer   0, 0, 0, 0,    // Accumulation Bits Ignored   0,//16,  // 16Bit Z-Buffer (Depth Buffer)0,   // No Stencil Buffer   0,   // No Auxiliary Buffer   0,//PFD_MAIN_PLANE,// Main Drawing Layer   0,   // Reserved   0, 0, 0   // Layer Masks Ignored    };pfd.cColorBits=pfd2.cColorBits;//same color depth needed.DWORD code;code=GetLastError();PixelFormat=ChoosePixelFormat(hDC2,&pfd);// now ''pretend'' we want a new formatint ret;ret=SetPixelFormat(hDC2,PixelFormat,&pfd);code=GetLastError();hRC=wglCreateContext(hDC2);ret=wglMakeCurrent(hDC2,hRC);//that''s it    Quidquid latine dictum sit, altum viditur ;  Thank you for your replies, but I need a solution for linux actually since the experiment will run only under that o.s. And I can''t use Mesa, I need absolutely the best performance thus hardware acceleration. Any other ideas? Thanks,Stefano Lanza;  creating a dummy hidden window is probably your best option still, as was said just never show it and the user need never know