CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
TrRndLocalContext.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2022, 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 Open Design Alliance software pursuant to a license
16// agreement with Open Design Alliance.
17// Open Design Alliance Copyright (C) 2002-2022 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// Base local context interface
24
25#ifndef ODTRRNDLOCALCONTEXT
26#define ODTRRNDLOCALCONTEXT
27
28#include "TD_PackPush.h"
29
30#include "../TrVisRenderClient.h"
32
36#define GLProcedure0(t,a) virtual t no##a() const{ return (t)0; }
37#define GLProcedure(t,a,b) virtual t no##a(b) const{ return (t)0; }
38#define GLFunction(t,a,b) virtual t no##a(b) const {}
39#define GLFunction2(t,a,b,c) virtual t no##a(b,c) const {}
40#define GLFunction3(t,a,b,c,d) virtual t no##a(b,c,d) const {}
41#define GLFunction4(t,a,b,c,d,e) virtual t no##a(b,c,d,e) const {}
42#define GLFunction5(t,a,b,c,d,e,f) virtual t no##a(b,c,d,e,f) const {}
43#define GLFunction6(t,a,b,c,d,e,f,g) virtual t no##a(b,c,d,e,f,g) const {}
44#define GLFunction7(t,a,b,c,d,e,f,g,h) virtual t no##a(b,c,d,e,f,g,h) const {}
45#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 {}
46
47
48struct GLFunctions : public nogl
49{
50 virtual ~GLFunctions(){};
51 virtual void glesSafeDrawArrays(GLenum mode, GLint first, GLsizei count) const
52 {
53 noglDrawArrays(mode, first, count);
54 };
55 virtual void* GetDrawBuffersExt(OdTrRndNoGLExtensionsRegistry &extReg, GLsizei n, const GLenum *bufs, bool bNativeES){return NULL;};
56#include "nogl/TrRndNoGLContextHolderFunctionsList.inl"
57};
58
59class OdTrRndNoGLShaderState;
61{
62 virtual void CreateExtensionRegistry() const{};
63 protected:
64 //mutable OdRxObjectPtr m_pExtensionsRegistry;
66 public:
69 {
73 }
74
75 virtual void createContext(OdTrVisRenderClient *pDevice) = 0;
76 virtual void updateContext(OdTrVisRenderClient * /*pDevice*/) { }
77 virtual void destroyContext() = 0;
78
79 virtual bool isContextCreated() const = 0;
80
81 virtual void makeCurrentContext() = 0;
82
83 virtual bool pushCurrentContext() { return false; }
84 virtual bool popCurrentContext() { return false; }
85
86 virtual void presentContext() = 0;
87
88 virtual bool isExtensionBasedEmulation() const { return false; }
89 virtual bool isExtensionSupported(const char * /*pExtensionName*/) { return false; }
90 virtual void *acquireExtensionFunctionPtr(const char * /*pFunctionName*/) { return NULL; }
91
92 // Search OpenGL extension in cross-platform way using our own extensions registry
94 {
95 if (m_pExtensionsRegistry == NULL)
96 CreateExtensionRegistry();
98 }
99 virtual OdTrRndNoGLShaderState* CreateShaderState() const {return NULL;};
100 virtual void* GetNoneDrawBuffer(){return NULL;};
101 virtual void* GetNoneReadBuffer(){return NULL;};
102 virtual void* GetFrameDrawBuffer(){return NULL;};
103 virtual void* GetFrameReadBuffer(){return NULL;};
104 virtual void DeleteDrawBuffer(void*){};
105 virtual void DeleteReadBuffer(void*){};
106};
107
109
114{
115 public:
118
119 virtual void createContext(OdTrVisRenderClient * /*pDevice*/) { }
120 virtual void destroyContext() { }
121
122 virtual bool isContextCreated() const { return true; }
123
124 virtual void makeCurrentContext() { }
125
126 virtual void presentContext() { }
127};
128
129#include "TD_PackPop.h"
130
131#endif // ODTRRNDLOCALCONTEXT
OdSmartPtr< OdTrRndLocalContext > OdTrRndLocalContextPtr
virtual void * GetNoneDrawBuffer()
virtual OdTrRndNoGLShaderState * CreateShaderState() const
virtual bool isExtensionBasedEmulation() const
virtual void * GetNoneReadBuffer()
virtual bool popCurrentContext()
virtual void * GetFrameReadBuffer()
OdTrRndNoGLExtensionsRegistry * m_pExtensionsRegistry
virtual void presentContext()=0
virtual void destroyContext()=0
virtual bool isExtensionSupported(const char *)
virtual ~OdTrRndLocalContext()
virtual void updateContext(OdTrVisRenderClient *)
virtual bool pushCurrentContext()
OdTrRndNoGLExtensionsRegistry & extensionsRegistry() const
virtual void DeleteDrawBuffer(void *)
virtual void * acquireExtensionFunctionPtr(const char *)
virtual void * GetFrameDrawBuffer()
virtual void DeleteReadBuffer(void *)
virtual void createContext(OdTrVisRenderClient *pDevice)=0
virtual void makeCurrentContext()=0
virtual bool isContextCreated() const =0
virtual bool isContextCreated() const
virtual void createContext(OdTrVisRenderClient *)
virtual void makeCurrentContext()
GLsizei GLsizei * count
Definition: gles2_ext.h:276
virtual void glesSafeDrawArrays(GLenum mode, GLint first, GLsizei count) const
virtual ~GLFunctions()
virtual void * GetDrawBuffersExt(OdTrRndNoGLExtensionsRegistry &extReg, GLsizei n, const GLenum *bufs, bool bNativeES)
Definition: NoGL.h:30
int GLsizei
Definition: NoGL.h:37
unsigned int GLenum
Definition: NoGL.h:31
int GLint
Definition: NoGL.h:36