You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: platform_vsync_windows.cpp
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -139,7 +139,7 @@ int first_scanline_in_display = -1;
139
139
int last_scanline_before_display = 0; //first line must always be vsync, according to ToastyX.
140
140
//future: Mark Rejhon reports that D3DKMTGetScanLine takes 8 scanlines on his 1080 Ti; maybe his code has a problem? he suspects maybe it's just slow on Nvidia cards
141
141
//future: Mark Rejhon reports that the scanline counter doesn't increment properly in the porch (when InVerticalBlank is true). I should investigate that when I get a new graphics card. it works fine on my Intel HD 4000
142
-
uint64_tget_scanline() {
142
+
uintget_scanline() {
143
143
auto result = D3DKMTGetScanLine(&scanline_windows); //runtime is 0.005-0.015 ms on my Intel HD 4000. 1000 calls in a loop takes 2-5 ms.
144
144
//standard deviation is 0.004 ms. Quantization error of the scanline is (16.666/1125/sqrt12 = 0.00427 ms). that means D3DKMTGetScanLine() is perfectly accurate up to its theoretical limit.
single_def double mouse_x_raw[2] = {0, 0}; //[0] is the more recent timepoint
9
10
single_def double mouse_y_raw[2] = {0, 0};
10
11
single_def uint64_t mouse_timepoint[2] = {0, 0};
11
-
double ticks_between_mouse_events = ticks_per_sec / 1000; //mouse sampling frequency. only has to be approximately correct. initial assumption is 1 ms. used to determine if the time after the last mouse input is because the mouse is still, or if it's just waiting for the next input
12
+
double ticks_between_mouse_events = ticks_per_sec / 1000.0; //mouse sampling frequency. only has to be approximately correct. initial assumption is 1 ms. used to determine if the time after the last mouse input is because the mouse is still, or if it's just waiting for the next input
12
13
13
14
//the mouse position is derived from the raw mouse position by extrapolation. it must be set before usage.
14
15
//for clicks and renders, these are cached automatically
0 commit comments