2015-05-14 23:22:42 +00:00
|
|
|
#ifndef IGFXCONTEXT_HPP
|
|
|
|
#define IGFXCONTEXT_HPP
|
2015-05-04 23:37:28 +00:00
|
|
|
|
2015-10-29 04:44:38 +00:00
|
|
|
#include <memory>
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2015-05-04 23:37:28 +00:00
|
|
|
namespace boo
|
|
|
|
{
|
2015-10-29 04:44:38 +00:00
|
|
|
struct IGraphicsCommandQueue;
|
|
|
|
struct IGraphicsDataFactory;
|
2015-05-04 23:37:28 +00:00
|
|
|
|
2015-08-18 19:40:26 +00:00
|
|
|
class IGraphicsContext
|
2015-05-04 23:37:28 +00:00
|
|
|
{
|
2015-09-02 19:09:13 +00:00
|
|
|
friend class WindowCocoa;
|
|
|
|
friend class WindowXCB;
|
2015-05-14 23:22:42 +00:00
|
|
|
virtual void _setCallback(class IWindowCallback* cb) {(void)cb;}
|
2015-05-05 07:16:06 +00:00
|
|
|
|
2015-05-04 23:37:28 +00:00
|
|
|
public:
|
|
|
|
|
2015-11-21 01:12:22 +00:00
|
|
|
enum class EGraphicsAPI
|
2015-05-04 23:37:28 +00:00
|
|
|
{
|
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-05-04 23:37:28 +00:00
|
|
|
};
|
|
|
|
|
2015-11-21 01:12:22 +00:00
|
|
|
enum class EPixelFormat
|
2015-05-04 23:37:28 +00:00
|
|
|
{
|
2015-11-21 01:12:22 +00:00
|
|
|
None = 0,
|
|
|
|
RGBA8 = 1, /* Default */
|
|
|
|
RGBA8_Z24 = 2,
|
|
|
|
RGBAF32 = 3,
|
|
|
|
RGBAF32_Z24 = 4
|
2015-05-04 23:37:28 +00:00
|
|
|
};
|
|
|
|
|
2015-08-18 19:40:26 +00:00
|
|
|
virtual ~IGraphicsContext() {}
|
2015-05-04 23:37:28 +00:00
|
|
|
|
|
|
|
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;
|
2015-10-31 04:28:21 +00:00
|
|
|
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;
|
2015-05-04 23:37:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2015-05-14 23:22:42 +00:00
|
|
|
#endif // IGFXCONTEXT_HPP
|