| @@ -1 +1 @@ | |||||
| Subproject commit d1ecc17a687cdade92954e548249a7f747aec392 | |||||
| Subproject commit 3a77a1144f4cb53ded4fb9194eded380bdfa9316 | |||||
| @@ -18,7 +18,7 @@ WINDRES ?= windres | |||||
| ifeq ($(WIN32),true) | ifeq ($(WIN32),true) | ||||
| TARGETS = app.exe color.exe demo.exe demo-multi images.exe nanovg.exe rectangles.exe shapes.exe text.exe | TARGETS = app.exe color.exe demo.exe demo-multi images.exe nanovg.exe rectangles.exe shapes.exe text.exe | ||||
| else | else | ||||
| TARGETS = app color demo demo-multi images nanovg nanovg2 rectangles shapes text | |||||
| TARGETS = app blendish color demo demo-multi images nanovg nanovg2 rectangles shapes text | |||||
| endif | endif | ||||
| # -------------------------------------------------------------- | # -------------------------------------------------------------- | ||||
| @@ -42,6 +42,9 @@ debug: | |||||
| app: app.cpp ../dpf/dgl/* | app: app.cpp ../dpf/dgl/* | ||||
| $(CXX) $< $(BUILD_CXX_FLAGS) $(LINK_FLAGS) -o $@ | $(CXX) $< $(BUILD_CXX_FLAGS) $(LINK_FLAGS) -o $@ | ||||
| blendish: blendish.cpp ../dpf/dgl/* | |||||
| $(CXX) $< $(BUILD_CXX_FLAGS) $(LINK_FLAGS) -o $@ | |||||
| color: color.cpp widgets/ExampleColorWidget.hpp ../dpf/dgl/* | color: color.cpp widgets/ExampleColorWidget.hpp ../dpf/dgl/* | ||||
| $(CXX) $< $(BUILD_CXX_FLAGS) $(LINK_FLAGS) -o $@ | $(CXX) $< $(BUILD_CXX_FLAGS) $(LINK_FLAGS) -o $@ | ||||
| @@ -0,0 +1,62 @@ | |||||
| /* | |||||
| * DISTRHO Plugin Framework (DPF) | |||||
| * Copyright (C) 2012-2015 Filipe Coelho <falktx@falktx.com> | |||||
| * | |||||
| * Permission to use, copy, modify, and/or distribute this software for any purpose with | |||||
| * or without fee is hereby granted, provided that the above copyright notice and this | |||||
| * permission notice appear in all copies. | |||||
| * | |||||
| * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD | |||||
| * TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN | |||||
| * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL | |||||
| * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER | |||||
| * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN | |||||
| * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |||||
| */ | |||||
| // ------------------------------------------------------ | |||||
| // DGL Stuff | |||||
| #include "NanoVG.hpp" | |||||
| #include "StandaloneWindow.hpp" | |||||
| // ------------------------------------------------------ | |||||
| // use namespace | |||||
| using DGL::NanoWidget; | |||||
| using DGL::StandaloneWindow; | |||||
| using DGL::Window; | |||||
| // ------------------------------------------------------ | |||||
| // Test | |||||
| class TestWidget : public NanoWidget | |||||
| { | |||||
| public: | |||||
| TestWidget(Window& parent) | |||||
| : NanoWidget(parent) | |||||
| { | |||||
| } | |||||
| protected: | |||||
| void onNanoDisplay() override | |||||
| { | |||||
| } | |||||
| }; | |||||
| // ------------------------------------------------------ | |||||
| // main entry point | |||||
| int main() | |||||
| { | |||||
| StandaloneWindow win; | |||||
| TestWidget w(win); | |||||
| win.setSize(500, 500); | |||||
| win.setTitle("Blendish"); | |||||
| win.exec(); | |||||
| return 0; | |||||
| } | |||||
| // ------------------------------------------------------ | |||||
| @@ -62,7 +62,7 @@ public: | |||||
| curHover(-1) | curHover(-1) | ||||
| { | { | ||||
| // for text | // for text | ||||
| font = nvg.createFont("sans", "./nanovg_res/Roboto-Regular.ttf"); | |||||
| font = nvg.createFontFromFile("sans", "./nanovg_res/Roboto-Regular.ttf"); | |||||
| using namespace DemoArtwork; | using namespace DemoArtwork; | ||||
| img1.loadFromMemory(ico1Data, ico1Width, ico1Height, GL_BGR); | img1.loadFromMemory(ico1Data, ico1Width, ico1Height, GL_BGR); | ||||
| @@ -55,18 +55,18 @@ public: | |||||
| { | { | ||||
| char file[128]; | char file[128]; | ||||
| std::snprintf(file, 128, "./nanovg_res/images/image%d.jpg", i+1); | std::snprintf(file, 128, "./nanovg_res/images/image%d.jpg", i+1); | ||||
| fImages[i] = createImage(file, 0); | |||||
| fImages[i] = createImageFromFile(file, 0); | |||||
| if (fImages[i] == nullptr) | |||||
| if (! fImages[i].isValid()) | |||||
| { | { | ||||
| d_stdout("Could not load %s.", file); | d_stdout("Could not load %s.", file); | ||||
| return; | return; | ||||
| } | } | ||||
| } | } | ||||
| fFontIcons = createFont("icons", "./nanovg_res/entypo.ttf"); | |||||
| fFontNormal = createFont("sans", "./nanovg_res/Roboto-Regular.ttf"); | |||||
| fFontBold = createFont("sans-bold", "./nanovg_res/Roboto-Bold.ttf"); | |||||
| fFontIcons = createFontFromFile("icons", "./nanovg_res/entypo.ttf"); | |||||
| fFontNormal = createFontFromFile("sans", "./nanovg_res/Roboto-Regular.ttf"); | |||||
| fFontBold = createFontFromFile("sans-bold", "./nanovg_res/Roboto-Bold.ttf"); | |||||
| } | } | ||||
| protected: | protected: | ||||
| @@ -123,7 +123,7 @@ protected: | |||||
| private: | private: | ||||
| FontId fFontNormal, fFontBold, fFontIcons; | FontId fFontNormal, fFontBold, fFontIcons; | ||||
| ScopedPointer<NanoImage> fImages[12]; | |||||
| NanoImage fImages[12]; | |||||
| void drawEyes(float x, float y, float w, float h, float mx, float my, float t) | void drawEyes(float x, float y, float w, float h, float mx, float my, float t) | ||||
| { | { | ||||
| @@ -36,7 +36,7 @@ class ExampleTextWidget : public NanoWidget | |||||
| public: | public: | ||||
| ExampleTextWidget(Window& parent) | ExampleTextWidget(Window& parent) | ||||
| : NanoWidget(parent), | : NanoWidget(parent), | ||||
| fFont(createFont("sans", "./nanovg_res/Roboto-Regular.ttf")) | |||||
| fFont(createFontFromFile("sans", "./nanovg_res/Roboto-Regular.ttf")) | |||||
| { | { | ||||
| setSize(500, 300); | setSize(500, 300); | ||||
| } | } | ||||
| @@ -118,7 +118,7 @@ public: | |||||
| std::memset(fValues, 0, sizeof(float)*kHistoryCount); | std::memset(fValues, 0, sizeof(float)*kHistoryCount); | ||||
| createFont("sans", "./nanovg_res/Roboto-Regular.ttf"); | |||||
| createFontFromFile("sans", "./nanovg_res/Roboto-Regular.ttf"); | |||||
| prevt = gTime.getTime(); | prevt = gTime.getTime(); | ||||
| } | } | ||||