From 6ce2472b27211a40e1d78f424f09cf26ba5e3281 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Thu, 14 May 2015 13:22:42 -1000 Subject: [PATCH] refactor of graphic system; initial HECL --- include/graphicsys/CGFXVertexLayoutBase.hpp | 20 +++++ include/graphicsys/IGFXCommandBuffer.hpp | 5 ++ .../IGFXContext.hpp} | 20 ++--- include/graphicsys/IGFXPipelineState.hpp | 5 ++ include/graphicsys/IGFXTransformSet.hpp | 5 ++ include/graphicsys/hecl/CHECLLexer.hpp | 20 +++++ include/graphicsys/hecl/HECLExpressions.hpp | 46 +++++++++++ include/graphicsys/hecl/IHECLBackend.hpp | 76 +++++++++++++++++++ libBoo.pri | 28 +++++-- src/CApplicationXCB.hpp | 1 - .../CGraphicsContextCocoa.mm | 0 .../CGraphicsContextWayland.cpp | 28 +------ .../CGraphicsContextWin32.cpp | 0 .../CGraphicsContextXCB.cpp | 39 +++------- src/graphicsys/hecl/CHECLBackendGLSL.cpp | 32 ++++++++ src/graphicsys/hecl/CHECLBackendHLSL.cpp | 15 ++++ src/graphicsys/hecl/CHECLBackendMetal.cpp | 15 ++++ src/graphicsys/hecl/CHECLBackendOutline.cpp | 16 ++++ src/graphicsys/hecl/CHECLBackendTEV.cpp | 15 ++++ src/graphicsys/hecl/CHECLLexer.cpp | 14 ++++ src/windowsys/CWindowXCB.cpp | 12 +-- 21 files changed, 332 insertions(+), 80 deletions(-) create mode 100644 include/graphicsys/CGFXVertexLayoutBase.hpp create mode 100644 include/graphicsys/IGFXCommandBuffer.hpp rename include/{windowsys/IGraphicsContext.hpp => graphicsys/IGFXContext.hpp} (66%) create mode 100644 include/graphicsys/IGFXPipelineState.hpp create mode 100644 include/graphicsys/IGFXTransformSet.hpp create mode 100644 include/graphicsys/hecl/CHECLLexer.hpp create mode 100644 include/graphicsys/hecl/HECLExpressions.hpp create mode 100644 include/graphicsys/hecl/IHECLBackend.hpp rename src/{windowsys => graphicsys}/CGraphicsContextCocoa.mm (100%) rename src/{windowsys => graphicsys}/CGraphicsContextWayland.cpp (64%) rename src/{windowsys => graphicsys}/CGraphicsContextWin32.cpp (100%) rename src/{windowsys => graphicsys}/CGraphicsContextXCB.cpp (79%) create mode 100644 src/graphicsys/hecl/CHECLBackendGLSL.cpp create mode 100644 src/graphicsys/hecl/CHECLBackendHLSL.cpp create mode 100644 src/graphicsys/hecl/CHECLBackendMetal.cpp create mode 100644 src/graphicsys/hecl/CHECLBackendOutline.cpp create mode 100644 src/graphicsys/hecl/CHECLBackendTEV.cpp create mode 100644 src/graphicsys/hecl/CHECLLexer.cpp diff --git a/include/graphicsys/CGFXVertexLayoutBase.hpp b/include/graphicsys/CGFXVertexLayoutBase.hpp new file mode 100644 index 0000000..a8ff1c4 --- /dev/null +++ b/include/graphicsys/CGFXVertexLayoutBase.hpp @@ -0,0 +1,20 @@ +#ifndef CGFXVERTEXLAYOUTBASE_HPP +#define CGFXVERTEXLAYOUTBASE_HPP + +class CGFXVertexLayoutBase +{ + unsigned m_uvCount; + unsigned m_weightCount; +public: + CGFXVertexLayoutBase(unsigned uvCount=0, unsigned weightCount=0) + : m_uvCount(uvCount), + m_weightCount(weightCount) {} + virtual ~CGFXVertexLayoutBase() {} + + inline unsigned uvCount() {return m_uvCount;} + inline unsigned weightCount() {return m_weightCount;} + inline bool isSkinned() {return m_weightCount > 0;} + +}; + +#endif // CGFXVERTEXLAYOUTBASE_HPP diff --git a/include/graphicsys/IGFXCommandBuffer.hpp b/include/graphicsys/IGFXCommandBuffer.hpp new file mode 100644 index 0000000..fc29bda --- /dev/null +++ b/include/graphicsys/IGFXCommandBuffer.hpp @@ -0,0 +1,5 @@ +#ifndef IGFXCOMMANDBUFFER_HPP +#define IGFXCOMMANDBUFFER_HPP + +#endif // IGFXCOMMANDBUFFER_HPP + diff --git a/include/windowsys/IGraphicsContext.hpp b/include/graphicsys/IGFXContext.hpp similarity index 66% rename from include/windowsys/IGraphicsContext.hpp rename to include/graphicsys/IGFXContext.hpp index d2732fa..94f3804 100644 --- a/include/windowsys/IGraphicsContext.hpp +++ b/include/graphicsys/IGFXContext.hpp @@ -1,13 +1,14 @@ -#ifndef IGRAPHICSCONTEXT_HPP -#define IGRAPHICSCONTEXT_HPP +#ifndef IGFXCONTEXT_HPP +#define IGFXCONTEXT_HPP namespace boo { -class IGraphicsContext +class IGFXContext { friend class CWindowCocoa; - virtual void _setCallback(class IWindowCallback* cb) {(void)cb;}; + friend class CWindowXCB; + virtual void _setCallback(class IWindowCallback* cb) {(void)cb;} public: @@ -33,22 +34,15 @@ public: PF_RGBAF32_Z24 = 4 }; - virtual ~IGraphicsContext() {} + virtual ~IGFXContext() {} virtual EGraphicsAPI getAPI() const=0; virtual EPixelFormat getPixelFormat() const=0; virtual void setPixelFormat(EPixelFormat pf)=0; virtual void initializeContext()=0; - virtual IGraphicsContext* makeShareContext() const=0; - virtual void makeCurrent()=0; - virtual void clearCurrent()=0; - - /* Note: *all* contexts are double-buffered with - * v-sync interval; please call this */ - virtual void swapBuffer()=0; }; } -#endif // IGRAPHICSCONTEXT_HPP +#endif // IGFXCONTEXT_HPP diff --git a/include/graphicsys/IGFXPipelineState.hpp b/include/graphicsys/IGFXPipelineState.hpp new file mode 100644 index 0000000..9792d97 --- /dev/null +++ b/include/graphicsys/IGFXPipelineState.hpp @@ -0,0 +1,5 @@ +#ifndef IGFXPIPELINESTATE_HPP +#define IGFXPIPELINESTATE_HPP + +#endif // IGFXPIPELINESTATE_HPP + diff --git a/include/graphicsys/IGFXTransformSet.hpp b/include/graphicsys/IGFXTransformSet.hpp new file mode 100644 index 0000000..ef66cb5 --- /dev/null +++ b/include/graphicsys/IGFXTransformSet.hpp @@ -0,0 +1,5 @@ +#ifndef IGFXTRANSFORMSET_HPP +#define IGFXTRANSFORMSET_HPP + +#endif // IGFXTRANSFORMSET_HPP + diff --git a/include/graphicsys/hecl/CHECLLexer.hpp b/include/graphicsys/hecl/CHECLLexer.hpp new file mode 100644 index 0000000..9c3b0e7 --- /dev/null +++ b/include/graphicsys/hecl/CHECLLexer.hpp @@ -0,0 +1,20 @@ +#ifndef CHECLLEXER_HPP +#define CHECLLEXER_HPP + +#include +#include "graphicsys/CGFXVertexLayoutBase.hpp" + +class CHECLLexer +{ + const CGFXVertexLayoutBase& m_vertLayout; +public: + CHECLLexer(const CGFXVertexLayoutBase& vertLayout, + const std::string& colorHECL); + CHECLLexer(const CGFXVertexLayoutBase& vertLayout, + const std::string& colorHECL, + const std::string& alphaHECL); + + inline const CGFXVertexLayoutBase& getVertLayout() const {return m_vertLayout;} +}; + +#endif // CHECLLEXER_HPP diff --git a/include/graphicsys/hecl/HECLExpressions.hpp b/include/graphicsys/hecl/HECLExpressions.hpp new file mode 100644 index 0000000..454d0d7 --- /dev/null +++ b/include/graphicsys/hecl/HECLExpressions.hpp @@ -0,0 +1,46 @@ +#ifndef HECLEXPRESSIONS_HPP +#define HECLEXPRESSIONS_HPP + +#include +#include "IHECLBackend.hpp" + +class IHECLExpression +{ + /* Traverse expression tree and assemble + * backend-specific stage objects */ + virtual IHECLBackendStage* recursiveStages(IHECLBackend& backend) const=0; +}; + +class CHECLNumberLiteral final : IHECLExpression +{ +}; + +class CHECLVector final : IHECLExpression +{ +}; + +class CHECLTextureSample final : IHECLExpression +{ +}; + +class CHECLTextureGatherSample final : IHECLExpression +{ +}; + +class CHECLMulOperation final : IHECLExpression +{ +}; + +class CHECLAddOperation final : IHECLExpression +{ +}; + +class CHECLSubOperation final : IHECLExpression +{ +}; + +class CHECLRoot final : IHECLExpression +{ +}; + +#endif // HECLEXPRESSIONS_HPP diff --git a/include/graphicsys/hecl/IHECLBackend.hpp b/include/graphicsys/hecl/IHECLBackend.hpp new file mode 100644 index 0000000..4585adc --- /dev/null +++ b/include/graphicsys/hecl/IHECLBackend.hpp @@ -0,0 +1,76 @@ +#ifndef IHECLBACKEND_HPP +#define IHECLBACKEND_HPP + +#include +#include "CHECLLexer.hpp" + +class IHECLBackend; + +IHECLBackend* NewHECLBackendOutline(const CHECLLexer& lexer); +IHECLBackend* NewHECLBackendGLSL(const CHECLLexer& lexer); +IHECLBackend* NewHECLBackendHLSL(const CHECLLexer& lexer); +IHECLBackend* NewHECLBackendMetal(const CHECLLexer& lexer); +IHECLBackend* NewHECLBackendTEV(const CHECLLexer& lexer); +IHECLBackend* NewHECLBackendGLSLCafe(const CHECLLexer& lexer); + +class IHECLBackend +{ +public: + enum Type + { + AUTO = 0, + OUTLINE = 1, + GLSL = 2, + HLSL = 3, + METAL = 4, + TEV = 5, + GLSL_CAFE = 6 + }; + virtual Type getType() const=0; + + virtual bool hasVertexSourceForm() const {return false;} + virtual bool hasFragmentSourceForm() const {return false;} + virtual bool hasVertexBinaryForm() const {return false;} + virtual bool hasFragmentBinaryForm() const {return false;} + virtual bool hasBinaryForm() const {return false;} + + virtual std::string* emitNewVertexSource() {return NULL;} + virtual std::string* emitNewFragmentSource() {return NULL;} + virtual void* emitNewVertexBinary(size_t& szOut) {szOut = 0;return NULL;} + virtual void* emitNewFragmentBinary(size_t& szOut) {szOut = 0;return NULL;} + virtual void* emitNewBinary(size_t& szOut) {szOut = 0;return NULL;} + + static inline IHECLBackend* NewHECLBackend(Type backendType, const CHECLLexer& lexer) + { + switch (backendType) + { + case AUTO: +#if HW_RVL + return NewHECLBackendTEV(lexer); +#elif HW_CAFE + return NewHECLBackendGLSLCafe(lexer); +#elif _WIN32 + return NewHECLBackendHLSL(lexer); +#else + return NewHECLBackendGLSL(lexer); +#endif + case OUTLINE: + return NewHECLBackendOutline(lexer); + case GLSL: + return NewHECLBackendGLSL(lexer); + case HLSL: + return NewHECLBackendHLSL(lexer); + case METAL: + return NewHECLBackendMetal(lexer); + case TEV: + return NewHECLBackendTEV(lexer); + case GLSL_CAFE: + return NewHECLBackendGLSLCafe(lexer); + } + return NULL; + } + +}; + + +#endif // IHECLBACKEND_HPP diff --git a/libBoo.pri b/libBoo.pri index 102e20f..caf013e 100644 --- a/libBoo.pri +++ b/libBoo.pri @@ -2,7 +2,6 @@ HEADERS += \ $$PWD/include/boo.hpp \ $$PWD/include/IApplication.hpp \ $$PWD/include/windowsys/IWindow.hpp \ - $$PWD/include/windowsys/IGraphicsContext.hpp \ $$PWD/include/inputdev/CDolphinSmashAdapter.hpp \ $$PWD/include/inputdev/CRevolutionPad.hpp \ $$PWD/include/inputdev/CCafeProPad.hpp \ @@ -13,7 +12,18 @@ HEADERS += \ $$PWD/include/inputdev/CDeviceBase.hpp \ $$PWD/include/inputdev/IHIDListener.hpp \ $$PWD/src/inputdev/IHIDDevice.hpp \ - $$PWD/include/inputdev/SDeviceSignature.hpp + $$PWD/include/inputdev/SDeviceSignature.hpp \ + $$PWD/include/windowsys/IGFXCommandBuffer.hpp \ + $$PWD/include/graphicsys/IGFXCommandBuffer.hpp \ + $$PWD/include/graphicsys/IGFXContext.hpp \ + $$PWD/include/graphicsys/IGFXPipelineState.hpp \ + $$PWD/include/graphicsys/IGFXTransformSet.hpp \ + $$PWD/include/graphicsys/hecl/CHECLLexer.hpp \ + $$PWD/src/graphicsys/hecl/IHECLBackend.hpp \ + $$PWD/src/graphicsys/hecl/HECLExpressions.hpp \ + $$PWD/include/graphicsys/CGFXVertexLayoutBase.hpp \ + $$PWD/include/graphicsys/hecl/HECLExpressions.hpp \ + $$PWD/include/graphicsys/hecl/IHECLBackend.hpp SOURCES += \ $$PWD/InputDeviceClasses.cpp \ @@ -23,7 +33,13 @@ SOURCES += \ $$PWD/src/inputdev/CDualshockPad.cpp \ $$PWD/src/inputdev/CGenericPad.cpp \ $$PWD/src/inputdev/CDeviceBase.cpp \ - $$PWD/src/inputdev/SDeviceSignature.cpp + $$PWD/src/inputdev/SDeviceSignature.cpp \ + $$PWD/src/graphicsys/hecl/CHECLBackendGLSL.cpp \ + $$PWD/src/graphicsys/hecl/CHECLBackendHLSL.cpp \ + $$PWD/src/graphicsys/hecl/CHECLBackendMetal.cpp \ + $$PWD/src/graphicsys/hecl/CHECLLexer.cpp \ + $$PWD/src/graphicsys/hecl/CHECLBackendOutline.cpp \ + $$PWD/src/graphicsys/hecl/CHECLBackendTEV.cpp unix:!macx { HEADERS += \ @@ -33,8 +49,8 @@ unix:!macx { $$PWD/src/CApplicationUnix.cpp \ $$PWD/src/windowsys/CWindowXCB.cpp \ $$PWD/src/windowsys/CWindowWayland.cpp \ - $$PWD/src/windowsys/CGraphicsContextXCB.cpp \ - $$PWD/src/windowsys/CGraphicsContextWayland.cpp + $$PWD/src/graphicsys/CGraphicsContextXCB.cpp \ + $$PWD/src/graphicsys/CGraphicsContextWayland.cpp } linux { @@ -61,7 +77,7 @@ win32 { $$PWD/src/inputdev/CHIDListenerWinUSB.cpp \ $$PWD/src/inputdev/CHIDDeviceWinUSB.cpp \ $$PWD/src/windowsys/CWindowWin32.cpp \ - $$PWD/src/windowsys/CGraphicsContextWin32.cpp + $$PWD/src/graphicsys/CGraphicsContextWin32.cpp } INCLUDEPATH += $$PWD/include diff --git a/src/CApplicationXCB.hpp b/src/CApplicationXCB.hpp index 72c4534..38a0363 100644 --- a/src/CApplicationXCB.hpp +++ b/src/CApplicationXCB.hpp @@ -274,7 +274,6 @@ public: dbus_connection_read_write(m_dbus, 0); while ((msg = dbus_connection_pop_message(m_dbus))) { - /* check if the message is a signal from the correct interface and with the correct name */ if (dbus_message_is_signal(msg, "boo.signal.FileHandling", "Open")) { diff --git a/src/windowsys/CGraphicsContextCocoa.mm b/src/graphicsys/CGraphicsContextCocoa.mm similarity index 100% rename from src/windowsys/CGraphicsContextCocoa.mm rename to src/graphicsys/CGraphicsContextCocoa.mm diff --git a/src/windowsys/CGraphicsContextWayland.cpp b/src/graphicsys/CGraphicsContextWayland.cpp similarity index 64% rename from src/windowsys/CGraphicsContextWayland.cpp rename to src/graphicsys/CGraphicsContextWayland.cpp index 65b9b60..056faea 100644 --- a/src/windowsys/CGraphicsContextWayland.cpp +++ b/src/graphicsys/CGraphicsContextWayland.cpp @@ -1,10 +1,10 @@ -#include "windowsys/IGraphicsContext.hpp" +#include "graphicsys/IGFXContext.hpp" #include "windowsys/IWindow.hpp" namespace boo { -class CGraphicsContextWayland final : public IGraphicsContext +class CGraphicsContextWayland final : public IGFXContext { EGraphicsAPI m_api; @@ -52,30 +52,10 @@ public: } - IGraphicsContext* makeShareContext() const - { - return NULL; - } - - void makeCurrent() - { - - } - - void clearCurrent() - { - - } - - void swapBuffer() - { - - } - }; -IGraphicsContext* _CGraphicsContextWaylandNew(IGraphicsContext::EGraphicsAPI api, - IWindow* parentWindow) +IGFXContext* _CGraphicsContextWaylandNew(IGFXContext::EGraphicsAPI api, + IWindow* parentWindow) { return new CGraphicsContextWayland(api, parentWindow); } diff --git a/src/windowsys/CGraphicsContextWin32.cpp b/src/graphicsys/CGraphicsContextWin32.cpp similarity index 100% rename from src/windowsys/CGraphicsContextWin32.cpp rename to src/graphicsys/CGraphicsContextWin32.cpp diff --git a/src/windowsys/CGraphicsContextXCB.cpp b/src/graphicsys/CGraphicsContextXCB.cpp similarity index 79% rename from src/windowsys/CGraphicsContextXCB.cpp rename to src/graphicsys/CGraphicsContextXCB.cpp index d110991..f18b75f 100644 --- a/src/windowsys/CGraphicsContextXCB.cpp +++ b/src/graphicsys/CGraphicsContextXCB.cpp @@ -1,4 +1,4 @@ -#include "windowsys/IGraphicsContext.hpp" +#include "graphicsys/IGFXContext.hpp" #include "windowsys/IWindow.hpp" #include @@ -7,11 +7,12 @@ #include #include #include +#include namespace boo { -class CGraphicsContextXCB final : public IGraphicsContext +class CGraphicsContextXCB final : public IGFXContext { EGraphicsAPI m_api; @@ -24,6 +25,8 @@ class CGraphicsContextXCB final : public IGraphicsContext xcb_glx_window_t m_glxWindow = 0; xcb_glx_context_t m_glxCtx = 0; xcb_glx_context_tag_t m_glxCtxTag = 0; + + std::thread* m_commandThread = NULL; public: IWindowCallback* m_callback; @@ -34,6 +37,7 @@ public: m_parentWindow(parentWindow), m_xcbConn(conn) { + /* WTF freedesktop?? Fix this awful API and your nonexistant docs */ xcb_glx_get_fb_configs_reply_t* fbconfigs = xcb_glx_get_fb_configs_reply(m_xcbConn, xcb_glx_get_fb_configs(m_xcbConn, 0), NULL); @@ -137,36 +141,11 @@ public: m_glxWindow, 0, NULL); } - IGraphicsContext* makeShareContext() const - { - return NULL; - } - - void makeCurrent() - { - xcb_glx_make_context_current_reply_t* reply = - xcb_glx_make_context_current_reply(m_xcbConn, - xcb_glx_make_context_current(m_xcbConn, 0, m_glxWindow, m_glxWindow, m_glxCtx), NULL); - m_glxCtxTag = reply->context_tag; - free(reply); - } - - void clearCurrent() - { - xcb_glx_make_context_current(m_xcbConn, m_glxCtxTag, m_glxWindow, m_glxWindow, 0); - m_glxCtxTag = 0; - } - - void swapBuffer() - { - xcb_glx_swap_buffers(m_xcbConn, m_glxCtxTag, m_glxWindow); - } - }; -IGraphicsContext* _CGraphicsContextXCBNew(IGraphicsContext::EGraphicsAPI api, - IWindow* parentWindow, xcb_connection_t* conn, - uint32_t& visualIdOut) +IGFXContext* _CGraphicsContextXCBNew(IGFXContext::EGraphicsAPI api, + IWindow* parentWindow, xcb_connection_t* conn, + uint32_t& visualIdOut) { return new CGraphicsContextXCB(api, parentWindow, conn, visualIdOut); } diff --git a/src/graphicsys/hecl/CHECLBackendGLSL.cpp b/src/graphicsys/hecl/CHECLBackendGLSL.cpp new file mode 100644 index 0000000..a3ce619 --- /dev/null +++ b/src/graphicsys/hecl/CHECLBackendGLSL.cpp @@ -0,0 +1,32 @@ +#include "graphicsys/hecl/IHECLBackend.hpp" + +class CHECLBackendGLSL : public IHECLBackend +{ +public: + CHECLBackendGLSL(const CHECLLexer& lexer) + { + } + Type getType() const {return GLSL;} +}; + +IHECLBackend* NewHECLBackendGLSL(const CHECLLexer& lexer) +{ + return new CHECLBackendGLSL(lexer); +} + + +class CHECLBackendGLSLCafe final : public CHECLBackendGLSL +{ +public: + CHECLBackendGLSLCafe(const CHECLLexer& lexer) + : CHECLBackendGLSL(lexer) + { + } + Type getType() const {return GLSL_CAFE;} +}; + +IHECLBackend* NewHECLBackendGLSLCafe(const CHECLLexer& lexer) +{ + return new CHECLBackendGLSLCafe(lexer); +} + diff --git a/src/graphicsys/hecl/CHECLBackendHLSL.cpp b/src/graphicsys/hecl/CHECLBackendHLSL.cpp new file mode 100644 index 0000000..14c9a4b --- /dev/null +++ b/src/graphicsys/hecl/CHECLBackendHLSL.cpp @@ -0,0 +1,15 @@ +#include "graphicsys/hecl/IHECLBackend.hpp" + +class CHECLBackendHLSL final : public IHECLBackend +{ +public: + CHECLBackendHLSL(const CHECLLexer& lexer) + { + } + Type getType() const {return HLSL;} +}; + +IHECLBackend* NewHECLBackendHLSL(const CHECLLexer& lexer) +{ + return new CHECLBackendHLSL(lexer); +} diff --git a/src/graphicsys/hecl/CHECLBackendMetal.cpp b/src/graphicsys/hecl/CHECLBackendMetal.cpp new file mode 100644 index 0000000..cf69b17 --- /dev/null +++ b/src/graphicsys/hecl/CHECLBackendMetal.cpp @@ -0,0 +1,15 @@ +#include "graphicsys/hecl/IHECLBackend.hpp" + +class CHECLBackendMetal final : public IHECLBackend +{ +public: + CHECLBackendMetal(const CHECLLexer& lexer) + { + } + Type getType() const {return METAL;} +}; + +IHECLBackend* NewHECLBackendMetal(const CHECLLexer& lexer) +{ + return new CHECLBackendMetal(lexer); +} diff --git a/src/graphicsys/hecl/CHECLBackendOutline.cpp b/src/graphicsys/hecl/CHECLBackendOutline.cpp new file mode 100644 index 0000000..ac6536b --- /dev/null +++ b/src/graphicsys/hecl/CHECLBackendOutline.cpp @@ -0,0 +1,16 @@ +#include "graphicsys/hecl/IHECLBackend.hpp" + +class CHECLBackendOutline final : public IHECLBackend +{ +public: + CHECLBackendOutline(const CHECLLexer& lexer) + { + } + Type getType() const {return OUTLINE;} +}; + +IHECLBackend* NewHECLBackendOutline(const CHECLLexer& lexer) +{ + return new CHECLBackendOutline(lexer); +} + diff --git a/src/graphicsys/hecl/CHECLBackendTEV.cpp b/src/graphicsys/hecl/CHECLBackendTEV.cpp new file mode 100644 index 0000000..f4565df --- /dev/null +++ b/src/graphicsys/hecl/CHECLBackendTEV.cpp @@ -0,0 +1,15 @@ +#include "graphicsys/hecl/IHECLBackend.hpp" + +class CHECLBackendTEV final : public IHECLBackend +{ +public: + CHECLBackendTEV(const CHECLLexer& lexer) + { + } + Type getType() const {return TEV;} +}; + +IHECLBackend* NewHECLBackendTEV(const CHECLLexer& lexer) +{ + return new CHECLBackendTEV(lexer); +} diff --git a/src/graphicsys/hecl/CHECLLexer.cpp b/src/graphicsys/hecl/CHECLLexer.cpp new file mode 100644 index 0000000..56ba45b --- /dev/null +++ b/src/graphicsys/hecl/CHECLLexer.cpp @@ -0,0 +1,14 @@ +#include "graphicsys/hecl/CHECLLexer.hpp" + +CHECLLexer::CHECLLexer(const CGFXVertexLayoutBase& vertLayout, + const std::string& colorHECL) +: m_vertLayout(vertLayout) +{ +} + +CHECLLexer::CHECLLexer(const CGFXVertexLayoutBase& vertLayout, + const std::string& colorHECL, + const std::string& alphaHECL) +: m_vertLayout(vertLayout) +{ +} diff --git a/src/windowsys/CWindowXCB.cpp b/src/windowsys/CWindowXCB.cpp index 2be7629..9507c9d 100644 --- a/src/windowsys/CWindowXCB.cpp +++ b/src/windowsys/CWindowXCB.cpp @@ -1,5 +1,5 @@ #include "windowsys/IWindow.hpp" -#include "windowsys/IGraphicsContext.hpp" +#include "graphicsys/IGFXContext.hpp" #include "IApplication.hpp" #include @@ -145,15 +145,15 @@ static void genFrameDefault(xcb_screen_t* screen, int* xOut, int* yOut, int* wOu *hOut = height; } -IGraphicsContext* _CGraphicsContextXCBNew(IGraphicsContext::EGraphicsAPI api, - IWindow* parentWindow, xcb_connection_t* conn, - uint32_t& visualIdOut); +IGFXContext* _CGraphicsContextXCBNew(IGFXContext::EGraphicsAPI api, + IWindow* parentWindow, xcb_connection_t* conn, + uint32_t& visualIdOut); class CWindowXCB final : public IWindow { xcb_connection_t* m_xcbConn; xcb_window_t m_windowId; - IGraphicsContext* m_gfxCtx; + IGFXContext* m_gfxCtx; IWindowCallback* m_callback; /* Last known input device id (0xffff if not yet set) */ @@ -184,7 +184,7 @@ public: /* Construct graphics context */ uint32_t visualId; - m_gfxCtx = _CGraphicsContextXCBNew(IGraphicsContext::API_OPENGL_3_3, this, m_xcbConn, visualId); + m_gfxCtx = _CGraphicsContextXCBNew(IGFXContext::API_OPENGL_3_3, this, m_xcbConn, visualId); /* Create colormap */ xcb_colormap_t colormap = xcb_generate_id(m_xcbConn);