Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: DoorKnobHandle on Tue 09/08/2011 21:25:09

Title: Plugins: how to best retrieve D3D9 device?
Post by: DoorKnobHandle on Tue 09/08/2011 21:25:09
Quick question to other AGS plugin authors: when using D3D9 drivers, how do you guys retrieve the D3D9 device on startup? I have always done this in the AGSE_PRESCREENDRAW by counting frames and setting things up on the very first frame and before rendering anything. This is not a very elegant solution however, I wish there was some kind of startup event that would pass the D3D9 device but I couldn't find such a thing. How are other people doing this?
Title: Re: Plugins: how to best retrieve D3D9 device?
Post by: Calin Leafshade on Tue 09/08/2011 21:35:22
The way you do it currently is the only way i can see of doing it.

i just declare a global and if the global == null set up the device.
Title: Re: Plugins: how to best retrieve D3D9 device?
Post by: DoorKnobHandle on Tue 09/08/2011 21:48:44
Ah ok, thanks, Calin!

No priority, but a proper event for doing this more elegantly would be kinda cool in the future! :D