The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

st/gui: Add discrete steps in video preview scale

+31
+31
src/xrt/state_trackers/gui/gui_window_record.c
··· 198 198 { 199 199 igSliderFloat("", &rw->texture.scale, 20.0, 300.f, "Scale %f%%", ImGuiSliderFlags_None); 200 200 201 + static ImVec2 button_dims = {0, 0}; 202 + 203 + igSameLine(0.0f, 4.0f); 204 + bool minus = igButton("-", button_dims); 205 + 206 + igSameLine(0.0f, 4.0f); 207 + bool plus = igButton("+", button_dims); 208 + 209 + const static double scales[] = { 210 + 25.0, 50.0, 100.0, 200.0, 300.0, 211 + }; 212 + 213 + if (plus) { 214 + for (uint32_t i = 0; i < ARRAY_SIZE(scales); i++) { 215 + if (rw->texture.scale >= scales[i]) { 216 + continue; 217 + } 218 + rw->texture.scale = scales[i]; 219 + break; 220 + } 221 + } else if (minus) { 222 + // Initial length always greater then 0 so safe. 223 + for (uint32_t i = ARRAY_SIZE(scales); i-- > 0;) { 224 + if (rw->texture.scale <= scales[i]) { 225 + continue; 226 + } 227 + rw->texture.scale = scales[i]; 228 + break; 229 + } 230 + } 231 + 201 232 igSameLine(0, 30); 202 233 203 234 igCheckbox("Rotate 180 degrees", &rw->texture.rotate_180);