Write on other opengl application windows

Hi at all,this is my problem:

I have to do a program in c#(c++,vb.net…)that use opengl and display image,write,paint in other running opengl windows…i get this window handle whit windows api but i don’t know paint in it :confused: .

Sorry for my english mate:)…and tks for help me

You will use the Windows handle and create an OpenGL context using it.

NEHE has some good examples about creating OpenGL context’s.

http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=02

You may need to use:

HDC GetDC(
HWND hWnd // handle to a window
);

To get a handle to a device context.

Originally posted by Milo Donati:

I have to do a program in c#(c++,vb.net…)that use opengl and display image,write,paint in other running opengl windows…i get this window handle whit windows api but i don’t know paint in it :confused: .

You can’t do this if the other windows do not belong to your process. Period.
This would be a way for other processes messing around with your OpenGL state.
OpenGL handles multiple threads, but not multiple processes writing to the same window.

You can’t do this if the other windows do not belong to your process. Period.
Yes you can if you do it right, I did it with my OpenGL applets to show in a web browser with high performance. And Adobe use it for their Acrobat reader plugin, but not using OpenGL of course.

You will need to create a child window (without a border, like a popup) exactly over the client area in the window you want to draw to.

You can do it!

Wanna split some hairs? :wink:
A window overlaying the other process’ window is not rendering into the other process’ window but into yours.
But the question was how to render additional data with OpenGL into another application’s window which already uses OpenGL for its own rendering.
Overlaying that with your own child window will change the clipping situation of the other window and a refresh of the underlying window will not work anymore with your child window on top unless you can make it transparent so that it doesn’t affect clipping. I doubt that MS Windows can handle that on OpenGL windows. It doesn’t even handle transparent menus correctly.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.