formZ SDK | 5.0 API Reference | Project | Modeling | Rendering | Shaders

# fz_shdr_set_menu_parm

Description

This function can only be called inside the set_parameters callback function when implementing a plugin or script shader. It declares an integer shader parameter, which will show up in the shader options dialog as a menu with a title. The menu items are passed in as an array of strings. A horizontal divider line can be created in the menu by passing a "-" as a menu string.

Plugin Prototype

fzrt_error_td fz_shdr_set_menu_parm(

char * | name,
fz_string_td * | menu_str,
fzrt_int | n_menu_str,
fzrt_int | val,
fzrt_int | id )

Parameters

name [Input]

The title of the menu, as shown in the shader options dialog

menu_str [Input]

An array of strings, each array item being a menu string item. If a "-" is passed as a string, a horizontal menu item divider line is created.

n_menu_str [Input]

The number of strings in the menu_str array

val [Input]

The default value as a zero based index into the menu

id [Input]

if passed in as -1, this function will create a unique id, with which the value of this parameter can be retrieved using the API . This id will be returned by the function in its return value. If a value other than -1 is passed in, it will be used as the unique id. It is the responsibility of the calling code to make sure, that the id is not used again in another fz_shdr_set_xxx_parm function

Returns

unique id for this parameter.

Availability

5.5.0.0

Function Set

fz_shdr_fset

Defined in

fz_rzne_shdr_api.h