diff --git a/.gitignore b/.gitignore index 7872050..7bb5fd8 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,5 @@ examples/app examples/color +examples/demo examples/images diff --git a/examples/Makefile b/examples/Makefile index 30129f5..1ff22bb 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -14,9 +14,9 @@ LINK_FLAGS += -L../dpf -ldgl $(DGL_LIBS) # -------------------------------------------------------------- ifeq ($(WIN32),true) -TARGETS = app.exe color.exe images.exe +TARGETS = app.exe color.exe demo.exe images.exe else -TARGETS = app color images +TARGETS = app color demo images endif # -------------------------------------------------------------- @@ -48,6 +48,9 @@ app: app.cpp ../dpf/dgl/* color: color.cpp ../dpf/dgl/* $(CXX) $< $(BUILD_CXX_FLAGS) $(LINK_FLAGS) -o $@ +demo: demo.cpp ../dpf/dgl/* + $(CXX) $< $(BUILD_CXX_FLAGS) $(LINK_FLAGS) -o $@ + images: images.cpp images_src/* ../dpf/dgl/* $(CXX) $< $(BUILD_CXX_FLAGS) $(LINK_FLAGS) -o $@ diff --git a/examples/demo.cpp b/examples/demo.cpp new file mode 100644 index 0000000..3126ddb --- /dev/null +++ b/examples/demo.cpp @@ -0,0 +1,60 @@ +/* + * DISTRHO Plugin Framework (DPF) + * Copyright (C) 2012-2014 Filipe Coelho + * + * 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 "App.hpp" +#include "Window.hpp" +#include "Widget.hpp" + +// ------------------------------------------------------ +// use namespace + +using namespace DGL; + +// ------------------------------------------------------ +// Our Demo Window + +class DemoWindow : public Window +{ +public: + DemoWindow(App& app) + : Window(app) + { + setSize(300, 300); + setTitle("DGL Demo"); + } + +private: + // here +}; + +// ------------------------------------------------------ +// main entry point + +int main() +{ + App app; + DemoWindow win(app); + + win.show(); + app.exec(); + + return 0; +} + +// ------------------------------------------------------