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;
26 
28 {
29 public:
30  static RE_PerContextData *getDataForContext(RE_OGLContext context);
31  static void clearContextData(RE_OGLContext context);
32 
33  // bucketed buffer groups for font rendering.
34  RE_FontBuffers *fetchFontBufferFromPool(RE_Render *r, int size);
35  void returnFontBufferToPool(RE_FontBuffers *buf);
36 
37  // buffer groups for immediate mode emuluation.
38  RE_BufferGroup *getBufferGroup(RE_Render *r, int size);
39 
40  void initBuffers(RE_Render *r);
41 
42 private:
43  void initBufferGroupRing();
44  RE_BufferGroup *getNextBufferGroup(RE_Render *r);
45  RE_BufferGroup *getLargeBufferGroup(RE_Render *r, int size);
46 
47  RE_BufferGroup *myBufferGroups;
48  RE_BufferGroup *myCurrentBufferGroup;
49  RE_BufferGroup *myLargeBufferGroups;
50  int myLargeBufferSerial;
51 
52  bool myInitialized;
53 
55  myFontBufferBuckets;
56 
59 };
60 
61 
63 {
64 public:
66  : myElemSize(0),
67  mySerial(0),
68  myP(nullptr),
69  myC(nullptr),
70  myImgUV(nullptr),
71  myPatUV(nullptr),
72  myPSize(nullptr),
73  myElemList(nullptr),
74  myVAO(nullptr),
75  myNext(nullptr) {}
76 
78 
79  void init(RE_Render *r, const int size);
80 
86 
89 
91  int mySerial;
92 
94 };
95 
96 #endif
RE_VertexArray * myC
RE_VertexArray * myImgUV
#define RE_API
Definition: RE_API.h:10
RE_VertexArray * myPSize
GLsizeiptr size
Definition: glcorearb.h:663
RE_VertexArray * myPatUV
RE_VertexArray * myP
RE_VertexArray * myElemList
void init(RE_Render *r, const int size)
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glcorearb.h:2539
RE_BufferGroup * myNext
GLboolean r
Definition: glcorearb.h:1221
QOpenGLContext * RE_OGLContext
Definition: RE_Types.h:918
RE_OGLVertexArrayList * myVAO