pfFluxMemory(3pf) OpenGL Performer 3.2.2 libpr C Reference Pages
NAME
pfGetFluxMemoryClassType, pfGetFluxMemoryFlux, pfGetFluxMemory - Manage a
pfFluxMemory
FUNCTION SPECIFICATION
#include <Performer/pr.h>
pfType* pfGetFluxMemoryClassType(void);
pfFlux* pfGetFluxMemoryFlux(pfFluxMemory* fmem);
pfFluxMemory* pfGetFluxMemory(void* data);
PARENT CLASS FUNCTIONS
The OpenGL Performer class pfFluxMemory is derived from the parent class
pfMemory, so each of these member functions of class pfMemory are also
directly usable with objects of class pfFluxMemory. Casting an object of
class pfFluxMemory to an object of class pfMemory is taken care of
automatically. This is also true for casts to objects of ancestor
classes of class pfMemory.
pfType * pfGetType(const void *ptr);
int pfIsOfType(const void *ptr, pfType *type);
int pfIsExactType(const void *ptr, pfType *type);
const char * pfGetTypeName(const void *ptr);
int pfRef(void *ptr);
int pfUnref(void *ptr);
int pfUnrefDelete(void *ptr);
int pfUnrefGetRef(void *ptr);
int pfGetRef(const void *ptr);
int pfCopy(void *dst, void *src);
int pfDelete(void *ptr);
int pfIsFluxed(void *ptr);
int pfCompare(const void *ptr1, const void *ptr2);
void pfPrint(const void *ptr, uint which, uint verbose,
FILE *file);
void * pfGetArena(void *ptr);
PARAMETERS
fmem identifies a pfFlux.
DESCRIPTION
A pfFluxMemory is a data buffer of a pfFlux. It has a header and them a
data portion. A pfFluxMemory should never be created or destroyed
separate from its parent pfFlux.
pfGetFluxMemoryClassType returns the pfType* for the class pfFluxMemory.
The pfType* returned by pfGetFluxMemoryClassType is the same as the
pfType* returned by invoking pfGetType on any instance of class
pfFluxMemory.
pfGetFluxMemoryFlux returns a pointer to the parent pfFlux of a
Page 1
pfFluxMemory(3pf) OpenGL Performer 3.2.2 libpr C Reference Pages
pfFluxMemory.
pfGetFluxMemory returns a pointer to the pfFluxMemory that data points to
the data portion of.
The data portion of a pfFluxMemory can be converted into a fluxed form of
any Performer object that is derived from pfMemory. This should only be
done in the initFunc of a pfFlux. Although any Performer object can be
fluxed, only certain Performer objects have been modified to accept
fluxed forms of the objects they connect to. The following table lists
what can take what.
parent object fluxed child
____________________________
pfGeode pfGeoSet
|
Example of turning the data portion of a pfFluxMemory into a fluxed
pfGeoSet. This is how pfFluxedGSetInit() is implemented. Note: This
can only be done in C++.
int pfFluxedGSetInit(pfFluxMemory *fmem)
{
if (fmem == NULL)
return sizeof(pfGeoSet);
new(fmem) pfGeoSet;
return 0;
}
Example of creating a pfFlux containing fluxed pfGeoSets:
int make_fluxed_gset(pfFluxMemory *fmem)
{
pfGeoSet *gset;
pfVec3 *coords;
if (fmem == NULL)
return pfFluxedGSetInit(fmem);
pfFluxedGSetInit(fmem);
gset = (pfGeoSet*)fmem->getData();
pfGSetPrimType(gset, PFGS_TRIS);
... finish initializing pfGeoSet
Page 2
pfFluxMemory(3pf) OpenGL Performer 3.2.2 libpr C Reference Pages
return 0;
}
main()
{
pfFlux *fluxed_gset;
pfGeoSet *gset;
pfInit();
pfConfig();
fluxed_gset = pfNewFluxInitFunc(make_fluxed_gset,
PFFLUX_DEFAULT_NUM_BUFFERS,
pfGetSharedArena());
gset = (pfGeoSet*)pfFluxGetCurData(fluxed_gset);
...
}
SEE ALSO
pfFlux, pfMemory, pfFluxedGSetInit
Page 3