Skip to content

Add tooltip annotation and replace deprecated obs_properties_add_button - #101

Merged
exeldro merged 1 commit into
exeldro:masterfrom
andilippi:feat/tooltip-annotation
May 21, 2026
Merged

Add tooltip annotation and replace deprecated obs_properties_add_button#101
exeldro merged 1 commit into
exeldro:masterfrom
andilippi:feat/tooltip-annotation

Conversation

@andilippi

Copy link
Copy Markdown

Summary

Two changes to obs-shaderfilter.c:

  • New tooltip annotation on shader uniforms. Writing string tooltip = "..."; inside any uniform's annotation block applies the string via obs_property_set_long_description, so OBS shows the description on hover. Wired through every property type: bool, float, int, vec2, vec3, vec4, texture, string. For vector slider variants (vec2/vec3/vec4 with widget_type = "slider") the tooltip applies to each sub-axis, so hovering X, Y, Z or W all surface the same hint.
  • Replaces the deprecated obs_properties_add_button call for the Reload Effect button with obs_properties_add_button2. The old API produces a C4996: was declared deprecated warning that breaks the build under warnings-as-errors against current OBS headers. The other button call in this file (shader_convert) was already on the new API, so this is just one straggler. Behaviour is unchanged: the callback already had the (props, property, data) signature the new API expects, and the data pointer that used to come implicitly through obs_properties_set_param is now passed explicitly in the call.

Usage example

uniform float MySlider <
    string label = "My Slider";
    string tooltip = "Shown on hover in the property panel.";
    string widget_type = "slider";
    float minimum = 0.0;
    float maximum = 1.0;
    float step    = 0.01;
> = 0.5;

Test plan

  • Existing example shaders still parse and render their properties correctly
  • Adding string tooltip = "..."; to a uniform shows the description on hover
  • Vector sliders (vec2/3/4) show the same tooltip on every axis
  • Reload Effect button still reloads the effect when clicked
  • Build is clean against current OBS headers (no C4996)

- Parses a new `string tooltip = "...";` annotation on any shader
  uniform and applies it via `obs_property_set_long_description`, so
  OBS shows the description on hover. Applied to every property type
  (bool, float, int, vec2/3/4, texture, string). Vector slider variants
  apply the tooltip to each sub-axis so hovering X, Y, Z or W all
  surface the same hint.
- Replaces the deprecated `obs_properties_add_button` call for the
  Reload Effect button with `obs_properties_add_button2`. The old API
  produces a C4996 deprecation warning that breaks the build under
  warnings-as-errors against current OBS headers. The other button call
  in this file already uses the new API. Behaviour is unchanged.
@exeldro
exeldro merged commit 851c61e into exeldro:master May 21, 2026
6 of 7 checks passed
myrqyry pushed a commit to myrqyry/obs-shaderfilter that referenced this pull request May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants