Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way, or method, to have some application rendered as texture in 3D scene on some polygon, and also have full interactivity with it?

I'm talking about Windows platform, and maybe OpenGL but I guess it doesn't matter is it OGL or DX.

For example: I run Calculator using WINAPI functions (preferably hidden, not showing on desktop) and I want to render it inside 3D scene on some polygon but still be able to type or click buttons and have it respond.

My idea to realize this is to have WINAPI take screenshot (or render it to memory if possible) of that Calculator and pass it to OpenGL as texture for each frame (I'm experimenting with SDL through pygame) and for mouse interactivity to use coordination translation and calculate where on application window it would act, and then use WINAPI functions such as SetCursorPos to set cursor ant others to simulate click or something else.

I haven't found any tutorials with topic similar to this one.

Am I on a right track? Is there better way to do this if possible at all?

share|improve this question

closed as off-topic by Josh Petrie Aug 1 '14 at 18:57

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Programming questions that aren't specific to game development are off-topic here, but can be asked on Stack Overflow. A good rule of thumb is to ask yourself "would a professional game developer give me a better/different/more specific answer to this question than other programmers?"" – Josh Petrie
If this question can be reworded to fit the rules in the help center, please edit the question.

There may be two ways to approach this but neither will work with offscreen or minimized windows: A) Capture the desktop (DWM Vista/7) and use Win32 functions to figure out where a given window is within that screen shot or B) Attempt to capture & hook each individual window and whatver api it is using (which may be extremely difficult to monitor if it is a win32 app that only updates what has changed). Either way you will then update a texture in your program and render a poly with it. – NtscCobalt Sep 10 '12 at 19:56