@@ -4,13 +4,14 @@ In this document, Mod is Ctrl on Windows/Linux and Cmd on Mac. | |||||
### 1.1.5 (in development) | ### 1.1.5 (in development) | ||||
- Swap order of tags and brands in Module Browser. | - Swap order of tags and brands in Module Browser. | ||||
- Disable smoothing for MIDI CC buttons in MIDI-Map. | |||||
- Automatically unzip update on Mac. | |||||
- Stop worker threads when engine is paused to save CPU. | |||||
- Add Engine > Frame rate menu bar item. | |||||
- Hide menu and scrollbars when fullscreen. | - Hide menu and scrollbars when fullscreen. | ||||
- Add key command (F3) for engine CPU meter. | - Add key command (F3) for engine CPU meter. | ||||
- Add numpad key commands. | - Add numpad key commands. | ||||
- Automatically unzip update on Mac. | |||||
- Stop worker threads when engine is paused to save CPU. | |||||
- Core | - Core | ||||
- Disable smoothing for MIDI CC buttons in MIDI-Map. | |||||
- Fix sustain pedal release bug when using polyphonic mode in MIDI-CV. | - Fix sustain pedal release bug when using polyphonic mode in MIDI-CV. | ||||
- API | - API | ||||
- Add libsamplerate library. | - Add libsamplerate library. | ||||
@@ -327,6 +327,30 @@ struct CursorLockItem : ui::MenuItem { | |||||
} | } | ||||
}; | }; | ||||
struct FrameRateValueItem : ui::MenuItem { | |||||
int frameSwapInterval; | |||||
void onAction(const event::Action& e) override { | |||||
settings::frameSwapInterval = frameSwapInterval; | |||||
} | |||||
}; | |||||
struct FrameRateItem : ui::MenuItem { | |||||
ui::Menu* createChildMenu() override { | |||||
ui::Menu* menu = new ui::Menu; | |||||
for (int i = 1; i <= 6; i++) { | |||||
float frameRate = 60.f / i; | |||||
FrameRateValueItem* item = new FrameRateValueItem; | |||||
item->frameSwapInterval = i; | |||||
item->text = string::f("%.0f Hz", frameRate); | |||||
item->rightText += CHECKMARK(settings::frameSwapInterval == i); | |||||
menu->addChild(item); | |||||
} | |||||
return menu; | |||||
} | |||||
}; | |||||
struct FullscreenItem : ui::MenuItem { | struct FullscreenItem : ui::MenuItem { | ||||
void onAction(const event::Action& e) override { | void onAction(const event::Action& e) override { | ||||
APP->window->setFullScreen(!APP->window->isFullScreen()); | APP->window->setFullScreen(!APP->window->isFullScreen()); | ||||
@@ -366,6 +390,10 @@ struct ViewButton : MenuButton { | |||||
cableTensionSlider->box.size.x = 200.0; | cableTensionSlider->box.size.x = 200.0; | ||||
menu->addChild(cableTensionSlider); | menu->addChild(cableTensionSlider); | ||||
FrameRateItem* frameRateItem = new FrameRateItem; | |||||
frameRateItem->text = "Frame rate"; | |||||
menu->addChild(frameRateItem); | |||||
FullscreenItem* fullscreenItem = new FullscreenItem; | FullscreenItem* fullscreenItem = new FullscreenItem; | ||||
fullscreenItem->text = "Fullscreen"; | fullscreenItem->text = "Fullscreen"; | ||||
fullscreenItem->rightText = "F11"; | fullscreenItem->rightText = "F11"; | ||||
@@ -56,11 +56,6 @@ void Scene::step() { | |||||
void Scene::draw(const DrawArgs& args) { | void Scene::draw(const DrawArgs& args) { | ||||
Widget::draw(args); | Widget::draw(args); | ||||
// nvgBeginPath(args.vg); | |||||
// nvgRect(args.vg, 0, 0, box.size.x, box.size.y); | |||||
// nvgFillColor(args.vg, color::mult(color::WHITE, APP->window->frame % 2)); | |||||
// nvgFill(args.vg); | |||||
} | } | ||||
void Scene::onHoverKey(const event::HoverKey& e) { | void Scene::onHoverKey(const event::HoverKey& e) { | ||||
@@ -325,7 +325,10 @@ Window::~Window() { | |||||
void Window::run() { | void Window::run() { | ||||
frame = 0; | frame = 0; | ||||
while (!glfwWindowShouldClose(win)) { | while (!glfwWindowShouldClose(win)) { | ||||
frameTimeStart = glfwGetTime(); | |||||
double frameTime = glfwGetTime(); | |||||
// double frameRate = 1.0 / (frameTime - frameTimeStart); | |||||
// DEBUG("%g fps", frameRate); | |||||
frameTimeStart = frameTime; | |||||
// Make event handlers and step() have a clean nanovg context | // Make event handlers and step() have a clean nanovg context | ||||
nvgReset(vg); | nvgReset(vg); | ||||
@@ -406,9 +409,6 @@ void Window::run() { | |||||
glfwSwapBuffers(win); | glfwSwapBuffers(win); | ||||
// Compute actual frame rate | |||||
double frameTimeEnd = glfwGetTime(); | |||||
DEBUG("%g fps", 1 / (frameTimeEnd - frameTimeStart)); | |||||
frame++; | frame++; | ||||
} | } | ||||
} | } | ||||