Looking at the freeglut code,
I discover that there is a tag GLUT_RENDERING_CONTEXT that do exactly what I need...

the following command solved everything for me...
glutSetOption(GLUT_RENDERING_CONTEXT ,GLUT_USE_CURRENT_CONTEXT );

everything is now working in my program

it' is a pitty that this function is not described in the freeglut API...

Cheers,
Loic

 
 


 
2009/12/27 Loic Quertenmont <loicus@gmail.com>
 
Ha, thanks for the comment...
on opengl FAQ,
http://www.opengl.org/resources/faq/technical/displaylist.htm
I see: "GLUT does not allow display list sharing. You can obtain the GLUT source, and make your own glutCreateWindow() and glutSetWindow() function calls. You can then modify the source to expose display list sharing. When doing so, you need to make sure your modified routines still work with the rest of GLUT."
 
can you give me some hints on how to do this?
 
looking at this other thread
http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=238068
it seems that it is enough to have one unique opengl context that is shared by all the window...
and make a wglMakeCurrent or a glxMakeCurrent at the begining of the display function of each window.
 
Why not adding this feature in freeGlut?  doesn't seems to complicated and can be very usefull (in particular now that shaders and VBO starts to be the standard).
 
for now, I will try to do it internally in my soft, can you tell me how I can get the context of one particular window?
 
 
Thanks for help,
 
 
 Paul Martz  wrote:
>Yes it's possible to share objects between contexts in an OpenGL
>program; see the GLX spec at opengl.org for info. However, this is the
>freeglut list and this capability has never been supported in
>GLUT/freeglut, as far as I know.
>-Paul