HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RE_PerContextData.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: RE_PerContextData.h ( RE Library, C++)
7  *
8  * COMMENTS:
9  * Data that is kept with a RE_OGLContext, rather than RE_Render.
10  * RE_Renders are continually created and destroyed, while RE_OGLContexts
11  * are not.
12  */
13 #ifndef RE_PerContextData_h
14 #define RE_PerContextData_h
15 
16 #include <UT/UT_Array.h>
17 
18 #include "RE_API.h"
19 #include "RE_Font.h"
20 
21 #include <utility>
22 
23 class RE_BufferGroup;
24 class RE_Render;
25 #if defined(EXPERIMENTAL_QOPENGLWIDGET)
26 class RE_GLDrawable;
27 #endif
29 
31 {
32 public:
33 #if defined(EXPERIMENTAL_QOPENGLWIDGET)
34  static RE_PerContextData *getDataForContext(RE_GLDrawable *drawable);
35  static void clearContextData(RE_GLDrawable *drawable);
36 #else
37  static RE_PerContextData *getDataForContext(RE_OGLContext context);
38  static void clearContextData(RE_OGLContext context);
39 #endif
40 
41  // bucketed buffer groups for font rendering.
42  RE_FontBuffers *fetchFontBufferFromPool(RE_Render *r, int size);
43  void returnFontBufferToPool(RE_FontBuffers *buf);
44 
45  // buffer groups for immediate mode emuluation.
46  RE_BufferGroup *getBufferGroup(RE_Render *r, int size);
47 
48  void initBuffers(RE_Render *r);
49 
50 private:
51  void initBufferGroupRing();
52  RE_BufferGroup *getNextBufferGroup(RE_Render *r);
53  RE_BufferGroup *getLargeBufferGroup(RE_Render *r, int size);
54 
55  RE_BufferGroup *myBufferGroups;
56  RE_BufferGroup *myCurrentBufferGroup;
57  RE_BufferGroup *myLargeBufferGroups;
58  int myLargeBufferSerial;
59 
60  bool myInitialized;
61 
63  myFontBufferBuckets;
64 
67 };
68 
69 
71 {
72 public:
74  : myElemSize(0),
75  mySerial(0),
76  myP(nullptr),
77  myC(nullptr),
78  myImgUV(nullptr),
79  myPatUV(nullptr),
80  myPSize(nullptr),
81  myElemList(nullptr),
82  myVAO(nullptr),
83  myNext(nullptr) {}
84 
86 
87  void init(RE_Render *r, const int size);
88 
94 
97 
99  int mySerial;
100 
102 };
103 
104 #endif
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glcorearb.h:2540
RE_VertexArray * myC
RE_VertexArray * myImgUV
#define RE_API
Definition: RE_API.h:10
RE_VertexArray * myPSize
RE_VertexArray * myPatUV
RE_VertexArray * myP
RE_VertexArray * myElemList
void init(RE_Render *r, const int size)
GLsizeiptr size
Definition: glcorearb.h:664
RE_BufferGroup * myNext
GLboolean r
Definition: glcorearb.h:1222
QOpenGLContext * RE_OGLContext
Definition: RE_Types.h:952
RE_OGLVertexArrayList * myVAO