GDtexture_edit
Synopsis
define an editor for the Graphics Display Kit texture
GDtexture_edit_notify_templ
group _GDtexture_edit_notify_templ
{
enum tile { choices = {"Clamp", "Wrap", "Boundary"}; };
enum alpha { choices = {"Replace", "Modulate", "Decal"}; };
enum_filter { choices = {"Point", "Bilinear", "Trilinear"}; };
enum type { choices = {"Single Level", "Mip-Map"}; };
};
GDtexture_edit_templ
GDtexture_edit_notify_templ _GDtexture_edit_templ
{
int _shell_vis;
int reset;
GDtexture_templ+IPort2 _&texture;
method+notify_inst+notify_val upd_func = "GDtexture_edit_update";
};
GDtexture_edit
GDtexture_edit_templ_ GDtexture_edit
;
Description
These templates define an editor for the Graphics Display Kit texture. GDtexture_edit_notify_templ and GDtexture_edit_templ define the elements that cause the texture editor's method to execute. GDtexture_edit is the version you instance.
As an alternative to using GDtexture_edit and having to define your own user interface for the editor, you can use TextureEditor, an application component. TextureEditor contains GDtexture_edit and defines a user interface.
Input
shell_vis
The parameter controls whether the editor is active: 0 means it is not; 1 means it is.
shell_vis is only checked if the texture to which the editor is attached has changed. In this case, if shell_vis is not set to 1, the editor does not update. This inhibits updates to the editor's other subobjects -- which are normally attached to UI widgets -- when the user interface is not visible. The editor always executes when the values of the other parameters change. This means that the texture to which the editor is attached is always updated even if the user interface is not visible.
Typically you connect shell_vis to the same UIcmd object that the user selects to display the editor's user interface:
texture
The texture map controlled by the editor. texture is a connection to an object that matches type GDtexture_templ.
Parameters
tile
This parameter controls what happens when the UV(W) values are outside the 0-1 range:
Value
|
Meaning
|
Symbolic constant
|
0
|
Clamp UV(W) values that are outside the 0-1 range. Render using the primary color.
|
GD_TILE_CLAMP
|
1
|
Wrap UV(W) values that are outside the 0-1 range.
|
GD_TILE_WRAP
|
2
|
Clamp UV(W) values that are outside the 0-1 range. Render using the value at the texture's boundary.
|
GD_TILE_BOUNDARY
|
alpha
This parameter controls how to use the alpha value in the texture pixel to
control transparency:
Value
|
Meaning
|
Symbolic constant
|
0
|
Replace the alpha in the texture pixel with the object's transparency value
|
GD_ALPHA_REPLACE
|
1
|
Modulate the alpha in the texture pixel wth the object's transparency value
|
GD_ALPHA_MODULATE
|
filter
This parameter controls the type of filtering to be done when the texure is shrunk or expanded:
Value
|
Meaning
|
Symbolic constant
|
0
|
Perform point sampling.
|
GD_FILTER_POINT
|
1
|
Perform bilinear sampling
|
GD_FILTER_BILINEAR
|
2
|
Perform trilinear sampling
|
GD_FILTER_TRILINEAR
|
type
This parameter controls what type of texture is created:
.
Value
|
Meaning
|
Symbolic constant
|
0
|
Create an unfiltered texture map
|
GD_TYPE_UNFILTERED
|
1
|
Create a MipMapped texture map
|
GD_TYPE_MIPMAP
|
reset
This parameter when set causes the texture attached to the editor to be reset to its default values.
Example
Libraries.Graphics_Display.Editors.UI_Editors.TextureEditor
File
v/gd.v
See also related modules