Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/blender/makesdna/DNA_scene_types.h8
-rw-r--r--source/blender/makesrna/intern/rna_scene.c12
2 files changed, 19 insertions, 1 deletions
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index 5e877ed697b..dd194ed389f 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -652,7 +652,8 @@ typedef struct GameData {
short mode, matmode;
short occlusionRes; /* resolution of occlusion Z buffer in pixel */
short physicsEngine;
- short exitkey, pad;
+ short exitkey;
+ short vsync; /* Controls vsync: off, on, or adaptive (if supported) */
short ticrate, maxlogicstep, physubstep, maxphystep;
short obstacleSimulation;
short raster_storage;
@@ -688,6 +689,11 @@ typedef struct GameData {
#define RAS_STORE_VA 2
#define RAS_STORE_VBO 3
+/* vsync */
+#define VSYNC_OFF 0
+#define VSYNC_ON 1
+#define VSYNC_ADAPTIVE 2
+
/* GameData.flag */
#define GAME_RESTRICT_ANIM_UPDATES (1 << 0)
#define GAME_ENABLE_ALL_FRAMES (1 << 1)
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index d6dc2162720..a0e1e29ab55 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -3126,6 +3126,13 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
{0, NULL, 0, NULL, NULL}
};
+ static EnumPropertyItem vsync_items[] = {
+ {VSYNC_OFF, "OFF", 0, "Off", "Disables vsync"},
+ {VSYNC_ON, "ON", 0, "On", "Enables vsync"},
+ {VSYNC_ADAPTIVE, "ADAPTIVE", 0, "Adaptive", "Enables adaptive vsync (if supported)"},
+ {0, NULL, 0, NULL, NULL}
+ };
+
static EnumPropertyItem storage_items[] = {
{RAS_STORE_AUTO, "AUTO", 0, "Auto Select", "Chooses the best supported mode"},
{RAS_STORE_IMMEDIATE, "IMMEDIATE", 0, "Immediate Mode", "Slowest performance, requires OpenGL (any version)"},
@@ -3152,6 +3159,11 @@ static void rna_def_scene_game_data(BlenderRNA *brna)
RNA_def_property_range(prop, 4, 10000);
RNA_def_property_ui_text(prop, "Resolution Y", "Number of vertical pixels in the screen");
RNA_def_property_update(prop, NC_SCENE, NULL);
+
+ prop = RNA_def_property(srna, "vsync", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "vsync");
+ RNA_def_property_enum_items(prop, vsync_items);
+ RNA_def_property_ui_text(prop, "Vsync", "Change vsync settings");
prop = RNA_def_property(srna, "samples", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "aasamples");