mirror of
https://github.com/borgesdan/xn65
synced 2024-12-29 21:54:47 +01:00
Implementações em GraphicsResource
This commit is contained in:
parent
0065bf80e9
commit
da0a300999
@ -41,7 +41,7 @@ add_library (Xn65 STATIC
|
||||
"platform-dx/displaymode.cpp"
|
||||
"platform-dx/init.cpp"
|
||||
"platform-dx/buffer.cpp"
|
||||
"platform-dx/audioengine.cpp" )
|
||||
"platform-dx/audioengine.cpp" "graphics/gresource.cpp")
|
||||
|
||||
if (CMAKE_VERSION VERSION_GREATER 3.12)
|
||||
set_property(TARGET Xn65 PROPERTY CXX_STANDARD 20)
|
||||
|
18
framework/graphics/gresource.cpp
Normal file
18
framework/graphics/gresource.cpp
Normal file
@ -0,0 +1,18 @@
|
||||
#include "xna/graphics/gresource.hpp"
|
||||
|
||||
namespace xna {
|
||||
GraphicsResource::GraphicsResource(sptr<GraphicsDevice> const& device) : m_device(device) {}
|
||||
|
||||
sptr<GraphicsDevice> GraphicsResource::Device() const {
|
||||
return m_device;
|
||||
}
|
||||
|
||||
bool GraphicsResource::Bind(sptr<GraphicsDevice> const& device) {
|
||||
if (!device || device == m_device)
|
||||
return false;
|
||||
|
||||
m_device = device;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
@ -4,20 +4,17 @@
|
||||
#include "../default.hpp"
|
||||
|
||||
namespace xna {
|
||||
//Queries and prepares resources.
|
||||
class GraphicsResource {
|
||||
public:
|
||||
GraphicsResource(sptr<GraphicsDevice> const& device) : m_device(device){}
|
||||
GraphicsResource(sptr<GraphicsDevice> const& device);
|
||||
|
||||
virtual ~GraphicsResource(){}
|
||||
|
||||
virtual bool Bind(sptr<GraphicsDevice> const& device) {
|
||||
if (!device || device == m_device)
|
||||
return false;
|
||||
virtual bool Bind(sptr<GraphicsDevice> const& device);
|
||||
|
||||
m_device = device;
|
||||
|
||||
return true;
|
||||
}
|
||||
//Gets the GraphicsDevice associated with this GraphicsResource.
|
||||
sptr<xna::GraphicsDevice> Device() const;
|
||||
|
||||
protected:
|
||||
sptr<GraphicsDevice> m_device = nullptr;
|
||||
|
Loading…
x
Reference in New Issue
Block a user