| GL Studio C++ Runtime API

Public Member Functions | Static Public Member Functions | List of all members
GlsSortedDrawable Class Referenceabstract

`#include <gls_sorted_drawable.h>`

## Public Member Functions
virtual unsigned int | SortedDraw_ClassID ()=0
virtual bool | SortedDraw_Compare (GlsSortedDrawable &other)=0
bool | SortedDraw_CompareDefault (GlsSortedDrawable &o)
virtual void | SortedDraw_OptimizeMerge (GlsSortedDrawable &lastObj)=0
virtual void | SortedDraw (GlsSortedDrawable *lastObj)=0
virtual void | SortedDrawCleanup ()=0
virtual bool | SortedDraw_ReorderAtWill ()

## Static Public Member Functions
static unsigned int | RegisterNewClassID (const char *debugStr=NULL)

## Detailed Description

The GlsSortedDrawable class. An interface for an object that knows how to sort itself.

## Member Function Documentation

## ◆ RegisterNewClassID()

static unsigned int RegisterNewClassID | ( | const char * | debugStr = `NULL` | ) |
| static

Returns
  A new ClassID. Typically only called once by each GlsSortedDrawable implementation.

Parameters

  debugStr | Unused, kept for backward compatibility.

## ◆ SortedDraw()

virtual void SortedDraw | ( | GlsSortedDrawable * | lastObj | ) |
| pure virtual

Draw the object using the current OpenGL context. Use lastDrawnObj to avoid redundant state changes.

Parameters

  lastObj | Pointer to the GlsSortedDrawable that was drawn (may be NULL).

## ◆ SortedDraw_ClassID()

virtual unsigned int SortedDraw_ClassID | ( |  | ) |
| pure virtual

Allows for static casting in compare functions.

See also
  RegisterClassID

Returns
  The unique identifier for this object's class.

## ◆ SortedDraw_Compare()

virtual bool SortedDraw_Compare | ( | GlsSortedDrawable & | other | ) |
| pure virtual

Compare two GlsSortedDrawable objects to determine the sort order.

Parameters

  other | Object to compare to.

Returns
  True if this object should draw before other.

## ◆ SortedDraw_CompareDefault()

bool SortedDraw_CompareDefault | ( | GlsSortedDrawable & | o | ) |
| inline

Comparison that should be used if the derived class is unsure.

Parameters

  o | The object to compare to.

Returns
  True if this object's id is less than the compared object.

## ◆ SortedDraw_OptimizeMerge()

virtual void SortedDraw_OptimizeMerge | ( | GlsSortedDrawable & | lastObj | ) |
| pure virtual

Try to merge two adjecently-sorted GlsSortedDrawable nodes.

Parameters

  lastObj | Pointer to the previous GlsSortedDrawable in the sort order.

## ◆ SortedDraw_ReorderAtWill()

virtual bool SortedDraw_ReorderAtWill | ( |  | ) |
| inline virtual

Returns
  Whether or not this can be re-ordered, or if it is part of an preserved order set.

## ◆ SortedDrawCleanup()

virtual void SortedDrawCleanup | ( |  | ) |
| pure virtual

Tell an object to restore the OpenGLDefaultState after drawing. Objects should call this if lastDrawnObj has an unknown class. The Group will also call this after the last object is drawn.

The documentation for this class was generated from the following file:

- gls_sorted_drawable.h