boo/include/boo/IGraphicsContext.hpp

66 lines
1.5 KiB
C++
Raw Normal View History

#ifndef IGFXCONTEXT_HPP
#define IGFXCONTEXT_HPP
#include <memory>
#include <stdint.h>
namespace boo
{
struct IGraphicsCommandQueue;
struct IGraphicsDataFactory;
2015-08-18 19:40:26 +00:00
class IGraphicsContext
{
2015-09-02 19:09:13 +00:00
friend class WindowCocoa;
friend class WindowXCB;
virtual void _setCallback(class IWindowCallback* cb) {(void)cb;}
public:
2015-11-21 01:12:22 +00:00
enum class EGraphicsAPI
{
2015-11-21 01:12:22 +00:00
None = 0,
OpenGL3_3 = 1,
OpenGL4_2 = 2,
OpenGLES3 = 3,
Vulkan = 4,
D3D11 = 5,
D3D12 = 6,
Metal = 7,
GX = 8,
GX2 = 9
};
2015-11-21 01:12:22 +00:00
enum class EPixelFormat
{
2015-11-21 01:12:22 +00:00
None = 0,
RGBA8 = 1, /* Default */
RGBA8_Z24 = 2,
RGBAF32 = 3,
RGBAF32_Z24 = 4
};
2015-08-18 19:40:26 +00:00
virtual ~IGraphicsContext() {}
virtual EGraphicsAPI getAPI() const=0;
virtual EPixelFormat getPixelFormat() const=0;
virtual void setPixelFormat(EPixelFormat pf)=0;
virtual void initializeContext()=0;
2015-10-28 01:47:55 +00:00
virtual void makeCurrent()=0;
virtual void postInit()=0;
virtual void present()=0;
2015-10-28 01:47:55 +00:00
2015-10-30 00:00:56 +00:00
virtual IGraphicsCommandQueue* getCommandQueue()=0;
virtual IGraphicsDataFactory* getDataFactory()=0;
2015-11-17 06:41:32 +00:00
/* Creates a new context on current thread!! Call from main client thread */
virtual IGraphicsDataFactory* getMainContextDataFactory()=0;
2015-10-30 00:00:56 +00:00
/* Creates a new context on current thread!! Call from client loading thread */
virtual IGraphicsDataFactory* getLoadContextDataFactory()=0;
};
}
#endif // IGFXCONTEXT_HPP