---
name: "SoGLLazyElement"
section: "3"
platform: "linux"
package: "coin"
version: "1:4.0.10-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/SoGLLazyElement"
---

# SoGLLazyElement(3)

The SoGLLazyElement class is meant to optimize GL rendering.

## NAME

SoGLLazyElement - The **SoGLLazyElement** class is meant to optimize GL rendering.

## SYNOPSIS

\#include \<Inventor/elements/SoGLLazyElement.h\>

Inherits **SoLazyElement**.

### Classes

struct **GLState**\

### Public Member Functions

virtual void **init** (**SoState** \*state)\
 virtual void **push** (**SoState** \*state)\
 virtual void **pop** (**SoState** \*state, const **SoElement** \*prevtopelement)\
 void **sendDiffuseByIndex** (const int index) const\
 FIXME: write doc.  void **send** (const **SoState** \*state, uint32\_t mask) const\
 FIXME: write doc.  void **sendVPPacked** (**SoState** \*state, const unsigned char \*pcolor)\
 FIXME: write doc.  void **reset** (**SoState** \*state, uint32\_t bitmask) const\
 virtual void **setDiffuseElt** (**SoNode** \*, int32\_t numcolors, const **SbColor** \*colors, **SoColorPacker** \*packer)\
 virtual void **setPackedElt** (**SoNode** \*node, int32\_t numcolors, const uint32\_t \*colors, const SbBool packedtransparency)\
 virtual void **setColorIndexElt** (**SoNode** \*node, int32\_t numindices, const int32\_t \*indices)\
 virtual void **setTranspElt** (**SoNode** \*node, int32\_t numtransp, const float \*transp, **SoColorPacker** \*packer)\
 virtual void **setTranspTypeElt** (int32\_t type)\
 virtual void **setAmbientElt** (const **SbColor** \*color)\
 virtual void **setEmissiveElt** (const **SbColor** \*color)\
 virtual void **setSpecularElt** (const **SbColor** \*color)\
 virtual void **setShininessElt** (float value)\
 virtual void **setColorMaterialElt** (SbBool value)\
 virtual void **enableBlendingElt** (int sfactor, int dfactor, int alpha\_sfactor, int alpha\_dfactor)\
 virtual void **disableBlendingElt** (void)\
 virtual void **setLightModelElt** (**SoState** \*state, int32\_t model)\
 virtual void **setMaterialElt** (**SoNode** \*node, uint32\_t bitmask, **SoColorPacker** \*packer, const **SbColor** \*diffuse, const int numdiffuse, const float \*transp, const int numtransp, const **SbColor** &ambient, const **SbColor** &emissive, const **SbColor** &specular, const float shininess, const SbBool istransparent)\
 virtual void **setVertexOrderingElt** (VertexOrdering ordering)\
 virtual void **setBackfaceCullingElt** (SbBool onoff)\
 virtual void **setTwosideLightingElt** (SbBool onoff)\
 virtual void **setShadeModelElt** (SbBool flatshading)\
 virtual void **setAlphaTestElt** (int func, float value)\
 void **updateColorVBO** (SoVBO \*vbo)\

Public Member Functions inherited from **SoLazyElement** virtual SbBool **matches** (const **SoElement** \*) const\
 virtual **SoElement** \* **copyMatchInfo** (void) const\
 int32\_t **getNumDiffuse** (void) const\
 int32\_t **getNumTransparencies** (void) const\
 int32\_t **getNumColorIndices** (void) const\
 SbBool **isPacked** (void) const\
 SbBool **isTransparent** (void) const\
 const uint32\_t \* **getPackedPointer** (void) const\
 const **SbColor** \* **getDiffusePointer** (void) const\
 const int32\_t \* **getColorIndexPointer** (void) const\
 const float \* **getTransparencyPointer** (void) const\

Public Member Functions inherited from **SoElement** const **SoType** **getTypeId** (void) const\
 int **getStackIndex** (void) const\
 void **setDepth** (const int **depth**)\
 int **getDepth** (void) const\
 virtual void **print** (FILE \*file=stdout) const\
 virtual **~SoElement** ()\

### Static Public Member Functions

static **SoType** **getClassTypeId** (void)\
 static int **getClassStackIndex** (void)\
 static void \* **createInstance** (void)\
 static void **initClass** ()\
 static void **sendAllMaterial** (**SoState** \*state)\
 FIXME: write doc.  static void **sendNoMaterial** (**SoState** \*state)\
 FIXME: write doc.  static void **sendOnlyDiffuseColor** (**SoState** \*state)\
 FIXME: write doc.  static void **sendLightModel** (**SoState** \*state, const int32\_t model)\
 static void **sendPackedDiffuse** (**SoState** \*state, const uint32\_t diffuse)\
 static void **sendFlatshading** (**SoState** \*state, const SbBool onoff)\
 static void **sendVertexOrdering** (**SoState** \*state, const VertexOrdering ordering)\
 static void **sendTwosideLighting** (**SoState** \*state, const SbBool onoff)\
 static void **sendBackfaceCulling** (**SoState** \*state, const SbBool onoff)\
 static SbBool **isColorIndex** (**SoState** \*state)\
 FIXME: write doc.  static **SoGLLazyElement** \* **getInstance** (const **SoState** \*state)\
 FIXME: write doc.  static void **beginCaching** (**SoState** \*state, **SoGLLazyElement::GLState** \*prestate, **SoGLLazyElement::GLState** \*poststate)\
 static void **endCaching** (**SoState** \*state)\
 static SbBool **preCacheCall** (const **SoState** \*state, const **SoGLLazyElement::GLState** \*prestate)\
 static void **postCacheCall** (const **SoState** \*state, const **SoGLLazyElement::GLState** \*poststate)\
 static void **mergeCacheInfo** (**SoState** \*state, **SoGLLazyElement::GLState** \*childprestate, **SoGLLazyElement::GLState** \*childpoststate)\

Static Public Member Functions inherited from **SoLazyElement** static **SoType** **getClassTypeId** (void)\
 static int **getClassStackIndex** (void)\
 static void \* **createInstance** (void)\
 static void **initClass** ()\
 static void **setToDefault** (**SoState** \*state)\
 static void **setDiffuse** (**SoState** \*state, **SoNode** \*node, int32\_t numcolors, const **SbColor** \*colors, **SoColorPacker** \*packer)\
 static void **setTransparency** (**SoState** \*state, **SoNode** \*node, int32\_t numvalues, const float \*transparency, **SoColorPacker** \*packer)\
 static void **setPacked** (**SoState** \*state, **SoNode** \*node, int32\_t numcolors, const uint32\_t \*colors, const SbBool packedtransparency=FALSE)\
 static void **setColorIndices** (**SoState** \*state, **SoNode** \*node, int32\_t numindices, const int32\_t \*indices)\
 static void **setAmbient** (**SoState** \*state, const **SbColor** \*color)\
 static void **setEmissive** (**SoState** \*state, const **SbColor** \*color)\
 static void **setSpecular** (**SoState** \*state, const **SbColor** \*color)\
 static void **setShininess** (**SoState** \*state, float value)\
 static void **setColorMaterial** (**SoState** \*state, SbBool value)\
 static void **enableBlending** (**SoState** \*state, int sfactor, int dfactor)\
 static void **enableSeparateBlending** (**SoState** \*state, int sfactor, int dfactor, int alpha\_sfactor, int alpha\_dfactor)\
 static void **disableBlending** (**SoState** \*state)\
 static void **setLightModel** (**SoState** \*state, const int32\_t model)\
 static void **setVertexOrdering** (**SoState** \*state, VertexOrdering ordering)\
 static void **setBackfaceCulling** (**SoState** \*state, SbBool onoff)\
 static void **setTwosideLighting** (**SoState** \*state, SbBool onoff)\
 static void **setShadeModel** (**SoState** \*state, SbBool flatshading)\
 static void **setAlphaTest** (**SoState** \*state, int func, float value)\
 static const **SbColor** & **getDiffuse** (**SoState** \*state, int index)\
 static float **getTransparency** (**SoState** \*, int index)\
 static const uint32\_t \* **getPackedColors** (**SoState** \*)\
 static const int32\_t \* **getColorIndices** (**SoState** \*)\
 static int32\_t **getColorIndex** (**SoState** \*, int num)\
 static const **SbColor** & **getAmbient** (**SoState** \*)\
 static const **SbColor** & **getEmissive** (**SoState** \*)\
 static const **SbColor** & **getSpecular** (**SoState** \*)\
 static float **getShininess** (**SoState** \*)\
 static SbBool **getColorMaterial** (**SoState** \*)\
 static SbBool **getBlending** (**SoState** \*, int &sfactor, int &dfactor)\
 static SbBool **getAlphaBlending** (**SoState** \*, int &sfactor, int &dfactor)\
 static int32\_t **getLightModel** (**SoState** \*)\
 static int **getAlphaTest** (**SoState** \*state, float &value)\
 static SbBool **getTwoSidedLighting** (**SoState** \*state)\
 static **SoLazyElement** \* **getInstance** (**SoState** \*state)\
 static float **getDefaultAmbientIntensity** (void)\
 static **SbColor** **getDefaultDiffuse** (void)\
 static **SbColor** **getDefaultAmbient** (void)\
 static **SbColor** **getDefaultSpecular** (void)\
 static **SbColor** **getDefaultEmissive** (void)\
 static float **getDefaultShininess** (void)\
 static uint32\_t **getDefaultPacked** (void)\
 static float **getDefaultTransparency** (void)\
 static int32\_t **getDefaultLightModel** (void)\
 static int32\_t **getDefaultColorIndex** (void)\
 static void **setMaterials** (**SoState** \*state, **SoNode** \*node, uint32\_t bitmask, **SoColorPacker** \*cPacker, const **SbColor** \*diffuse, const int numdiffuse, const float \*transp, const int numtransp, const **SbColor** &ambient, const **SbColor** &emissive, const **SbColor** &specular, const float shininess, const SbBool istransparent)\
 static **SoLazyElement** \* **getWInstance** (**SoState** \*state)\
 static void **setTransparencyType** (**SoState** \*state, int32\_t type)\

Static Public Member Functions inherited from **SoElement** static void **initClass** (void)\
 static **SoType** **getClassTypeId** (void)\
 static int **getClassStackIndex** (void)\
 static void **initElements** (void)\
 static int **getNumStackIndices** (void)\
 static **SoType** **getIdFromStackIndex** (const int **stackIndex**)\

### Protected Member Functions

**~SoGLLazyElement** ()\
 virtual void **lazyDidSet** (uint32\_t mask)\
 virtual void **lazyDidntSet** (uint32\_t mask)\

Protected Member Functions inherited from **SoLazyElement** **~SoLazyElement** ()\

Protected Member Functions inherited from **SoElement** **SoElement** (void)\
 void **capture** (**SoState** \*const state) const\
 virtual void **captureThis** (**SoState** \*state) const\
 void **setTypeId** (const **SoType** **typeId**)\
 void **setStackIndex** (const int index)\
 **SoElement** \* **getNextInStack** (void) const\
 **SoElement** \* **getNextFree** (void) const\

### Additional Inherited Members

Public Types inherited from **SoLazyElement** enum **cases** { **LIGHT\_MODEL\_CASE** = 0, **COLOR\_MATERIAL\_CASE**, **DIFFUSE\_CASE**, **AMBIENT\_CASE**, **EMISSIVE\_CASE**, **SPECULAR\_CASE**, **SHININESS\_CASE**, **BLENDING\_CASE**, **TRANSPARENCY\_CASE**, **VERTEXORDERING\_CASE**, **TWOSIDE\_CASE**, **CULLING\_CASE**, **SHADE\_MODEL\_CASE**, **ALPHATEST\_CASE**, **GLIMAGE\_CASE**, **LAZYCASES\_LAST** }\
 enum **masks** { **LIGHT\_MODEL\_MASK** = 1 \<\< LIGHT\_MODEL\_CASE, **COLOR\_MATERIAL\_MASK** = 1 \<\< COLOR\_MATERIAL\_CASE, **DIFFUSE\_MASK** = 1 \<\< DIFFUSE\_CASE, **AMBIENT\_MASK** = 1 \<\< AMBIENT\_CASE, **EMISSIVE\_MASK** = 1\<\<EMISSIVE\_CASE, **SPECULAR\_MASK** = 1 \<\< SPECULAR\_CASE, **SHININESS\_MASK** = 1 \<\< SHININESS\_CASE, **TRANSPARENCY\_MASK** = 1 \<\< TRANSPARENCY\_CASE, **BLENDING\_MASK** = 1 \<\< BLENDING\_CASE, **VERTEXORDERING\_MASK** = 1 \<\< VERTEXORDERING\_CASE, **TWOSIDE\_MASK** = 1 \<\< TWOSIDE\_CASE, **CULLING\_MASK** = 1 \<\< CULLING\_CASE, **SHADE\_MODEL\_MASK** = 1 \<\< SHADE\_MODEL\_CASE, **ALPHATEST\_MASK** = 1 \<\< ALPHATEST\_CASE, **GLIMAGE\_MASK** = 1 \<\< GLIMAGE\_CASE, **ALL\_MASK** = (1 \<\< LAZYCASES\_LAST)-1 }\
 enum **internalMasks** { **OTHER\_COLOR\_MASK** = AMBIENT\_MASK\|EMISSIVE\_MASK\|SPECULAR\_MASK\|SHININESS\_MASK, **ALL\_COLOR\_MASK** = OTHER\_COLOR\_MASK\|DIFFUSE\_MASK, **NO\_COLOR\_MASK** = ALL\_MASK & (~ALL\_COLOR\_MASK), **ALL\_BUT\_DIFFUSE\_MASK** = ALL\_MASK &(~ DIFFUSE\_MASK), **DIFFUSE\_ONLY\_MASK** = ALL\_MASK &(~ OTHER\_COLOR\_MASK) }\
 enum **LightModel** { **BASE\_COLOR**, **PHONG** }\
 enum **VertexOrdering** { **CW**, **CCW** }\

Static Protected Member Functions inherited from **SoElement** static **SoElement** \* **getElement** (**SoState** \*const state, const int **stackIndex**)\
 static const **SoElement** \* **getConstElement** (**SoState** \*const state, const int **stackIndex**)\
 static int **createStackIndex** (const **SoType** id)\

Protected Attributes inherited from **SoLazyElement** struct **SoLazyElement::CoinState** **coinstate**\

Protected Attributes inherited from **SoElement** **SoType** **typeId**\
 int **stackIndex**\
 int **depth**\

Static Protected Attributes inherited from **SoElement** static int **classStackIndex**\
 static **SoTypeList** \* **stackToType**\

## Detailed Description

The **SoGLLazyElement** class is meant to optimize GL rendering.

This is just a wrap-around implementation for compatibility. It should (hopefully) work in the same way as the Inventor class though.

## Constructor & Destructor Documentation

### SoGLLazyElement::~SoGLLazyElement () \[protected\]

Destructor.

## Member Function Documentation

### SoType SoGLLazyElement::getClassTypeId (void ) \[static\]

This static method returns the **SoType** object associated with objects of this class.

### int SoGLLazyElement::getClassStackIndex (void ) \[static\]

This static method returns the state stack index for the class.

### void \* SoGLLazyElement::createInstance (void ) \[static\]

*This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.*\

 Creates a new instance of the class type corresponding to the **SoType** object.

### void SoGLLazyElement::initClass (void ) \[static\]

Initialize relevant common data for all instances, like the type system.

### void SoGLLazyElement::init (SoState \* state) \[virtual\]

This function initializes the element type in the given **SoState**. It is called for the first element of each enabled element type in **SoState** objects.

Reimplemented from **SoLazyElement**.

### void SoGLLazyElement::push (SoState \* state) \[virtual\]

This method is called every time a new element is required in one of the stacks. This happens when a writable element is requested, using **SoState::getElement()** or indirectly **SoElement::getElement()**, and the depth of the current element is less than the state depth.

Override this method if your element needs to copy data from the previous top of stack. The **push()** method is called on the new element, and the previous element can be found using **SoElement::getNextInStack()**.

Reimplemented from **SoLazyElement**.

### void SoGLLazyElement::pop (SoState \* state, const SoElement \* prevTopElement) \[virtual\]

This method is called when the state is popped, and the depth of the element is bigger than the current state depth. **pop()** is called on the new top of stack, and a pointer to the previous top of stack is passed in *prevTopElement*.

Override this method if you need to copy some state information from the previous top of stack.

Reimplemented from **SoElement**.

### void SoGLLazyElement::reset (SoState \* stateptr, uint32\_t mask) const

Reset element GL state (set state to invalid). Use this method to notify this element when you use your own GL code that changes the OpenGL state.

### void SoGLLazyElement::setDiffuseElt (SoNode \* node, int32\_t numcolors, const SbColor \* colors, SoColorPacker \* packer) \[virtual\]

Reimplemented from **SoLazyElement**.

### void SoGLLazyElement::setPackedElt (SoNode \* node, int32\_t numcolors, const uint32\_t \* colors, const SbBool packedtransparency) \[virtual\]

Reimplemented from **SoLazyElement**.

### void SoGLLazyElement::setColorIndexElt (SoNode \* node, int32\_t numindices, const int32\_t \* indices) \[virtual\]

Reimplemented from **SoLazyElement**.

### void SoGLLazyElement::setTranspElt (SoNode \* node, int32\_t numtransp, const float \* transp, SoColorPacker \* packer) \[virtual\]

Reimplemented from **SoLazyElement**.

### void SoGLLazyElement::setTranspTypeElt (int32\_t type) \[virtual\]

Reimplemented from **SoLazyElement**.

### void SoGLLazyElement::setAmbientElt (const SbColor \* color) \[virtual\]

Reimplemented from **SoLazyElement**.

### void SoGLLazyElement::setEmissiveElt (const SbColor \* color) \[virtual\]

Reimplemented from **SoLazyElement**.

### void SoGLLazyElement::setSpecularElt (const SbColor \* color) \[virtual\]

Reimplemented from **SoLazyElement**.

### void SoGLLazyElement::setShininessElt (float value) \[virtual\]

Reimplemented from **SoLazyElement**.

### void SoGLLazyElement::setColorMaterialElt (SbBool value) \[virtual\]

Reimplemented from **SoLazyElement**.

### void SoGLLazyElement::enableBlendingElt (int sfactor, int dfactor, int alpha\_sfactor, int alpha\_dfactor) \[virtual\]

Reimplemented from **SoLazyElement**.

### void SoGLLazyElement::disableBlendingElt (void ) \[virtual\]

Reimplemented from **SoLazyElement**.

### void SoGLLazyElement::setLightModelElt (SoState \* state, int32\_t model) \[virtual\]

Reimplemented from **SoLazyElement**.

### void SoGLLazyElement::setMaterialElt (SoNode \* node, uint32\_t bitmask, SoColorPacker \* packer, const SbColor \* diffuse, const int numdiffuse, const float \* transp, const int numtransp, const SbColor & ambient, const SbColor & emissive, const SbColor & specular, const float shininess, const SbBool istransparent) \[virtual\]

Reimplemented from **SoLazyElement**.

### void SoGLLazyElement::setVertexOrderingElt (VertexOrdering ordering) \[virtual\]

Reimplemented from **SoLazyElement**.

### void SoGLLazyElement::setBackfaceCullingElt (SbBool onoff) \[virtual\]

Reimplemented from **SoLazyElement**.

### void SoGLLazyElement::setTwosideLightingElt (SbBool onoff) \[virtual\]

Reimplemented from **SoLazyElement**.

### void SoGLLazyElement::setShadeModelElt (SbBool flatshading) \[virtual\]

Reimplemented from **SoLazyElement**.

### void SoGLLazyElement::setAlphaTestElt (int func, float value) \[virtual\]

Reimplemented from **SoLazyElement**.

### void SoGLLazyElement::mergeCacheInfo (SoState \* state, SoGLLazyElement::GLState \* childprestate, SoGLLazyElement::GLState \* childpoststate) \[static\]

Merge cache info from a child cache (when doing nested caching) into the current cache.

### void SoGLLazyElement::lazyDidSet (uint32\_t mask) \[protected\], \[virtual\]

Reimplemented from **SoLazyElement**.

### void SoGLLazyElement::lazyDidntSet (uint32\_t mask) \[protected\], \[virtual\]

Reimplemented from **SoLazyElement**.

## Author

Generated automatically by Doxygen for Coin from the source code.
