2024-04-25 09:43:21 -03:00
|
|
|
#ifndef XNA_GRAPHICS_GRESOURCE_HPP
|
|
|
|
#define XNA_GRAPHICS_GRESOURCE_HPP
|
|
|
|
|
|
|
|
#include "../default.hpp"
|
|
|
|
|
|
|
|
namespace xna {
|
|
|
|
class GraphicsResource {
|
|
|
|
public:
|
2024-05-06 15:57:09 -03:00
|
|
|
GraphicsResource(sptr<GraphicsDevice> const& device) : m_device(device){}
|
2024-04-25 09:43:21 -03:00
|
|
|
|
|
|
|
virtual ~GraphicsResource(){}
|
|
|
|
|
2024-05-06 15:57:09 -03:00
|
|
|
virtual bool Bind(sptr<GraphicsDevice> const& device) {
|
2024-05-22 10:56:16 -03:00
|
|
|
if (!device || device == m_device)
|
2024-04-25 09:43:21 -03:00
|
|
|
return false;
|
|
|
|
|
|
|
|
m_device = device;
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected:
|
2024-05-06 15:57:09 -03:00
|
|
|
sptr<GraphicsDevice> m_device = nullptr;
|
2024-04-25 09:43:21 -03:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|