Skip to content

[wip] Try SDL-based UI for vst #61

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
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
5 changes: 5 additions & 0 deletions cmake/avendish.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,17 @@ endif()
find_package(Boost QUIET REQUIRED)
find_package(Threads QUIET)
find_package(fmt QUIET)
find_package(GLEW QUIET)
find_package(glfw3 QUIET)
find_package(OpenGL QUIET)
find_package(SDL2 QUIET)
add_definitions(-DFMT_HEADER_ONLY=1)

include(avendish.disableexceptions)
include(avendish.sources)

include(avendish.ui.qt)
include(avendish.ui.nuklear)
include(avendish.max)
include(avendish.pd)
include(avendish.python)
Expand Down
1 change: 1 addition & 0 deletions cmake/avendish.sources.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ function(avnd_target_setup AVND_FX_TARGET)
-fno-plt
-ffunction-sections
-fdata-sections
-ftemplate-backtrace-limit=0
)

if("${CMAKE_CXX_COMPILER_VERSION}" VERSION_GREATER_EQUAL 13.0)
Expand Down
19 changes: 3 additions & 16 deletions cmake/avendish.standalone.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
find_package(ossia QUIET)
find_package(GLEW QUIET)
find_package(glfw3 QUIET)
find_package(OpenGL QUIET)
if(NOT TARGET Qt5::Quick)
if(NOT ((TARGET GLEW::GLEW) AND (TARGET glfw) AND (TARGET OpenGL::GL)))
function(avnd_make_standalone)
Expand Down Expand Up @@ -73,6 +70,7 @@ function(avnd_make_standalone)
${AVND_FX_TARGET}
PUBLIC
Avendish::Avendish
nuklear_impl
)

if(TARGET ossia::ossia)
Expand All @@ -92,16 +90,6 @@ function(avnd_make_standalone)
)
endif()

if(TARGET GLEW::GLEW)
target_link_libraries(
${AVND_FX_TARGET}
PUBLIC
GLEW::GLEW
glfw
OpenGL::GL
)
endif()

avnd_common_setup("${AVND_TARGET}" "${AVND_FX_TARGET}")

target_sources(Avendish PRIVATE
Expand Down Expand Up @@ -155,9 +143,7 @@ function(avnd_make_standalone)
target_link_libraries(
${AVND_FX_TARGET}
PUBLIC
GLEW::GLEW
glfw
OpenGL::GL
nuklear_impl
)

avnd_common_setup("${AVND_TARGET}" "${AVND_FX_TARGET}")
Expand All @@ -170,6 +156,7 @@ function(avnd_make_standalone)
"${AVND_SOURCE_DIR}/include/avnd/binding/ui/nuklear_layout_ui.hpp"
"${AVND_SOURCE_DIR}/include/avnd/binding/ui/nuklear/nuklear.hpp"
"${AVND_SOURCE_DIR}/include/avnd/binding/ui/nuklear/nuklear_glfw_gl4.h"
"${AVND_SOURCE_DIR}/include/avnd/binding/ui/nuklear/nuklear_xlib.h"
)
endfunction()
endif()
23 changes: 23 additions & 0 deletions cmake/avendish.ui.nuklear.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
add_library(nuklear_impl STATIC
src/nuklear.cpp
)
target_include_directories(nuklear_impl
PRIVATE
include)
avnd_target_setup(nuklear_impl)

if(TARGET GLEW::GLEW)
target_link_libraries(
nuklear_impl
PUBLIC
GLEW::GLEW
glfw
OpenGL::GL
)
endif()

target_link_libraries(
nuklear_impl
PUBLIC
X11
)
2 changes: 2 additions & 0 deletions cmake/avendish.vintage.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ function(avnd_make_vintage)
PRIVATE
Avendish::Avendish_vintage
DisableExceptions
SDL2::SDL2
nuklear_impl
)

avnd_common_setup("${AVND_TARGET}" "${AVND_FX_TARGET}")
Expand Down
15 changes: 3 additions & 12 deletions examples/Raw/Addition.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,13 @@ struct Addition

struct
{
struct
{
float value;
} a;
struct
{
float value;
} b;
struct { float value; } a;
struct { float value; } b;
} inputs;

struct
{
struct
{
float value;
} out;
struct { float value; } out;
} outputs;

void operator()() { outputs.out.value = inputs.a.value + inputs.b.value; }
Expand Down
6 changes: 3 additions & 3 deletions include/avnd/binding/ui/nuklear/nuklear.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
#define NK_INCLUDE_VERTEX_BUFFER_OUTPUT
#define NK_INCLUDE_FONT_BAKING
#define NK_INCLUDE_DEFAULT_FONT
#define NK_IMPLEMENTATION
#define NK_GLFW_GL4_IMPLEMENTATION
#define NK_KEYSTATE_BASED_INPUT
#include <nuklear.h>

#include "nuklear_glfw_gl4.h"
// #include "nuklear_glfw_gl4.h"

#include "nuklear_xlib.h"


#define WINDOW_WIDTH 1200
Expand Down
Loading