Sign in to follow this  
Hodgman

D3D and OGL at the same time!

Recommended Posts

This may seem like a stupid question, but just go along with me, ok? If I've got an application which has created two windows, one rendering using GL and one rendering using DX9, then: what is the best way to use the output of the GL window (i.e the frame-buffer's RGB data) as a texture in the DX9 window? Also, what's the best way to 'hide' the GL window (i.e. convert it to off-screen rendering instead of window-based rendering)?

Share this post


Link to post
Share on other sites
Just an idea:
-What about using a texture as the render target of the OGL render, taking its pixels and using them to build a texture for the DX render? This seems to me the most trivial way to achieve this...

Share this post


Link to post
Share on other sites
I've never tried this myself, but my gut feeling is that you'd need to copy the framebuffer pixels manually to a D3D texture since both OpenGL and D3D will have completely separate driver states, so there really wouldn't be a way to do it directly via either API. It's almost as if both windows are in different applications, but of course copying data between them is a lot easier since they really aren't.

And in OpenGL you can use FBO's to achieve off-screen rendering.

Share this post


Link to post
Share on other sites
Can you even do that though? I though that, at least in Windows XP, only 1 application could take control of the GPU at any given time, or maybe that was only in fullscreen mode?

Vista, at least, virtualizes the GPU, so applications can share access unfettered.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this