Mixing GLUT and Chromium windows

Peter Eisenlohr <[email protected]> Mon, 20 Oct 2008 14:45:26 +0200
Newsgroups gmane.comp.graphics.chromium.user
Message-ID <[email protected]>
Hello everyone,

I have set up Chromium (CVS version) on Windows with a simple 
Tilesort/Cave-like configuration, and auto-startup is working as well 
using $HOME/.crconfigs and crfaker.dll renamed to opengl32.dll. This 
works fine with the application rendering into the windows created by 
crserver. The original GLUT window stays empty, though.

My question now is, how can I create two OpenGL contexts in order to 
render into the original GLUT Window as well? Without Chromium, I 
managed to create two GLUT windows and rendering into them. But when 
using the opengl32.dll-faker approach, all rendering seems to end up in 
Chromium. I also tried the 'match_window_count' option.

Or do I need to go about this differently by not using the faker but by 
linking to crfaker.dll explicitly and usinsg crWindowCreate() etc.? In a 
second attempt, I tried this:

main()
{
	glutInit(...)
	glutInitDisplayMode(...)

	crContext = crCreateContext_ptr(...)
	crWindow = crWindowCreate_ptr(...)

	glutWindow = glutCreateWindow(...)

	glutDisplayFunc(renderCallback)
	glutReshapeFunc(reshapeCallback)
}

And within the rendering callback:
{
	renderGLUTScene();
	glutSwapBuffers();

	crMakeCurrent(crWindow, crContext);
	renderCRScene();
	crSwapBuffers(crWindow, crContext);
}

The GLUT window works this way, but the Chromium Windows don't seem to 
SWAP since they show only garbage, glClear seems to have no effect (they 
do refresh their contents, though). I hope synchronizing GLUT and 
Chromium rendering like this is ok, as well.

Any ideas?
   Peter


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/