CFx SDK Documentation  2022 SP0
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
#define NULL
Definition: GsProperties.h:177
OdSmartPtr< OdTrGL2LocalContext > OdTrGL2LocalContextPtr
OdTrGL2ExtensionsRegistry & extensionsRegistry() const
static OdSmartPtr< OdTrGL2LocalContext > createLocalContext(OdTrVisRenderClient *pDevice)
virtual void makeCurrentContext()=0
virtual bool pushCurrentContext()
virtual bool isContextCreated() const =0
virtual void destroyContext()=0
virtual void presentContext()=0
virtual bool popCurrentContext()
virtual bool isExtensionBasedEmulation() const
OdRxObjectPtr m_pExtensionsRegistry
virtual bool isExtensionSupported(const char *)
virtual void createContext(OdTrVisRenderClient *pDevice)=0
virtual void updateContext(OdTrVisRenderClient *)
virtual void * acquireExtensionFunctionPtr(const char *)
virtual void makeCurrentContext()
virtual bool isContextCreated() const
virtual void createContext(OdTrVisRenderClient *)
virtual void destroyContext()
virtual void presentContext()