Texture EditorAvailability LightWave 6.0 This global provides access to a user interface for editing textures. If you use XPanels with vparms that can be textured, the interaction with the texture editor is handled for you, and you don't need this global. But if your interface is built with classic Panels or OS-specific elements, you can use this global to provide your users with the standard texture interface. Global Call LWTxtrEdFuncs *txedf; txedf = global( LWTXTREDFUNCS_GLOBAL, GFUSE_TRANSIENT ); The global function returns a pointer to an LWTxtrEdFuncs. typedef struct st_LWTxtrEdFuncs { LWTECltID (*subscribe) (char *title, int flags, void *userData, LW_TxtrRemoveFunc *, LW_TxtrAutoSizeFunc *, LW_TxtrEventFunc *); void (*unsubscribe) (LWTECltID); void (*open) (LWTECltID, LWTextureID, char *title); void (*setTexture) (LWTECltID, LWTextureID, char *title); void (*setPosition) (LWTECltID, int, int); void (*close) (LWTECltID); int (*isOpen) (LWTECltID); int (*refresh) (LWTECltID); LWTLayerID (*currentLayer)(LWTECltID); int (*selectAdd) (LWTECltID, LWTextureID); int (*selectRem) (LWTECltID, LWTextureID); int (*selectClr) (LWTECltID); LWTextureID (*selectFirst) (LWTECltID); LWTextureID (*selectNext) (LWTECltID, LWTextureID); void (*setGradientAutoSize)(LWTECltID, LW_GradAutoSizeFunc *); } LWTxtrEdFuncs;
Callbacks The callbacks passed to subscribe and setGradientAutoSize allow you to react to user actions in the editor. typedef void LW_TxtrRemoveFunc (LWTextureID, void *userData); typedef int LW_TxtrAutoSizeFunc (LWTextureID, void *userData, double bbox[3][2]); typedef int LW_GradAutoSizeFunc (LWTxtrParamDesc *param, int paramNb, void *userData); typedef int LW_TxtrEventFunc (LWTextureID, void *userData, int eventCode); The remove callback is called when a texture is removed. The texture autosize callback is called when the user has requested that the texture size be set automatically. The bounding box array should be set to the default size of the texture. The gradient autosize callback is called for automatic sizing of gradient layers. The size should be set in the parameter description. See the Texture Functions global for a description of the LWTxtrParamDesc structure. The event callback is called when the texture settings are modified by the user. This gives you a chance to update thumbnails or other aspects of your interface that depend on the texture settings. The event code can be one of the following.
Example The txchan and atmosphere samples use Texture Editor functions. |