+static int
+stw_get_param(struct st_manager *smapi,
+ enum st_manager_param param)
+{
+ switch (param) {
+ case ST_MANAGER_BROKEN_INVALIDATE:
+ /*
+ * Force framebuffer validation on glViewport.
+ *
+ * Certain applications, like Rhinoceros 4, uses glReadPixels
+ * exclusively (never uses SwapBuffers), so framebuffers never get
+ * resized unless we check on glViewport.
+ */
+ return 1;
+ default:
+ return 0;
+ }
+}
+
+
+/** Get the refresh rate for the monitor, in Hz */
+static int
+get_refresh_rate(void)
+{
+ DEVMODE devModes;
+
+ if (EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &devModes)) {
+ /* clamp the value, just in case we get garbage */
+ return CLAMP(devModes.dmDisplayFrequency, 30, 120);
+ }
+ else {
+ /* reasonable default */
+ return 60;
+ }
+}
+