TextureStagePool

from panda3d.core import TextureStagePool
class TextureStagePool

Bases: DTOOL_SUPER_BASE

The TextureStagePool (there is only one in the universe) serves to unify different pointers to the same TextureStage, mainly to help developers use a common pointer to access things that are loaded from different model files.

It runs in one of three different modes, according to set_mode(). See that method for more information.

Inheritance diagram

Inheritance diagram of TextureStagePool

MName = 1
MNone = 0
MUnique = 2
M_name = 1
M_none = 0
M_unique = 2
__init__(*args, **kwargs)
garbageCollect()

C++ Interface: garbage_collect()

/**
  • Releases only those TextureStages in the pool that have a reference count

  • of exactly 1; i.e. only those TextureStages that are not being used

  • outside of the pool. Returns the number of TextureStages released.

*/

garbage_collect()

C++ Interface: garbage_collect()

/**
  • Releases only those TextureStages in the pool that have a reference count

  • of exactly 1; i.e. only those TextureStages that are not being used

  • outside of the pool. Returns the number of TextureStages released.

*/

getMode()

C++ Interface: get_mode()

/**
  • Returns the fundamental operating mode of the TextureStagePool. See

  • set_mode().

*/

getStage()

C++ Interface: get_stage(TextureStage temp)

/**
  • Returns a TextureStage pointer that represents the same TextureStage

  • described by temp, except that it is a shared pointer.

  • Each call to get_stage() passing an equivalent TextureStage pointer will

  • return the same shared pointer.

  • If you modify the shared pointer, it will automatically disassociate it

  • from the pool.

  • Also, the return value may be a different pointer than that passed in, or

  • it may be the same pointer. In either case, the passed in pointer has now

  • been sacrificed to the greater good and should not be used again (like any

  • other PointerTo, it will be freed when the last reference count is

  • removed).

*/

get_mode()

C++ Interface: get_mode()

/**
  • Returns the fundamental operating mode of the TextureStagePool. See

  • set_mode().

*/

get_stage()

C++ Interface: get_stage(TextureStage temp)

/**
  • Returns a TextureStage pointer that represents the same TextureStage

  • described by temp, except that it is a shared pointer.

  • Each call to get_stage() passing an equivalent TextureStage pointer will

  • return the same shared pointer.

  • If you modify the shared pointer, it will automatically disassociate it

  • from the pool.

  • Also, the return value may be a different pointer than that passed in, or

  • it may be the same pointer. In either case, the passed in pointer has now

  • been sacrificed to the greater good and should not be used again (like any

  • other PointerTo, it will be freed when the last reference count is

  • removed).

*/

listContents()

C++ Interface: list_contents(ostream out)

/**
  • Lists the contents of the TextureStage pool to the indicated output stream.

*/

list_contents()

C++ Interface: list_contents(ostream out)

/**
  • Lists the contents of the TextureStage pool to the indicated output stream.

*/

mode = 0
releaseAllStages()

C++ Interface: release_all_stages()

/**
  • Releases all TextureStages in the pool and restores the pool to the empty

  • state.

*/

releaseStage()

C++ Interface: release_stage(TextureStage temp)

/**
  • Removes the indicated TextureStage from the pool.

*/

release_all_stages()

C++ Interface: release_all_stages()

/**
  • Releases all TextureStages in the pool and restores the pool to the empty

  • state.

*/

release_stage()

C++ Interface: release_stage(TextureStage temp)

/**
  • Removes the indicated TextureStage from the pool.

*/

setMode()

C++ Interface: set_mode(int mode)

/**
  • Specifies the fundamental operating mode of the TextureStagePool.

  • If this is M_none, each call to get_stage() returns the same TextureStage

  • pointer that was passed in (the pool is effectively disabled). If this is

  • M_name, each call to get_stage() returns the last TextureStage passed in

  • with the same name, whether it has different properties or not. If this is

  • M_unique, then each call to get_stage() returns only TextureStages with

  • identical properties.

*/

set_mode()

C++ Interface: set_mode(int mode)

/**
  • Specifies the fundamental operating mode of the TextureStagePool.

  • If this is M_none, each call to get_stage() returns the same TextureStage

  • pointer that was passed in (the pool is effectively disabled). If this is

  • M_name, each call to get_stage() returns the last TextureStage passed in

  • with the same name, whether it has different properties or not. If this is

  • M_unique, then each call to get_stage() returns only TextureStages with

  • identical properties.

*/

write()

C++ Interface: write(ostream out)

/**
  • Lists the contents of the TextureStage pool to the indicated output stream.

*/