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 #include <UT/UT_Pair.h>
18 
19 #include "RE_API.h"
20 #include "RE_Font.h"
21 
22 class RE_BufferGroup;
23 class RE_Render;
25 
27 {
28 public:
29  static RE_PerContextData *getDataForContext(RE_OGLContext context);
30  static void clearContextData(RE_OGLContext context);
31 
32  // bucketed buffer groups for font rendering.
33  RE_FontBuffers *fetchFontBufferFromPool(RE_Render *r, int size);
34  void returnFontBufferToPool(RE_FontBuffers *buf);
35 
36  // buffer groups for immediate mode emuluation.
37  RE_BufferGroup *getBufferGroup(RE_Render *r, int size);
38 
39  void initBuffers(RE_Render *r);
40 
41 private:
42  void initBufferGroupRing();
43  RE_BufferGroup *getNextBufferGroup(RE_Render *r);
44  RE_BufferGroup *getLargeBufferGroup(RE_Render *r, int size);
45 
46  RE_BufferGroup *myBufferGroups;
47  RE_BufferGroup *myCurrentBufferGroup;
48  RE_BufferGroup *myLargeBufferGroups;
49  int myLargeBufferSerial;
50 
51  bool myInitialized;
52 
54 
57 };
58 
59 
61 {
62 public:
64  : myElemSize(0),
65  mySerial(0),
66  myP(NULL),
67  myC(NULL),
68  myImgUV(NULL),
69  myPatUV(NULL),
70  myPSize(NULL),
71  myElemList(NULL),
72  myVAO(NULL),
73  myNext(NULL) {}
74 
76 
77  void init(RE_Render *r, const int size);
78 
84 
87 
89  int mySerial;
90 
92 };
93 
94 #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:891
RE_OGLVertexArrayList * myVAO