Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Assassin_X

Something about DirectX and Opengl

This topic is 5760 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement
Ive been pondering using the using D3D and OGL at the same time problem, ad in theory, as long as the drivers was upto it I belive you could do it, however you couldnt use both to render to the screen at the same time.

The idea I came up with was using DX to draw to an OGL pbuffer (its all hdc''s for windows anyways, in theory if you make sure the pixel formats was sane it should work) and then rendering that pbuffer in OGL

However, I accept I dont know enuff about D3D and how the drivers deal with things such as memory allocation to see if this would work or not so it is pure theory in my head

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by _the_phantom_
The idea I came up with was using DX to draw to an OGL pbuffer (its all hdc''s for windows anyways, in theory if you make sure the pixel formats was sane it should work) and then rendering that pbuffer in OGL.

The traditional mixed-API approach is to use DirectDraw to provide a surface and OpenGL to render to that surface. Why people bother is beyond me, though.

Share this post


Link to post
Share on other sites
well, the project I''m currently employed to work on has an external render based on D3D, however the internal system I''m having to do is going to be using OGL, so one or the other has to be recoded unless a way of mixing can be found which doesnt suck majorly fps wise.. thus why I said it in the order I did btw

Share this post


Link to post
Share on other sites
Shouldn''t you be able to draw to two different windows\device context with two different APIs (D3D, OpenGL, DirectDraw, SDL, GDI, etc.)? If you have multiple views, like 3DS Max for example, and they each view is it''s own window (in some MDI app) you should be able to get the hwnd\dc of each separate window and draw with different APIs without a problem. You can''t combine output from different APIs (render a mesh with D3D and then a mesh with OpenGL into the same window and not have one overwrite the other) in a fast and efficient way that I know of, even though I''m sure you could devise interesting hacks to pull it off (even though they''d probably be either slow or not very effective.)

Share this post


Link to post
Share on other sites
thats why i was advocating a pbuffer, which should be in video RAM so its a matter of

lock pbuffer hdc in D3D
draw D3D
unlock pbuffer hdc in D3D
lock pbuffer hdc as texture in OGL
draw OGL scene with pbuffer texture in place
unlock pbuffer in OGL

I dunno how fast that would be, but assuming the video drivers are sane I also dont see why it wouldnt work, unless there is something about D3D I dont know

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!