diff --git a/Makefile b/Makefile index 10d8081..a16f2f8 100644 --- a/Makefile +++ b/Makefile @@ -49,9 +49,9 @@ LIBS= $(shell pkg-config --libs glib-2.0 libxml-2.0 gtk4) -lGL -lGLU -lm -lepoxy BINDIR=bin BUILDDIR=build SRCDIR=src -vpath %.c $(SRCDIR) +#vpath %.c $(SRCDIR) -SOURCES= $(shell ls -r $(SRCDIR)) +SOURCES= $(shell find $(SRCDIR) -type f -name "*.c") BUILDBINS=$(patsubst %.c,$(BUILDDIR)/%.o,$(SOURCES)) BUILDDEPS=$(patsubst %.c,$(BUILDDIR)/%.d,$(SOURCES)) @@ -74,6 +74,7 @@ $(BINDIR): -include $(BUILDDEPS) $(BUILDDIR)/%.d: %.c | $(BUILDDIR) + @mkdir -p $(shell dirname $@) @$(CC) -MM -MT $(@:%.d=%.o) -MF $@ $< @echo -e ${CL2}[$@] ${CL}dependencies generated.${CL3} @@ -86,6 +87,7 @@ $(BINDIR)/gem-graph-client: $(BUILDBINS) | $(BINDIR) $(BUILDDIR)/%.o: %.c | $(BUILDDIR) + @mkdir -p $(shell dirname $@) @$(CC) $(WARNINGS) $(DEBUG) $(OPTIMIZE) $(INCLUDE) -c $< -o $@ @echo -e ${CL2}[$@] ${CL}compiled.${CL3} diff --git a/include/application.h b/include/ui.h similarity index 77% rename from include/application.h rename to include/ui.h index e099ab1..df974d7 100644 --- a/include/application.h +++ b/include/ui.h @@ -23,8 +23,24 @@ */ #pragma once +#include +#include -#include +#include "../include/base.h" + +extern float rotation_angles[N_AXIS]; + +G_BEGIN_DECLS + +#define GEM_GRAPH_CLIENT_TYPE_WINDOW (gem_graph_client_window_get_type()) + +G_DECLARE_FINAL_TYPE (GemGraphClientWindow, + gem_graph_client_window, + GEM_GRAPH_CLIENT, + WINDOW, + GtkApplicationWindow) + +G_END_DECLS G_BEGIN_DECLS diff --git a/include/window.h b/include/window.h deleted file mode 100644 index 6552796..0000000 --- a/include/window.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Gem-graph OpenGL experiments - * - * Desc: User interface header - * - * Copyright (C) 2023 Arthur Menges - * Copyright (C) 2023 Adrien Bourmault - * - * This file is part of Gem-graph. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) 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 Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - -#pragma once -#include -#include - -#include "../include/base.h" - -extern float rotation_angles[N_AXIS]; - -G_BEGIN_DECLS - -#define GEM_GRAPH_CLIENT_TYPE_WINDOW (gem_graph_client_window_get_type()) - -G_DECLARE_FINAL_TYPE (GemGraphClientWindow, - gem_graph_client_window, - GEM_GRAPH_CLIENT, - WINDOW, - GtkApplicationWindow) - -G_END_DECLS - -//void on_activate(GtkApplication *app, gpointer user_data); - diff --git a/manifest.scm b/manifest.scm index c860c56..d77a78b 100644 --- a/manifest.scm +++ b/manifest.scm @@ -9,6 +9,7 @@ "coreutils" "gcc-toolchain" "pkg-config" + "findutils" "make" "gtk" "libxml2" diff --git a/src/graphics.c b/src/graphics.c index c636838..a42594a 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -33,7 +33,7 @@ #include #include "../include/base.h" -#include "../include/window.h" +#include "../include/ui.h" #define VERTEX_SHADER_FILE "data/shader.vert" #define FRAG_SHADER_FILE "data/shader.frag" diff --git a/src/main.c b/src/main.c index 910faec..99a6dd9 100644 --- a/src/main.c +++ b/src/main.c @@ -26,8 +26,7 @@ #include #include "../include/base.h" -#include "../include/window.h" -#include "../include/application.h" +#include "../include/ui.h" /* -------------------------------------------------------------------------- */ diff --git a/ui/.gitkeep b/src/ui/.gitkeep similarity index 100% rename from ui/.gitkeep rename to src/ui/.gitkeep diff --git a/src/application.c b/src/ui/application.c similarity index 98% rename from src/application.c rename to src/ui/application.c index 18040ee..ef17f26 100644 --- a/src/application.c +++ b/src/ui/application.c @@ -22,8 +22,8 @@ * along with this program. If not, see . */ -#include "../include/application.h" -#include "../include/window.h" +#include "../../include/base.h" +#include "../../include/ui.h" struct _GemGraphClientApplication { diff --git a/ui/gemgraph.cmb b/src/ui/gemgraph.cmb similarity index 100% rename from ui/gemgraph.cmb rename to src/ui/gemgraph.cmb diff --git a/ui/gemgraph.ui b/src/ui/gemgraph.ui similarity index 100% rename from ui/gemgraph.ui rename to src/ui/gemgraph.ui diff --git a/src/window.c b/src/ui/window.c similarity index 96% rename from src/window.c rename to src/ui/window.c index 8d9578a..aeca3b7 100644 --- a/src/window.c +++ b/src/ui/window.c @@ -26,9 +26,9 @@ #include #include -#include "../include/base.h" -#include "../include/graphics.h" -#include "../include/window.h" +#include "../../include/base.h" +#include "../../include/graphics.h" +#include "../../include/ui.h" /* -------------------------------------------------------------------------- */ @@ -219,8 +219,8 @@ static void gem_graph_client_window_class_init(GemGraphClientWindowClass *klass) GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass); - if (g_file_get_contents("ui/gemgraph.ui", &contents, &len, &err) == FALSE) - g_error("error reading ui/gemgraph.ui: %s", err->message); + if (g_file_get_contents("src/ui/gemgraph.ui", &contents, &len, &err) == FALSE) + g_error("error reading gemgraph.ui: %s", err->message); bytes = g_bytes_new_take(contents, len); gtk_widget_class_set_template(GTK_WIDGET_CLASS(klass), bytes);