CFx SDK Documentation  2020SP3
TrGL2LocalContext.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2017, Open Design Alliance (the "Alliance").
3 // All rights reserved.
4 //
5 // This software and its documentation and related materials are owned by
6 // the Alliance. The software may only be incorporated into application
7 // programs owned by members of the Alliance, subject to a signed
8 // Membership Agreement and Supplemental Software License Agreement with the
9 // Alliance. The structure and organization of this software are the valuable
10 // trade secrets of the Alliance and its suppliers. The software is also
11 // protected by copyright law and international treaty provisions. Application
12 // programs incorporating this software must include the following statement
13 // with their copyright notices:
14 //
15 // This application incorporates Teigha(R) software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Teigha(R) Copyright (C) 2002-2017 by Open Design Alliance.
18 // All rights reserved.
19 //
20 // By use of this software, its documentation or related materials, you
21 // acknowledge and accept the above terms.
23 // GLES2 device local context
24 
25 #ifndef ODTRGL2LOCALCONTEXT
26 #define ODTRGL2LOCALCONTEXT
27 
28 #include "TD_PackPush.h"
29 
30 #include "../TrVisRenderClient.h"
31 
33 
38 {
39  protected:
41  public:
44 
45  // Each platform implementation must implement last one method
47 
48  virtual void createContext(OdTrVisRenderClient *pDevice) = 0;
49  virtual void updateContext(OdTrVisRenderClient * /*pDevice*/) { }
50  virtual void destroyContext() = 0;
51 
52  virtual bool isContextCreated() const = 0;
53 
54  virtual void makeCurrentContext() = 0;
55 
56  virtual bool pushCurrentContext() { return false; }
57  virtual bool popCurrentContext() { return false; }
58 
59  virtual void presentContext() = 0;
60 
61  virtual bool isExtensionBasedEmulation() const { return false; }
62  virtual bool isExtensionSupported(const char * /*pExtensionName*/) { return false; }
63  virtual void *acquireExtensionFunctionPtr(const char * /*pFunctionName*/) { return NULL; }
64 
65  // Search OpenGL extension in cross-platform way using our own extensions registry
67 };
68 
70 
75 {
76  public:
79 
80  virtual void createContext(OdTrVisRenderClient * /*pDevice*/) { }
81  virtual void destroyContext() { }
82 
83  virtual bool isContextCreated() const { return true; }
84 
85  virtual void makeCurrentContext() { }
86 
87  virtual void presentContext() { }
88 };
89 
90 #include "TD_PackPop.h"
91 
92 #endif // ODTRGL2LOCALCONTEXT
OdTrGL2LocalContextStub::createContext
virtual void createContext(OdTrVisRenderClient *)
Definition: TrGL2LocalContext.h:80
NULL
#define NULL
Definition: GsProperties.h:177
OdRxObjectPtr
Definition: RxObject.h:345
OdTrGL2LocalContext
Definition: TrGL2LocalContext.h:38
OdTrGL2LocalContext::acquireExtensionFunctionPtr
virtual void * acquireExtensionFunctionPtr(const char *)
Definition: TrGL2LocalContext.h:63
OdTrGL2LocalContext::~OdTrGL2LocalContext
~OdTrGL2LocalContext()
Definition: TrGL2LocalContext.h:43
OdRxObject
Definition: RxObject.h:564
OdTrGL2LocalContext::popCurrentContext
virtual bool popCurrentContext()
Definition: TrGL2LocalContext.h:57
TD_PackPop.h
OdTrGL2LocalContextStub::OdTrGL2LocalContextStub
OdTrGL2LocalContextStub()
Definition: TrGL2LocalContext.h:77
OdTrGL2LocalContextPtr
OdSmartPtr< OdTrGL2LocalContext > OdTrGL2LocalContextPtr
Definition: TrGL2LocalContext.h:69
OdTrGL2LocalContext::createContext
virtual void createContext(OdTrVisRenderClient *pDevice)=0
OdTrGL2LocalContextStub::destroyContext
virtual void destroyContext()
Definition: TrGL2LocalContext.h:81
OdTrGL2LocalContext::updateContext
virtual void updateContext(OdTrVisRenderClient *)
Definition: TrGL2LocalContext.h:49
OdSmartPtr
Definition: SmartPtr.h:58
OdTrGL2ExtensionsRegistry
Definition: TrGL2Extensions.h:147
OdTrGL2LocalContext::OdTrGL2LocalContext
OdTrGL2LocalContext()
Definition: TrGL2LocalContext.h:42
OdTrGL2LocalContext::isContextCreated
virtual bool isContextCreated() const =0
OdTrGL2LocalContext::pushCurrentContext
virtual bool pushCurrentContext()
Definition: TrGL2LocalContext.h:56
TD_PackPush.h
OdTrGL2LocalContext::destroyContext
virtual void destroyContext()=0
OdTrVisRenderClient
Definition: TrVisRenderClient.h:40
OdTrGL2LocalContext::presentContext
virtual void presentContext()=0
OdTrGL2LocalContextStub::makeCurrentContext
virtual void makeCurrentContext()
Definition: TrGL2LocalContext.h:85
OdTrGL2LocalContext::isExtensionSupported
virtual bool isExtensionSupported(const char *)
Definition: TrGL2LocalContext.h:62
OdTrGL2LocalContextStub::~OdTrGL2LocalContextStub
~OdTrGL2LocalContextStub()
Definition: TrGL2LocalContext.h:78
OdTrGL2LocalContext::m_pExtensionsRegistry
OdRxObjectPtr m_pExtensionsRegistry
Definition: TrGL2LocalContext.h:40
OdTrGL2LocalContext::createLocalContext
static OdSmartPtr< OdTrGL2LocalContext > createLocalContext(OdTrVisRenderClient *pDevice)
OdTrGL2LocalContextStub::presentContext
virtual void presentContext()
Definition: TrGL2LocalContext.h:87
OdTrGL2LocalContextStub
Definition: TrGL2LocalContext.h:75
OdTrGL2LocalContext::extensionsRegistry
OdTrGL2ExtensionsRegistry & extensionsRegistry() const
OdTrGL2LocalContext::isExtensionBasedEmulation
virtual bool isExtensionBasedEmulation() const
Definition: TrGL2LocalContext.h:61
OdTrGL2LocalContextStub::isContextCreated
virtual bool isContextCreated() const
Definition: TrGL2LocalContext.h:83
OdTrGL2LocalContext::makeCurrentContext
virtual void makeCurrentContext()=0