boo/include/boo/IGraphicsContext.hpp

65 lines
1.5 KiB
C++
Raw Normal View History

#ifndef IGFXCONTEXT_HPP
#define IGFXCONTEXT_HPP
#include <memory>
2017-12-28 23:54:26 -08:00
#include <cstdint>
namespace boo
{
struct IGraphicsCommandQueue;
struct IGraphicsDataFactory;
2015-08-18 12:40:26 -07:00
class IGraphicsContext
{
2015-09-02 12:09:13 -07:00
friend class WindowCocoa;
friend class WindowXCB;
virtual void _setCallback(class IWindowCallback* cb) {(void)cb;}
public:
2015-11-20 17:12:22 -08:00
enum class EGraphicsAPI
{
2015-11-20 17:12:22 -08:00
None = 0,
OpenGL3_3 = 1,
OpenGL4_2 = 2,
2016-08-04 20:19:32 -07:00
Vulkan = 3,
D3D11 = 4,
Metal = 6,
GX = 7,
GX2 = 8
};
2015-11-20 17:12:22 -08:00
enum class EPixelFormat
{
2015-11-20 17:12:22 -08:00
None = 0,
RGBA8 = 1, /* Default */
2018-01-15 22:29:43 -08:00
RGBA16 = 2,
RGBA8_Z24 = 3,
RGBAF32 = 4,
RGBAF32_Z24 = 5
};
2015-08-18 12:40:26 -07:00
virtual ~IGraphicsContext() {}
virtual EGraphicsAPI getAPI() const=0;
virtual EPixelFormat getPixelFormat() const=0;
virtual void setPixelFormat(EPixelFormat pf)=0;
2016-07-20 10:14:18 -07:00
virtual bool initializeContext(void* handle)=0;
2015-10-27 18:47:55 -07:00
virtual void makeCurrent()=0;
virtual void postInit()=0;
virtual void present()=0;
2015-10-27 18:47:55 -07:00
2015-10-29 17:00:56 -07:00
virtual IGraphicsCommandQueue* getCommandQueue()=0;
virtual IGraphicsDataFactory* getDataFactory()=0;
2015-11-16 22:41:32 -08:00
/* Creates a new context on current thread!! Call from main client thread */
virtual IGraphicsDataFactory* getMainContextDataFactory()=0;
2015-10-29 17:00:56 -07:00
/* Creates a new context on current thread!! Call from client loading thread */
virtual IGraphicsDataFactory* getLoadContextDataFactory()=0;
};
}
#endif // IGFXCONTEXT_HPP