boo/lib/x11/GraphicsContextWayland.cpp

64 lines
1.1 KiB
C++
Raw Normal View History

2015-08-18 22:43:30 +00:00
#include "boo/IGraphicsContext.hpp"
#include "boo/IWindow.hpp"
2015-05-06 00:50:57 +00:00
namespace boo
{
2015-08-18 19:40:26 +00:00
struct GraphicsContextWayland : IGraphicsContext
2015-05-06 00:50:57 +00:00
{
EGraphicsAPI m_api;
EPixelFormat m_pf;
IWindow* m_parentWindow;
public:
IWindowCallback* m_callback;
2015-08-18 19:40:26 +00:00
GraphicsContextWayland(EGraphicsAPI api, IWindow* parentWindow)
2015-05-06 00:50:57 +00:00
: m_api(api),
m_pf(PF_RGBA8),
m_parentWindow(parentWindow)
{}
2015-08-18 19:40:26 +00:00
~GraphicsContextWayland()
2015-05-06 00:50:57 +00:00
{
}
void _setCallback(IWindowCallback* cb)
{
m_callback = cb;
}
EGraphicsAPI getAPI() const
{
return m_api;
}
EPixelFormat getPixelFormat() const
{
return m_pf;
}
void setPixelFormat(EPixelFormat pf)
{
if (pf > PF_RGBAF32_Z24)
return;
m_pf = pf;
}
void initializeContext()
{
}
};
2015-08-18 19:40:26 +00:00
IGraphicsContext* _GraphicsContextWaylandNew(IGraphicsContext::EGraphicsAPI api,
IWindow* parentWindow)
2015-05-06 00:50:57 +00:00
{
2015-08-18 19:40:26 +00:00
return new GraphicsContextWayland(api, parentWindow);
2015-05-06 00:50:57 +00:00
}
}