2024-06-06 14:47:39 -03:00
|
|
|
#include "xna/graphics/gresource.hpp"
|
|
|
|
|
|
|
|
namespace xna {
|
2024-11-14 21:44:46 -03:00
|
|
|
GraphicsResource::GraphicsResource(sptr<GraphicsDevice> const& device) : BaseGraphicsDevice(device) {}
|
2024-06-06 14:47:39 -03:00
|
|
|
|
|
|
|
sptr<GraphicsDevice> GraphicsResource::Device() const {
|
2024-11-14 21:44:46 -03:00
|
|
|
return BaseGraphicsDevice;
|
2024-06-06 14:47:39 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
bool GraphicsResource::Bind(sptr<GraphicsDevice> const& device) {
|
2024-11-14 21:44:46 -03:00
|
|
|
if (!device || device == BaseGraphicsDevice)
|
2024-06-06 14:47:39 -03:00
|
|
|
return false;
|
|
|
|
|
2024-11-14 21:44:46 -03:00
|
|
|
BaseGraphicsDevice = device;
|
2024-06-06 14:47:39 -03:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|