| @@ -64,12 +64,10 @@ carla-discovery-posix64 | |||||
| data/windows/Carla | data/windows/Carla | ||||
| source/tests/ANSI | source/tests/ANSI | ||||
| source/tests/Base64 | |||||
| source/tests/CarlaString | source/tests/CarlaString | ||||
| source/tests/DGL | |||||
| source/tests/Print | source/tests/Print | ||||
| source/tests/Rewire.cpp | |||||
| source/tests/RtList | source/tests/RtList | ||||
| source/tests/Thread | |||||
| source/tests/Utils | source/tests/Utils | ||||
| # Docs | # Docs | ||||
| @@ -0,0 +1 @@ | |||||
| ../libs/distrho/dgl/ | |||||
| @@ -55,6 +55,8 @@ | |||||
| // ------------------------------------------------- | // ------------------------------------------------- | ||||
| START_NAMESPACE_DGL | |||||
| enum Char { | enum Char { | ||||
| DGL_CHAR_BACKSPACE = 0x08, | DGL_CHAR_BACKSPACE = 0x08, | ||||
| DGL_CHAR_ESCAPE = 0x1B, | DGL_CHAR_ESCAPE = 0x1B, | ||||
| @@ -96,6 +98,10 @@ enum Modifier { | |||||
| DGL_MODIFIER_SUPER = 1 << 3 /**< Mod4/Command/Windows key */ | DGL_MODIFIER_SUPER = 1 << 3 /**< Mod4/Command/Windows key */ | ||||
| }; | }; | ||||
| END_NAMESPACE_DGL | |||||
| // ------------------------------------------------- | |||||
| static inline | static inline | ||||
| void dgl_sleep(unsigned int secs) | void dgl_sleep(unsigned int secs) | ||||
| { | { | ||||
| @@ -205,6 +205,16 @@ public: | |||||
| return fVisible; | return fVisible; | ||||
| } | } | ||||
| void setResizable(bool yesNo) | |||||
| { | |||||
| if (fResizable == yesNo) | |||||
| return; | |||||
| fResizable = yesNo; | |||||
| //setSize(); | |||||
| } | |||||
| void setVisible(bool yesNo) | void setVisible(bool yesNo) | ||||
| { | { | ||||
| if (fVisible == yesNo) | if (fVisible == yesNo) | ||||
| @@ -254,6 +264,7 @@ public: | |||||
| SetWindowPos(hwnd, 0, 0, 0, wr.right-wr.left, wr.bottom-wr.top, SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOOWNERZORDER|SWP_NOZORDER); | SetWindowPos(hwnd, 0, 0, 0, wr.right-wr.left, wr.bottom-wr.top, SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOOWNERZORDER|SWP_NOZORDER); | ||||
| UpdateWindow(hwnd); | UpdateWindow(hwnd); | ||||
| #elif DGL_OS_LINUX | #elif DGL_OS_LINUX | ||||
| // TODO - handle fResizable | |||||
| XSizeHints sizeHints; | XSizeHints sizeHints; | ||||
| memset(&sizeHints, 0, sizeof(sizeHints)); | memset(&sizeHints, 0, sizeof(sizeHints)); | ||||
| @@ -536,6 +547,11 @@ bool Window::isVisible() | |||||
| return kPrivate->isVisible(); | return kPrivate->isVisible(); | ||||
| } | } | ||||
| void Window::setResizable(bool yesNo) | |||||
| { | |||||
| kPrivate->setResizable(yesNo); | |||||
| } | |||||
| void Window::setVisible(bool yesNo) | void Window::setVisible(bool yesNo) | ||||
| { | { | ||||
| kPrivate->setVisible(yesNo); | kPrivate->setVisible(yesNo); | ||||
| @@ -0,0 +1,93 @@ | |||||
| /* | |||||
| * Carla Tests | |||||
| * Copyright (C) 2013 Filipe Coelho <falktx@falktx.com> | |||||
| * | |||||
| * This program is free software; you can redistribute it and/or | |||||
| * modify it under the terms of the GNU General Public License as | |||||
| * published by the Free Software Foundation; either version 2 of | |||||
| * the License, or any later version. | |||||
| * | |||||
| * This program is distributed in the hope that it will be useful, | |||||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||||
| * GNU General Public License for more details. | |||||
| * | |||||
| * For a full copy of the GNU General Public License see the GPL.txt file | |||||
| */ | |||||
| #include "dgl/App.hpp" | |||||
| #include "dgl/Image.hpp" | |||||
| #include "dgl/Widget.hpp" | |||||
| #include "dgl/Window.hpp" | |||||
| #include "DGL_Artwork.hpp" | |||||
| USE_NAMESPACE_DGL; | |||||
| class StandaloneWindow | |||||
| { | |||||
| public: | |||||
| StandaloneWindow() | |||||
| : fApp(), | |||||
| fWindow(&fApp) | |||||
| { | |||||
| } | |||||
| App* getApp() | |||||
| { | |||||
| return &fApp; | |||||
| } | |||||
| Window* getWindow() | |||||
| { | |||||
| return &fWindow; | |||||
| } | |||||
| void exec() | |||||
| { | |||||
| fWindow.show(); | |||||
| fApp.exec(); | |||||
| } | |||||
| private: | |||||
| App fApp; | |||||
| Window fWindow; | |||||
| }; | |||||
| class MyWidget : public Widget | |||||
| { | |||||
| public: | |||||
| MyWidget(StandaloneWindow* win) | |||||
| : Widget(win->getWindow()), | |||||
| fWindow(win->getWindow()) | |||||
| { | |||||
| { | |||||
| using namespace DGL_Artwork; | |||||
| fImage.loadFromMemory(start_here_kxstudioData, | |||||
| Size<int>(start_here_kxstudioWidth, start_here_kxstudioHeight), | |||||
| GL_BGRA, GL_UNSIGNED_BYTE); | |||||
| } | |||||
| fWindow->setSize(fImage.getWidth(), fImage.getHeight()); | |||||
| fWindow->setWindowTitle("DGL Test"); | |||||
| } | |||||
| protected: | |||||
| void onDisplay() override | |||||
| { | |||||
| fImage.draw(); | |||||
| } | |||||
| private: | |||||
| Window* const fWindow; | |||||
| Image fImage; | |||||
| }; | |||||
| int main() | |||||
| { | |||||
| StandaloneWindow win; | |||||
| MyWidget widget(&win); | |||||
| win.exec(); | |||||
| return 0; | |||||
| } | |||||
| @@ -0,0 +1,15 @@ | |||||
| /* (Auto-generated binary data file). */ | |||||
| #ifndef BINARY_DGL_ARTWORK_HPP | |||||
| #define BINARY_DGL_ARTWORK_HPP | |||||
| namespace DGL_Artwork | |||||
| { | |||||
| extern const char* start_here_kxstudioData; | |||||
| const unsigned int start_here_kxstudioDataSize = 262144; | |||||
| const unsigned int start_here_kxstudioWidth = 256; | |||||
| const unsigned int start_here_kxstudioHeight = 256; | |||||
| } | |||||
| #endif // BINARY_DGL_ARTWORK_HPP | |||||
| @@ -20,7 +20,7 @@ ANSI_CXX_FLAGS += -Wcast-qual -Wconversion -Wsign-conversion -Wlogical-op -Wagg | |||||
| ANSI_CXX_FLAGS += -std=c++11 -Wzero-as-null-pointer-constant | ANSI_CXX_FLAGS += -std=c++11 -Wzero-as-null-pointer-constant | ||||
| ANSI_CXX_FLAGS += -DBUILD_ANSI_TEST -DVESTIGE_HEADER -fPIC | ANSI_CXX_FLAGS += -DBUILD_ANSI_TEST -DVESTIGE_HEADER -fPIC | ||||
| TARGETS = ANSI CarlaString RtList Print Utils | |||||
| TARGETS = ANSI CarlaString DGL RtList Print Utils | |||||
| all: $(TARGETS) RUN | all: $(TARGETS) RUN | ||||
| @@ -32,7 +32,10 @@ ANSI: ANSI.cpp | |||||
| CarlaString: CarlaString.cpp | CarlaString: CarlaString.cpp | ||||
| $(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) -o $@ | $(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) -o $@ | ||||
| RtList: RtList.cpp ../libs/rtmempool.a ../utils/RtList.hpp | |||||
| DGL: DGL.cpp DGL_Artwork.cpp ../libs/dgl.a | |||||
| $(CXX) $^ $(BUILD_CXX_FLAGS) $(LINK_FLAGS) -lGL -lX11 -o $@ | |||||
| RtList: RtList.cpp ../utils/RtList.hpp ../libs/rtmempool.a | |||||
| $(CXX) RtList.cpp ../libs/rtmempool.a $(BUILD_CXX_FLAGS) $(LINK_FLAGS) -pthread -lpthread -o $@ | $(CXX) RtList.cpp ../libs/rtmempool.a $(BUILD_CXX_FLAGS) $(LINK_FLAGS) -pthread -lpthread -o $@ | ||||
| Print: Print.cpp | Print: Print.cpp | ||||