Coin Logo http://www.sim.no/
http://www.coin3d.org/

SoGLCacheContextElement.h
1 #ifndef COIN_SOGLCACHECONTEXTELEMENT_H
2 #define COIN_SOGLCACHECONTEXTELEMENT_H
3 
4 /**************************************************************************\
5  *
6  * This file is part of the Coin 3D visualization library.
7  * Copyright (C) by Kongsberg Oil & Gas Technologies.
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * ("GPL") version 2 as published by the Free Software Foundation.
12  * See the file LICENSE.GPL at the root directory of this source
13  * distribution for additional information about the GNU GPL.
14  *
15  * For using Coin with software that can not be combined with the GNU
16  * GPL, and for taking advantage of the additional benefits of our
17  * support services, please contact Kongsberg Oil & Gas Technologies
18  * about acquiring a Coin Professional Edition License.
19  *
20  * See http://www.coin3d.org/ for more information.
21  *
22  * Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
23  * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
24  *
25 \**************************************************************************/
26 
27 #include <Inventor/elements/SoSubElement.h>
28 
29 // This shouldn't strictly be necessary, but the OSF1/cxx compiler
30 // complains if this is left out, while using the "friend class
31 // SoGLDisplayList" statement in the class definition.
32 class SoGLDisplayList;
33 
34 typedef void SoScheduleDeleteCB(void * closure, uint32_t contextid);
35 
36 // *************************************************************************
37 
38 class COIN_DLL_API SoGLCacheContextElement : public SoElement {
39  typedef SoElement inherited;
40 
41  SO_ELEMENT_HEADER(SoGLCacheContextElement);
42 
43 public:
44  static void initClass(void);
45 protected:
46  virtual ~SoGLCacheContextElement();
47 
48 public:
49  virtual void init(SoState * state);
50 
51  virtual SbBool matches(const SoElement * elt) const;
52  virtual SoElement * copyMatchInfo(void) const;
53  static void set(SoState * state, int context,
54  SbBool twopasstransparency,
55  SbBool remoterendering);
56  static int get(SoState * state);
57  static int getExtID(const char * str);
58  static void getOpenGLVersion(SoState * state, int & major, int & minor);
59  static SbBool extSupported(SoState * state, int extid);
60  static SbBool areMipMapsFast(SoState * state);
61  enum {
62  DO_AUTO_CACHE = 1,
63  DONT_AUTO_CACHE
64  };
65  static void shouldAutoCache(SoState * state, int bits);
66  static void setAutoCacheBits(SoState * state, int bits);
67  static int resetAutoCacheBits(SoState * state);
68  static SbBool getIsRemoteRendering(SoState * state);
69 
70  static uint32_t getUniqueCacheContext(void);
71 
72  static void scheduleDeleteCallback(const uint32_t contextid,
73  SoScheduleDeleteCB * cb,
74  void * closure);
75 
76  static void incNumShapes(SoState * state);
77  static int getNumShapes(SoState * state);
78  static void incNumSeparators(SoState * state);
79  static int getNumSeparators(SoState * state);
80 
81 private:
82  friend class SoGLDisplayList;
83  static void scheduleDelete(SoState * state, SoGLDisplayList * dl);
84  static void cleanupContext(uint32_t contextid, void * closure);
85 
86 private:
87  int context;
88  SbBool twopass;
89  int autocachebits;
90  int numshapes;
91  int numseparators;
92 
93  enum { RENDERING_UNSET, RENDERING_SET_DIRECT, RENDERING_SET_INDIRECT };
94  int rendering;
95  SbBool isDirectRendering(SoState * state) const;
96 };
97 
98 // *************************************************************************
99 
100 // For compatibility with client code originally written with SGI/TGS
101 // Inventor:
102 #ifndef COIN_INTERNAL
103 #include <Inventor/elements/SoGLDisplayList.h>
104 #endif // ! COIN_INTERNAL
105 
106 #endif // !COIN_SOGLCACHECONTEXTELEMENT_H
static void initClass(void)
Definition: SoElement.cpp:507
virtual SbBool matches(const SoElement *element) const =0
Definition: SoElement.cpp:609
SoElement is the abstract base class for all elements.
Definition: SoElement.h:34
The SoState class manages the Coin scenegraph traversal state data.The SoState class is used by actio...
Definition: SoState.h:35
virtual void init(SoState *state)
Definition: SoElement.cpp:553
virtual SoElement * copyMatchInfo(void) const =0
The SoGLDisplayList class stores and manages OpenGL display lists.The TEXTURE_OBJECT type is not dire...
Definition: SoGLDisplayList.h:34

Copyright © 1998-2010 by Kongsberg Oil & Gas Technologies. All rights reserved.

Generated for Coin by Doxygen 1.8.14.