2016-12-24 17:36:27 +00:00
|
|
|
#pragma once
|
2017-01-01 14:59:54 +00:00
|
|
|
#include "ObjectHandle.h"
|
2016-12-25 15:19:03 +00:00
|
|
|
#include "Parameter.h"
|
2016-12-24 17:36:27 +00:00
|
|
|
|
2016-12-29 10:51:38 +00:00
|
|
|
#include "Context.h"
|
|
|
|
|
2016-12-24 17:36:27 +00:00
|
|
|
namespace graphics {
|
|
|
|
|
|
|
|
class ContextImpl
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~ContextImpl() {}
|
|
|
|
virtual void init() = 0;
|
|
|
|
virtual void destroy() = 0;
|
2017-01-10 15:22:32 +00:00
|
|
|
virtual void enable(Parameter _parameter, bool _enable) = 0;
|
|
|
|
virtual void cullFace(Parameter _mode) = 0;
|
|
|
|
virtual void enableDepthWrite(bool _enable) = 0;
|
|
|
|
virtual void setDepthCompare(Parameter _mode) = 0;
|
|
|
|
virtual void setViewport(s32 _x, s32 _y, s32 _width, s32 _height) = 0;
|
|
|
|
virtual void setScissor(s32 _x, s32 _y, s32 _width, s32 _height) = 0;
|
|
|
|
virtual void setBlending(Parameter _sfactor, Parameter _dfactor) = 0;
|
|
|
|
virtual void setBlendColor(f32 _red, f32 _green, f32 _blue, f32 _alpha) = 0;
|
2017-01-11 10:07:20 +00:00
|
|
|
virtual void clearColorBuffer(f32 _red, f32 _green, f32 _blue, f32 _alpha) = 0;
|
|
|
|
virtual void clearDepthBuffer() = 0;
|
2017-01-14 14:24:48 +00:00
|
|
|
virtual void setPolygonOffset(f32 _factor, f32 _units) = 0;
|
2017-01-01 14:59:54 +00:00
|
|
|
virtual ObjectHandle createTexture(Parameter _target) = 0;
|
|
|
|
virtual void deleteTexture(ObjectHandle _name) = 0;
|
2016-12-29 10:51:38 +00:00
|
|
|
virtual void init2DTexture(const Context::InitTextureParams & _params) = 0;
|
2017-01-06 07:33:49 +00:00
|
|
|
virtual void update2DTexture(const Context::UpdateTextureDataParams & _params) = 0;
|
2017-01-01 14:59:54 +00:00
|
|
|
virtual void setTextureParameters(const Context::TexParameters & _parameters) = 0;
|
2017-01-22 11:10:52 +00:00
|
|
|
virtual void bindTexture(const Context::BindTextureParameters & _params) = 0;
|
|
|
|
virtual void setTextureUnpackAlignment(s32 _param) = 0;
|
|
|
|
virtual s32 getTextureUnpackAlignment() const = 0;
|
2017-01-22 13:43:05 +00:00
|
|
|
virtual s32 getMaxTextureSize() const = 0;
|
2017-01-21 11:44:56 +00:00
|
|
|
virtual void bindImageTexture(const Context::BindImageTextureParameters & _params) = 0;
|
2017-01-16 13:55:57 +00:00
|
|
|
virtual FramebufferTextureFormats * getFramebufferTextureFormats() = 0;
|
2017-01-02 14:00:49 +00:00
|
|
|
virtual ObjectHandle createFramebuffer() = 0;
|
|
|
|
virtual void deleteFramebuffer(ObjectHandle _name) = 0;
|
2017-01-15 07:57:25 +00:00
|
|
|
virtual void bindFramebuffer(Parameter _target, ObjectHandle _name) = 0;
|
2017-01-02 14:00:49 +00:00
|
|
|
virtual void addFrameBufferRenderTarget(const Context::FrameBufferRenderTarget & _params) = 0;
|
2017-01-02 15:40:41 +00:00
|
|
|
virtual ObjectHandle createRenderbuffer() = 0;
|
|
|
|
virtual void initRenderbuffer(const Context::InitRenderbufferParams & _params) = 0;
|
2017-01-14 10:08:02 +00:00
|
|
|
virtual bool blitFramebuffers(const Context::BlitFramebuffersParams & _params) = 0;
|
2017-01-06 07:33:49 +00:00
|
|
|
virtual PixelWriteBuffer * createPixelWriteBuffer(size_t _sizeInBytes) = 0;
|
2017-01-03 14:57:46 +00:00
|
|
|
virtual CombinerProgram * createCombinerProgram(Combiner & _color, Combiner & _alpha, const CombinerKey & _key) = 0;
|
2017-01-07 15:46:51 +00:00
|
|
|
virtual bool saveShadersStorage(const Combiners & _combiners) = 0;
|
|
|
|
virtual bool loadShadersStorage(Combiners & _combiners) = 0;
|
2017-01-06 07:33:49 +00:00
|
|
|
virtual ShaderProgram * createDepthFogShader() = 0;
|
|
|
|
virtual ShaderProgram * createMonochromeShader() = 0;
|
2017-01-08 13:23:38 +00:00
|
|
|
virtual TexDrawerShaderProgram * createTexDrawerDrawShader() = 0;
|
|
|
|
virtual ShaderProgram * createTexDrawerClearShader() = 0;
|
|
|
|
virtual ShaderProgram * createTexrectCopyShader() = 0;
|
2017-01-18 15:39:10 +00:00
|
|
|
virtual ShaderProgram * createGammaCorrectionShader() = 0;
|
|
|
|
virtual ShaderProgram * createOrientationCorrectionShader() = 0;
|
|
|
|
virtual void resetShaderProgram() = 0;
|
2017-01-12 15:22:53 +00:00
|
|
|
virtual void drawTriangles(const Context::DrawTriangleParameters & _params) = 0;
|
|
|
|
virtual void drawRects(const Context::DrawRectParameters & _params) = 0;
|
|
|
|
virtual void drawLine(f32 _width, SPVertex * _vertices) = 0;
|
2017-01-11 10:07:20 +00:00
|
|
|
virtual f32 getMaxLineWidth() = 0;
|
2017-01-12 15:22:53 +00:00
|
|
|
virtual void drawText(const char *_pText, float _x, float _y) = 0;
|
|
|
|
virtual void getTextSize(const char *_pText, float & _w, float & _h) = 0;
|
2017-01-17 14:39:52 +00:00
|
|
|
virtual bool isSupported(SpecialFeatures _feature) const = 0;
|
2017-01-22 13:43:05 +00:00
|
|
|
virtual bool isError() const = 0;
|
|
|
|
virtual bool isFramebufferError() const = 0;
|
2016-12-24 17:36:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|