Skip to content

Commit

Permalink
Remove VSync and set frame limit manually
Browse files Browse the repository at this point in the history
  • Loading branch information
kuroni committed Nov 11, 2018
1 parent 9c6e7f0 commit 2d7a026
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
8 changes: 1 addition & 7 deletions src/data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,7 @@ void create_config()
"dash": [16]
},
"mania": {
"key": [68, 70, 74, 75].
"color": [
[0, 0, 255],
[255, 0, 0],
[255, 0, 0],
[0, 0, 255]
]
"key": [68, 70, 74, 75]
}
})V0G0N";
std::string error;
Expand Down
13 changes: 12 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,19 @@ sf::RenderWindow window;

int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{

window.create(sf::VideoMode(612, 352), "Bongo Cat for osu!", sf::Style::Titlebar | sf::Style::Close);
window.setVerticalSyncEnabled(true);

// get refresh rate and set the frame limit
DISPLAY_DEVICE device;
ZeroMemory(&device, sizeof(device));
device.cb = sizeof(device);
EnumDisplayDevices(NULL, (DWORD)0, &device, 0);
DEVMODE devmode;
ZeroMemory(&devmode, sizeof(DEVMODE));
devmode.dmSize = sizeof(DEVMODE);
EnumDisplaySettings((LPSTR)device.DeviceName, ENUM_REGISTRY_SETTINGS, &devmode);
window.setFramerateLimit(devmode.dmDisplayFrequency);

// loading configs
while (!data::init())
Expand Down

0 comments on commit 2d7a026

Please sign in to comment.