/////////////////////////////////////////////////////////////////////////////// // Copyright (C) 2002-2025, Open Design Alliance (the "Alliance"). // All rights reserved. // // This software and its documentation and related materials are owned by // the Alliance. The software may only be incorporated into application // programs owned by members of the Alliance, subject to a signed // Membership Agreement and Supplemental Software License Agreement with the // Alliance. The structure and organization of this software are the valuable // trade secrets of the Alliance and its suppliers. The software is also // protected by copyright law and international treaty provisions. Application // programs incorporating this software must include the following statement // with their copyright notices: // // This application incorporates Open Design Alliance software pursuant to a license // agreement with Open Design Alliance. // Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance. // All rights reserved. // // By use of this software, its documentation or related materials, you // acknowledge and accept the above terms. /////////////////////////////////////////////////////////////////////////////// // GLES2 device local context #ifndef ODTRGL2LOCALCONTEXT #define ODTRGL2LOCALCONTEXT #include "TD_PackPush.h" #include "../TrRndLocalContext.h" #include "GLES2Include.h" #include "../TrRenderExport.h" /** \details */ #define GLFunction0(t,a) virtual t no##a() const override; #define GLFunction1(t,a,b) virtual t no##a(b) const override; #define GLFunction2(t,a,b,c) virtual t no##a(b,c) const override; #define GLFunction3(t,a,b,c,d) virtual t no##a(b,c,d) const override; #define GLFunction4(t,a,b,c,d,e) virtual t no##a(b,c,d,e) const override; #define GLFunction5(t,a,b,c,d,e,f) virtual t no##a(b,c,d,e,f) const override; #define GLFunction6(t,a,b,c,d,e,f,g) virtual t no##a(b,c,d,e,f,g) const override; #define GLFunction7(t,a,b,c,d,e,f,g,h) virtual t no##a(b,c,d,e,f,g,h) const override; #define GLFunction9(t,a,b,c,d,e,f,g,h,i,j) virtual t no##a(b,c,d,e,f,g,h,i,j) const override; class TDRENDER_EXPORT OdTrGL2LocalContext : public OdTrRndLocalContext { virtual void CreateExtensionRegistry() const; protected: mutable DrawBufferLayout m_drawBufferLayout; mutable ReadBufferLayout m_readBufferLayout; public: OdTrGL2LocalContext() : OdTrRndLocalContext() { } virtual OdTrRndNoGLShaderState* CreateShaderState() const; //#define GLLOGGER_FOR_CORE_DEVELOPER #ifdef GLLOGGER_FOR_CORE_DEVELOPER virtual void presentContext() override; #endif // Returns active draw buffer layout or nullptr if layouts doesn't supported. const DrawBufferLayout *activeDrawBufferLayout() const; // Return true if active draw buffer layout is fully compatible with specified layout. bool isDrawBufferLayoutCompatible(const DrawBufferLayout &dbl) const; // Change active draw buffer layout. Return previous active layout state. DrawBufferLayout changeDrawBufferLayout(const DrawBufferLayout &dbl); // Returns active read buffer layout or nullptr if layouts doesn't supported. const ReadBufferLayout *activeReadBufferLayout() const; // Return true if active read buffer layout is fully compatible with specified layout. bool isReadBufferLayoutCompatible(const ReadBufferLayout &rbl) const; // Change active read buffer layout. Return previous active layout state. ReadBufferLayout changeReadBufferLayout(const ReadBufferLayout &rbl); #include "Tr/render/nogl/TrRndNoGLContextHolderFunctionsList.inl" bool noglDrawSimplePoint(const GLfloat *pPoint) const; bool noglDrawSimplePoint(const GLdouble *pPoint) const; bool noglDrawSimpleLine(const GLfloat *pPoint0, const GLfloat *pPoint1) const; bool noglDrawSimpleLine(const GLdouble *pPoint0, const GLdouble *pPoint1) const; bool noglDrawSimpleIndexedPoint(GLuint id) const; bool noglDrawSimpleIndexedLine(GLuint id0, GLuint id1) const; bool noglWireframeMode(bool bEnable) const; // Each platform implementation must implement last one method static OdSmartPtr createLocalContext(OdTrVisRenderClient *pDevice); }; typedef OdSmartPtr OdTrGL2LocalContextPtr; #include "TD_PackPop.h" #endif // ODTRGL2LOCALCONTEXT