PEX Resources


For and overview and related topics, see Introduction to PEXlib.

PEX defines a number of resources that you create, manipulate, and destroy, using the functions defined in this specification. These resources behave identically to X resources. For example, PEX resources may be shared among clients and are automatically destroyed by the implementation when no longer referenced.

Some PEX resources contain references to other PEX resources. For example, the Pipeline Context resource contains references to PEX Name Set resources. If you reference a resource from another resource and then destroy the referenced resource, then you can no longer access the destroyed resource using PEXlib functions because the resource identifier is no longer valid. However, the destroyed resource actually remains intact while it is still being referenced by the other resource. This is necessary because the implementation may still need to access the resource during a rendering operation, for example. If a resource is destroyed, then the implementation changes the resource identifiers in all references to the destroyed resource to the value PEXAlreadyFreed to indicate that this resource has been destroyed and cannot be manipulated further. You can replace the reference to the resource id of a freed resource with that of another existing resource. When the last reference to a freed resource is removed, the implementation actually frees the resource.

In some instances, you may want to replace a resource reference with a null reference or something that indicates that no resource at all is referenced. For example, you may be using a depth cue LUT resource by referencing it from a renderer resource. If you want the renderer to go back to using the default PEX-defined fallback values for depth cue tables, you remove the renderer's reference to the depth cue LUT resource by changing the renderer's depth cue LUT resource attribute to None. None is defined in <X11/Xlib.h>.