//********************************** Banshee Engine (www.banshee3d.com) **************************************************// //**************** Copyright (c) 2016 Marko Pintera (marko.pintera@gmail.com). All rights reserved. **********************// #pragma once #include "BsD3D9Prerequisites.h" namespace BansheeEngine { /** @addtogroup D3D9 * @{ */ /** Provides an interface for dealing with DX9 resources. Primarily notifying the resources of any changed states. */ class BS_D3D9_EXPORT D3D9Resource { public: D3D9Resource(); virtual ~D3D9Resource(); /** Called immediately after the Direct3D device has been created. */ virtual void notifyOnDeviceCreate(IDirect3DDevice9* d3d9Device) {} /** Called before the Direct3D device is going to be destroyed. */ virtual void notifyOnDeviceDestroy(IDirect3DDevice9* d3d9Device) {} /** Called immediately after the Direct3D device has entered a lost state. */ virtual void notifyOnDeviceLost(IDirect3DDevice9* d3d9Device) {} /** Called immediately after the Direct3D device has been reset. */ virtual void notifyOnDeviceReset(IDirect3DDevice9* d3d9Device) {} /** * Called when device state is changing. Access to any device should be locked. Relevant for multi thread * application. */ static void lockDeviceAccess(); /** * Called when device state change completed. Access to any device is allowed. Relevant for multi thread * application. */ static void unlockDeviceAccess(); protected: static Mutex msDeviceAccessMutex; }; /** @} */ }