PDA

View Full Version : Using OpenGL with Child Windows (Win32)



AcidInjury
08-05-2003, 06:03 AM
I am writing a program that uses Child Windows for viewing loaded textures. The textures need to be available to both the Parent and Child Windows.

I would like to know the best way to specify which window I am wanting to render in.

Each window current has its own Device Context and Rendering Context. I tried using wglMakeCurrent with the appropriate windows DC and RC as the parameters. The result was not so good, I ended up with solid colors only. I seem to be loosing texture information...

Anyone have this problem before, or have an idea what I am doing wrong?

Thanks!
Will Reynard

Relic
08-05-2003, 06:48 AM
If the windows are spawned by the same process and use the same pixelformat (mainly the same OpenGL implementation) you need to call wglShareLists and use texture objects to have the texture available in both contexts without downloading it in each.

DJSnow
08-05-2003, 07:09 AM
in my own small 3D-modeller written a while ago it did it very simple:
holding the textures twice - yes, i know that means dubble memory-usage, but it's very easy; and if your texture (on harddisk) changes you only have to reload the file for getting the view in the editor updated, and to re-bind it to get the updated version in the 3D-rendering output too. this is the most simpliest way in my eyes...