Browse Source

Update to latest DPF; Start blendish test code file

pull/1/head
falkTX 10 years ago
parent
commit
e78678d9d4
7 changed files with 76 additions and 11 deletions
  1. +1
    -1
      dpf
  2. +4
    -1
      examples/Makefile
  3. +62
    -0
      examples/blendish.cpp
  4. +1
    -1
      examples/demo.cpp
  5. +6
    -6
      examples/nanovg2.cpp
  6. +1
    -1
      examples/widgets/ExampleTextWidget.hpp
  7. +1
    -1
      examples/widgets/NanoPerfWidget.hpp

+ 1
- 1
dpf

@@ -1 +1 @@
Subproject commit d1ecc17a687cdade92954e548249a7f747aec392
Subproject commit 3a77a1144f4cb53ded4fb9194eded380bdfa9316

+ 4
- 1
examples/Makefile View File

@@ -18,7 +18,7 @@ WINDRES ?= windres
ifeq ($(WIN32),true)
TARGETS = app.exe color.exe demo.exe demo-multi images.exe nanovg.exe rectangles.exe shapes.exe text.exe
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

# --------------------------------------------------------------
@@ -42,6 +42,9 @@ debug:
app: app.cpp ../dpf/dgl/*
$(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/*
$(CXX) $< $(BUILD_CXX_FLAGS) $(LINK_FLAGS) -o $@



+ 62
- 0
examples/blendish.cpp View File

@@ -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;
}

// ------------------------------------------------------

+ 1
- 1
examples/demo.cpp View File

@@ -62,7 +62,7 @@ public:
curHover(-1)
{
// for text
font = nvg.createFont("sans", "./nanovg_res/Roboto-Regular.ttf");
font = nvg.createFontFromFile("sans", "./nanovg_res/Roboto-Regular.ttf");

using namespace DemoArtwork;
img1.loadFromMemory(ico1Data, ico1Width, ico1Height, GL_BGR);


+ 6
- 6
examples/nanovg2.cpp View File

@@ -55,18 +55,18 @@ public:
{
char file[128];
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);
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:
@@ -123,7 +123,7 @@ protected:

private:
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)
{


+ 1
- 1
examples/widgets/ExampleTextWidget.hpp View File

@@ -36,7 +36,7 @@ class ExampleTextWidget : public NanoWidget
public:
ExampleTextWidget(Window& parent)
: NanoWidget(parent),
fFont(createFont("sans", "./nanovg_res/Roboto-Regular.ttf"))
fFont(createFontFromFile("sans", "./nanovg_res/Roboto-Regular.ttf"))
{
setSize(500, 300);
}


+ 1
- 1
examples/widgets/NanoPerfWidget.hpp View File

@@ -118,7 +118,7 @@ public:

std::memset(fValues, 0, sizeof(float)*kHistoryCount);

createFont("sans", "./nanovg_res/Roboto-Regular.ttf");
createFontFromFile("sans", "./nanovg_res/Roboto-Regular.ttf");

prevt = gTime.getTime();
}


Loading…
Cancel
Save