D3D device, should i make my d3d class singleton?
Hi, im making a class around the d3d device, eg to initialise it, cleanup etc.
Im wondering if i should make it a singleton, as ive heard people say the the d3d device should be used, eg initialised etc.
But what about if you have multiple windows eg a map editor, one for xy , zy, xz, 3d views.
would you need a new d3d device to render on each view, eg a view uses a new window, thats how many 3d editors seem to do it.
So basically should the d3d device only to be initialised once, if so id make it a singleton...
Same device, different viewports for those editing style views AFAIK.
I put my D3D device class as a monoinstance, inside of my Renderer monoinstance and I pass it out when needed. You''re stucking handing out devices, or make some sort of Index and Vertex buffer manager, among other things that use the device.
I put my D3D device class as a monoinstance, inside of my Renderer monoinstance and I pass it out when needed. You''re stucking handing out devices, or make some sort of Index and Vertex buffer manager, among other things that use the device.
use IDirect3DSwapChain8 for multiple viewports, not multiple devices. you can't share video resource between devices (at least not easily, I don't know of any way to do it), so an editor done like that would require 4x as much memory as the game.
edit: or of course, IDirect3DSwapChain9
[edited by - billybob on March 25, 2004 11:28:37 PM]
edit: or of course, IDirect3DSwapChain9
[edited by - billybob on March 25, 2004 11:28:37 PM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement