Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions source/common/vutu.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#include <stdlib.h>
#include <stdio.h>

Expand Down Expand Up @@ -87,20 +86,22 @@ int main(int argc, char *argv[])

// set initial size. This is not a fixed-ratio app, meaning the window sizes
// freely and the grid unit size remains constant.
appView.setSizeInGridUnits(kDefaultGridUnits);
appView.setGridSizeDefault(kDefaultGridUnitSize * devScale);

// get default rect
Vec2 defaultSize = kDefaultGridUnits * kDefaultGridUnitSize * devScale;
Rect boundsRect(0, 0, defaultSize.x(), defaultSize.y());
Rect defaultRect = alignCenterToPoint(boundsRect, c);

SDL_Window *window = initSDLWindow(appView, defaultRect, "vutu");
// Create SDL window with default rect
SDL_Window *window = newSDLWindow(defaultRect, "vutu", 0);

if(window)
{
// watch for window resize events during drag
// Create watcher data for window resizing
ResizingEventWatcherData watcherData{window, &appView};
SDL_AddEventWatch( resizingEventWatcher, &watcherData );

SDL_AddEventWatch(resizingEventWatcher, &watcherData);

// make Processor
VutuProcessor appProcessor(getAppName(), instanceNum, kInputChannels, kOutputChannels, kSampleRate, pdl);
Expand Down Expand Up @@ -141,5 +142,3 @@ int main(int argc, char *argv[])

return 0;
}


15 changes: 8 additions & 7 deletions source/common/vutuView.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
// mlvg: GUI library for madronalib
// (c) 2020, Madrona Labs LLC, all rights reserved
// see LICENSE.txt for details

#include "vutuView.h"

#include "madronalib.h"
Expand Down Expand Up @@ -496,7 +492,12 @@ void VutuView::onMessage(Message msg)
}
}

void VutuView::setSizeInGridUnits(const Vec2& size)
{
// Implementation of setSizeInGridUnits
}




void VutuView::createPlatformView(void* windowPtr, int flags)
{
// Implementation of createPlatformView
}
7 changes: 6 additions & 1 deletion source/common/vutuView.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ const ml::Rect kDefaultPopupStartRect{0, 0, 1, 1};


class VutuView final :
public ml::AppView
public ml::AppView,
public ml::PlatformView
{
public:
VutuView(TextFragment appName, size_t instanceNum);
Expand All @@ -39,4 +40,8 @@ class VutuView final :

// VutuView interface
void makeWidgets(const ParameterDescriptionList& pdl);

// New member functions
void setSizeInGridUnits(const Vec2& size);
void createPlatformView(void* windowPtr, int flags);
};