From c2c11a6aba517880a4a97302be43cc7b59e70da6 Mon Sep 17 00:00:00 2001 From: Adrien 'neox' Bourmault Date: Tue, 1 Oct 2024 10:37:37 +0200 Subject: [PATCH] wip: cubes and arrows --- (notes) | 0 (notes, menus) | 0 .gitignore | 0 COPYING | 0 Makefile | 0 audit/2024-07-14 | 0 data/dimers random walk.xml | 0 data/gnuplot/a_cmd.plt | 0 data/gnuplot/sin | 0 .../.~lock.data as functions oftime.png# | 0 .../.~lock.data line graph extended.odg# | 0 data/image/ADP.png | Bin data/image/AMP.png | Bin data/image/ATP.png | Bin data/image/E coli (Goodsell) 2.png | Bin data/image/E coli (Goodsell).png | Bin data/image/E coli by D Goodsell.png | Bin data/image/aXoris.png | Bin data/image/acetic acid.png | Bin data/image/ascorbic acid.png | Bin data/image/biotin.png | Bin data/image/catécholamines.png | Bin data/image/data bar graph vertical.png | Bin ...rt line x measures y values degressive.png | Bin data/image/data charts.png | Bin data/image/data correlation 1.png | Bin .../data correlations (4, horizontal).png | Bin data/image/data correlations (6).png | Bin .../image/data evolution (trends n > 30).png | Bin data/image/data evolution (extend).png | Bin .../image/data evolution (synchro pulses).png | Bin data/image/data evolution 10 lines.png | Bin data/image/data line graph extended.odg | Bin data/image/data line graph.png | Bin .../image/data many bars graph horizontal.png | Bin data/image/data many bars graph vertical.png | Bin data/image/data many bars vertical.png | Bin ...ta network interpretation (bump chart).png | Bin ... évolutions parallèles (n > 30) étendu.png | Bin .../data évolutions parallèles (n > 30).png | Bin data/image/dopamine.png | Bin data/image/erythorbic acid.png | Bin data/image/folic acid.png | Bin data/image/glutamate.png | Bin data/image/glutamine.png | Bin data/image/glutathione.png | Bin data/image/glycerol.png | Bin data/image/hb.png | Bin data/image/insuline Zn.png | Bin data/image/insuline.png | Bin data/image/lactic acid.png | Bin data/image/legumin.png | Bin data/image/pantothenic acid.png | Bin data/image/phénylalanine.png | Bin data/image/pyridoxin.png | Bin data/image/riboflavin.png | Bin data/image/ribonuclease.png | Bin data/image/xyz icon.png | Bin data/stamp/ADP.jpg | Bin data/stamp/ADP.pdf | Bin data/stamp/AMP.jpg | Bin data/stamp/AMP.xcf | Bin data/stamp/DNA.png | Bin data/stamp/balance icon.png | Bin data/stamp/bug.png | Bin data/stamp/buoy.png | Bin data/stamp/calibrate.png | Bin data/stamp/camera icon.png | Bin data/stamp/camera.png | Bin data/stamp/chart error bar.png | Bin data/stamp/choice.png | Bin data/stamp/clean.png | Bin data/stamp/crop.png | Bin data/stamp/crossroads.png | Bin data/stamp/data collection.png | Bin data/stamp/diameter icon.png | Bin data/stamp/factory.png | Bin data/stamp/gem graph.png | Bin data/stamp/harbor.png | Bin data/stamp/histo line empty dots.png | Bin data/stamp/linux.png | Bin data/stamp/measure balance science icon.png | Bin data/stamp/measure caliper icon.png | Bin data/stamp/measure centimeter icon.png | Bin data/stamp/measure compass icon.png | Bin data/stamp/measure pressure icon.png | Bin data/stamp/measure size (height) icon.png | Bin data/stamp/measure size icon.png | Bin data/stamp/measure sizes icon.png | Bin data/stamp/measure temperature icon.png | Bin data/stamp/measure time icon.png | Bin data/stamp/measure tool scale icon.png | Bin data/stamp/mesure diameter icon.png | Bin data/stamp/microscope.png | Bin data/stamp/presentation.png | Bin data/stamp/radar.png | Bin data/stamp/radioactive.png | Bin data/stamp/rider.png | Bin data/stamp/running.png | Bin data/stamp/répare.png | Bin data/stamp/slack.png | Bin data/stamp/sprout (plant).png | Bin data/stamp/stamp.png | Bin data/stamp/this way.png | Bin data/stamp/transmission.png | Bin data/stamp/tree view.png | Bin data/stamp/venn diagram.png | Bin data/stamp/wheat.png | Bin data/stamp/work in progress.png | Bin data/text/pratique.txt | 0 data/text/théorie.txt | 0 include/action.h | 0 include/base.h | 0 include/fsm.h | 0 include/graphics.h | 0 include/parse.h | 0 include/signal.h | 0 include/util.h | 0 include/widget.h | 0 instanced_cubes | Bin 0 -> 45552 bytes instanced_cubes.c | 573 ++++++++++++++++++ journal.c | 0 manifest.scm | 0 src/actions.c | 0 src/fsm/dispatch.c | 0 src/fsm/engine/engine.c | 0 src/fsm/journal.c | 0 src/fsm/measure/data_list.c | 0 src/fsm/measure/disp_list.c | 0 src/fsm/measure/manage.c | 0 src/fsm/measure/tool_list.c | 0 src/fsm/prefer.c | 0 src/fsm/result.c | 0 src/graphics/draw.c | 0 src/graphics/grid.c | 0 src/graphics/init.c | 0 src/graphics/shader.frag | 0 src/graphics/shader.vert | 0 src/main.c | 0 src/parse.c | 0 src/signal.c | 0 src/util/draw/gl.c | 6 +- src/util/io.c | 0 src/util/list_2x2.c | 0 src/util/pile.c | 0 src/util/sorted_list.c | 0 src/util/tests.c | 0 src/widget/all_rules/compare/interest.c | 0 src/widget/all_rules/dispatch.c | 0 src/widget/all_rules/tree/dispatch.c | 0 src/widget/all_rules/tree/freq.c | 0 src/widget/all_rules/tree/labo.c | 0 src/widget/all_rules/tree/pilot_box.c | 0 src/widget/all_rules/tree/tree.c | 0 src/widget/dispatch.c | 0 src/widget/measure/dispatch.c | 0 src/widget/one_rule/algebra/assign.c | 0 src/widget/one_rule/algebra/conditions.c | 0 src/widget/one_rule/algebra/dispatch.c | 0 src/widget/one_rule/algebra/identity.c | 0 src/widget/one_rule/algebra/utilities.c | 0 src/widget/one_rule/dispatch.c | 0 src/widget/one_rule/geometry/camera.c | 0 src/widget/one_rule/geometry/dispatch.c | 0 src/widget/one_rule/geometry/edit_tools.c | 0 src/widget/one_rule/geometry/enquire.c | 0 src/widget/one_rule/geometry/geometry.c | 0 src/widget/results/dispatch.c | 0 src/widget/results/display.c | 0 src/widget/results/organize.c | 0 src/widget/state/bottom.c | 0 src/widget/state/dispatch.c | 0 src/widget/state/middle.c | 0 src/widget/state/top.c | 0 src/widget/synth/dispatch.c | 0 src/widget/synth/time.c | 0 src/widget/topbar/dialog.c | 0 src/widget/topbar/dispatch.c | 0 src/widget/topbar/left.c | 0 src/widget/topbar/polytext.c | 0 src/widget/topbar/right.c | 0 src/widget/tree.c | 0 182 files changed, 575 insertions(+), 4 deletions(-) mode change 100644 => 100755 (notes) mode change 100644 => 100755 (notes, menus) mode change 100644 => 100755 .gitignore mode change 100644 => 100755 COPYING mode change 100644 => 100755 Makefile mode change 100644 => 100755 audit/2024-07-14 mode change 100644 => 100755 data/dimers random walk.xml mode change 100644 => 100755 data/gnuplot/a_cmd.plt mode change 100644 => 100755 data/gnuplot/sin mode change 100644 => 100755 data/image/.~lock.data as functions oftime.png# mode change 100644 => 100755 data/image/.~lock.data line graph extended.odg# mode change 100644 => 100755 data/image/ADP.png mode change 100644 => 100755 data/image/AMP.png mode change 100644 => 100755 data/image/ATP.png mode change 100644 => 100755 data/image/E coli (Goodsell) 2.png mode change 100644 => 100755 data/image/E coli (Goodsell).png mode change 100644 => 100755 data/image/E coli by D Goodsell.png mode change 100644 => 100755 data/image/aXoris.png mode change 100644 => 100755 data/image/acetic acid.png mode change 100644 => 100755 data/image/ascorbic acid.png mode change 100644 => 100755 data/image/biotin.png mode change 100644 => 100755 data/image/catécholamines.png mode change 100644 => 100755 data/image/data bar graph vertical.png mode change 100644 => 100755 data/image/data chart line x measures y values degressive.png mode change 100644 => 100755 data/image/data charts.png mode change 100644 => 100755 data/image/data correlation 1.png mode change 100644 => 100755 data/image/data correlations (4, horizontal).png mode change 100644 => 100755 data/image/data correlations (6).png mode change 100644 => 100755 data/image/data evolution (trends n > 30).png mode change 100644 => 100755 data/image/data evolution (extend).png mode change 100644 => 100755 data/image/data evolution (synchro pulses).png mode change 100644 => 100755 data/image/data evolution 10 lines.png mode change 100644 => 100755 data/image/data line graph extended.odg mode change 100644 => 100755 data/image/data line graph.png mode change 100644 => 100755 data/image/data many bars graph horizontal.png mode change 100644 => 100755 data/image/data many bars graph vertical.png mode change 100644 => 100755 data/image/data many bars vertical.png mode change 100644 => 100755 data/image/data network interpretation (bump chart).png mode change 100644 => 100755 data/image/data évolutions parallèles (n > 30) étendu.png mode change 100644 => 100755 data/image/data évolutions parallèles (n > 30).png mode change 100644 => 100755 data/image/dopamine.png mode change 100644 => 100755 data/image/erythorbic acid.png mode change 100644 => 100755 data/image/folic acid.png mode change 100644 => 100755 data/image/glutamate.png mode change 100644 => 100755 data/image/glutamine.png mode change 100644 => 100755 data/image/glutathione.png mode change 100644 => 100755 data/image/glycerol.png mode change 100644 => 100755 data/image/hb.png mode change 100644 => 100755 data/image/insuline Zn.png mode change 100644 => 100755 data/image/insuline.png mode change 100644 => 100755 data/image/lactic acid.png mode change 100644 => 100755 data/image/legumin.png mode change 100644 => 100755 data/image/pantothenic acid.png mode change 100644 => 100755 data/image/phénylalanine.png mode change 100644 => 100755 data/image/pyridoxin.png mode change 100644 => 100755 data/image/riboflavin.png mode change 100644 => 100755 data/image/ribonuclease.png mode change 100644 => 100755 data/image/xyz icon.png mode change 100644 => 100755 data/stamp/ADP.jpg mode change 100644 => 100755 data/stamp/ADP.pdf mode change 100644 => 100755 data/stamp/AMP.jpg mode change 100644 => 100755 data/stamp/AMP.xcf mode change 100644 => 100755 data/stamp/DNA.png mode change 100644 => 100755 data/stamp/balance icon.png mode change 100644 => 100755 data/stamp/bug.png mode change 100644 => 100755 data/stamp/buoy.png mode change 100644 => 100755 data/stamp/calibrate.png mode change 100644 => 100755 data/stamp/camera icon.png mode change 100644 => 100755 data/stamp/camera.png mode change 100644 => 100755 data/stamp/chart error bar.png mode change 100644 => 100755 data/stamp/choice.png mode change 100644 => 100755 data/stamp/clean.png mode change 100644 => 100755 data/stamp/crop.png mode change 100644 => 100755 data/stamp/crossroads.png mode change 100644 => 100755 data/stamp/data collection.png mode change 100644 => 100755 data/stamp/diameter icon.png mode change 100644 => 100755 data/stamp/factory.png mode change 100644 => 100755 data/stamp/gem graph.png mode change 100644 => 100755 data/stamp/harbor.png mode change 100644 => 100755 data/stamp/histo line empty dots.png mode change 100644 => 100755 data/stamp/linux.png mode change 100644 => 100755 data/stamp/measure balance science icon.png mode change 100644 => 100755 data/stamp/measure caliper icon.png mode change 100644 => 100755 data/stamp/measure centimeter icon.png mode change 100644 => 100755 data/stamp/measure compass icon.png mode change 100644 => 100755 data/stamp/measure pressure icon.png mode change 100644 => 100755 data/stamp/measure size (height) icon.png mode change 100644 => 100755 data/stamp/measure size icon.png mode change 100644 => 100755 data/stamp/measure sizes icon.png mode change 100644 => 100755 data/stamp/measure temperature icon.png mode change 100644 => 100755 data/stamp/measure time icon.png mode change 100644 => 100755 data/stamp/measure tool scale icon.png mode change 100644 => 100755 data/stamp/mesure diameter icon.png mode change 100644 => 100755 data/stamp/microscope.png mode change 100644 => 100755 data/stamp/presentation.png mode change 100644 => 100755 data/stamp/radar.png mode change 100644 => 100755 data/stamp/radioactive.png mode change 100644 => 100755 data/stamp/rider.png mode change 100644 => 100755 data/stamp/running.png mode change 100644 => 100755 data/stamp/répare.png mode change 100644 => 100755 data/stamp/slack.png mode change 100644 => 100755 data/stamp/sprout (plant).png mode change 100644 => 100755 data/stamp/stamp.png mode change 100644 => 100755 data/stamp/this way.png mode change 100644 => 100755 data/stamp/transmission.png mode change 100644 => 100755 data/stamp/tree view.png mode change 100644 => 100755 data/stamp/venn diagram.png mode change 100644 => 100755 data/stamp/wheat.png mode change 100644 => 100755 data/stamp/work in progress.png mode change 100644 => 100755 data/text/pratique.txt mode change 100644 => 100755 data/text/théorie.txt mode change 100644 => 100755 include/action.h mode change 100644 => 100755 include/base.h mode change 100644 => 100755 include/fsm.h mode change 100644 => 100755 include/graphics.h mode change 100644 => 100755 include/parse.h mode change 100644 => 100755 include/signal.h mode change 100644 => 100755 include/util.h mode change 100644 => 100755 include/widget.h create mode 100755 instanced_cubes create mode 100755 instanced_cubes.c mode change 100644 => 100755 journal.c mode change 100644 => 100755 manifest.scm mode change 100644 => 100755 src/actions.c mode change 100644 => 100755 src/fsm/dispatch.c mode change 100644 => 100755 src/fsm/engine/engine.c mode change 100644 => 100755 src/fsm/journal.c mode change 100644 => 100755 src/fsm/measure/data_list.c mode change 100644 => 100755 src/fsm/measure/disp_list.c mode change 100644 => 100755 src/fsm/measure/manage.c mode change 100644 => 100755 src/fsm/measure/tool_list.c mode change 100644 => 100755 src/fsm/prefer.c mode change 100644 => 100755 src/fsm/result.c mode change 100644 => 100755 src/graphics/draw.c mode change 100644 => 100755 src/graphics/grid.c mode change 100644 => 100755 src/graphics/init.c mode change 100644 => 100755 src/graphics/shader.frag mode change 100644 => 100755 src/graphics/shader.vert mode change 100644 => 100755 src/main.c mode change 100644 => 100755 src/parse.c mode change 100644 => 100755 src/signal.c mode change 100644 => 100755 src/util/draw/gl.c mode change 100644 => 100755 src/util/io.c mode change 100644 => 100755 src/util/list_2x2.c mode change 100644 => 100755 src/util/pile.c mode change 100644 => 100755 src/util/sorted_list.c mode change 100644 => 100755 src/util/tests.c mode change 100644 => 100755 src/widget/all_rules/compare/interest.c mode change 100644 => 100755 src/widget/all_rules/dispatch.c mode change 100644 => 100755 src/widget/all_rules/tree/dispatch.c mode change 100644 => 100755 src/widget/all_rules/tree/freq.c mode change 100644 => 100755 src/widget/all_rules/tree/labo.c mode change 100644 => 100755 src/widget/all_rules/tree/pilot_box.c mode change 100644 => 100755 src/widget/all_rules/tree/tree.c mode change 100644 => 100755 src/widget/dispatch.c mode change 100644 => 100755 src/widget/measure/dispatch.c mode change 100644 => 100755 src/widget/one_rule/algebra/assign.c mode change 100644 => 100755 src/widget/one_rule/algebra/conditions.c mode change 100644 => 100755 src/widget/one_rule/algebra/dispatch.c mode change 100644 => 100755 src/widget/one_rule/algebra/identity.c mode change 100644 => 100755 src/widget/one_rule/algebra/utilities.c mode change 100644 => 100755 src/widget/one_rule/dispatch.c mode change 100644 => 100755 src/widget/one_rule/geometry/camera.c mode change 100644 => 100755 src/widget/one_rule/geometry/dispatch.c mode change 100644 => 100755 src/widget/one_rule/geometry/edit_tools.c mode change 100644 => 100755 src/widget/one_rule/geometry/enquire.c mode change 100644 => 100755 src/widget/one_rule/geometry/geometry.c mode change 100644 => 100755 src/widget/results/dispatch.c mode change 100644 => 100755 src/widget/results/display.c mode change 100644 => 100755 src/widget/results/organize.c mode change 100644 => 100755 src/widget/state/bottom.c mode change 100644 => 100755 src/widget/state/dispatch.c mode change 100644 => 100755 src/widget/state/middle.c mode change 100644 => 100755 src/widget/state/top.c mode change 100644 => 100755 src/widget/synth/dispatch.c mode change 100644 => 100755 src/widget/synth/time.c mode change 100644 => 100755 src/widget/topbar/dialog.c mode change 100644 => 100755 src/widget/topbar/dispatch.c mode change 100644 => 100755 src/widget/topbar/left.c mode change 100644 => 100755 src/widget/topbar/polytext.c mode change 100644 => 100755 src/widget/topbar/right.c mode change 100644 => 100755 src/widget/tree.c diff --git a/(notes) b/(notes) old mode 100644 new mode 100755 diff --git a/(notes, menus) b/(notes, menus) old mode 100644 new mode 100755 diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/COPYING b/COPYING old mode 100644 new mode 100755 diff --git a/Makefile b/Makefile old mode 100644 new mode 100755 diff --git a/audit/2024-07-14 b/audit/2024-07-14 old mode 100644 new mode 100755 diff --git a/data/dimers random walk.xml b/data/dimers random walk.xml old mode 100644 new mode 100755 diff --git a/data/gnuplot/a_cmd.plt b/data/gnuplot/a_cmd.plt old mode 100644 new mode 100755 diff --git a/data/gnuplot/sin b/data/gnuplot/sin old mode 100644 new mode 100755 diff --git a/data/image/.~lock.data as functions oftime.png# b/data/image/.~lock.data as functions oftime.png# old mode 100644 new mode 100755 diff --git a/data/image/.~lock.data line graph extended.odg# b/data/image/.~lock.data line graph extended.odg# old mode 100644 new mode 100755 diff --git a/data/image/ADP.png b/data/image/ADP.png old mode 100644 new mode 100755 diff --git a/data/image/AMP.png b/data/image/AMP.png old mode 100644 new mode 100755 diff --git a/data/image/ATP.png b/data/image/ATP.png old mode 100644 new mode 100755 diff --git a/data/image/E coli (Goodsell) 2.png b/data/image/E coli (Goodsell) 2.png old mode 100644 new mode 100755 diff --git a/data/image/E coli (Goodsell).png b/data/image/E coli (Goodsell).png old mode 100644 new mode 100755 diff --git a/data/image/E coli by D Goodsell.png b/data/image/E coli by D Goodsell.png old mode 100644 new mode 100755 diff --git a/data/image/aXoris.png b/data/image/aXoris.png old mode 100644 new mode 100755 diff --git a/data/image/acetic acid.png b/data/image/acetic acid.png old mode 100644 new mode 100755 diff --git a/data/image/ascorbic acid.png b/data/image/ascorbic acid.png old mode 100644 new mode 100755 diff --git a/data/image/biotin.png b/data/image/biotin.png old mode 100644 new mode 100755 diff --git a/data/image/catécholamines.png b/data/image/catécholamines.png old mode 100644 new mode 100755 diff --git a/data/image/data bar graph vertical.png b/data/image/data bar graph vertical.png old mode 100644 new mode 100755 diff --git a/data/image/data chart line x measures y values degressive.png b/data/image/data chart line x measures y values degressive.png old mode 100644 new mode 100755 diff --git a/data/image/data charts.png b/data/image/data charts.png old mode 100644 new mode 100755 diff --git a/data/image/data correlation 1.png b/data/image/data correlation 1.png old mode 100644 new mode 100755 diff --git a/data/image/data correlations (4, horizontal).png b/data/image/data correlations (4, horizontal).png old mode 100644 new mode 100755 diff --git a/data/image/data correlations (6).png b/data/image/data correlations (6).png old mode 100644 new mode 100755 diff --git a/data/image/data evolution (trends n > 30).png b/data/image/data evolution (trends n > 30).png old mode 100644 new mode 100755 diff --git a/data/image/data evolution (extend).png b/data/image/data evolution (extend).png old mode 100644 new mode 100755 diff --git a/data/image/data evolution (synchro pulses).png b/data/image/data evolution (synchro pulses).png old mode 100644 new mode 100755 diff --git a/data/image/data evolution 10 lines.png b/data/image/data evolution 10 lines.png old mode 100644 new mode 100755 diff --git a/data/image/data line graph extended.odg b/data/image/data line graph extended.odg old mode 100644 new mode 100755 diff --git a/data/image/data line graph.png b/data/image/data line graph.png old mode 100644 new mode 100755 diff --git a/data/image/data many bars graph horizontal.png b/data/image/data many bars graph horizontal.png old mode 100644 new mode 100755 diff --git a/data/image/data many bars graph vertical.png b/data/image/data many bars graph vertical.png old mode 100644 new mode 100755 diff --git a/data/image/data many bars vertical.png b/data/image/data many bars vertical.png old mode 100644 new mode 100755 diff --git a/data/image/data network interpretation (bump chart).png b/data/image/data network interpretation (bump chart).png old mode 100644 new mode 100755 diff --git a/data/image/data évolutions parallèles (n > 30) étendu.png b/data/image/data évolutions parallèles (n > 30) étendu.png old mode 100644 new mode 100755 diff --git a/data/image/data évolutions parallèles (n > 30).png b/data/image/data évolutions parallèles (n > 30).png old mode 100644 new mode 100755 diff --git a/data/image/dopamine.png b/data/image/dopamine.png old mode 100644 new mode 100755 diff --git a/data/image/erythorbic acid.png b/data/image/erythorbic acid.png old mode 100644 new mode 100755 diff --git a/data/image/folic acid.png b/data/image/folic acid.png old mode 100644 new mode 100755 diff --git a/data/image/glutamate.png b/data/image/glutamate.png old mode 100644 new mode 100755 diff --git a/data/image/glutamine.png b/data/image/glutamine.png old mode 100644 new mode 100755 diff --git a/data/image/glutathione.png b/data/image/glutathione.png old mode 100644 new mode 100755 diff --git a/data/image/glycerol.png b/data/image/glycerol.png old mode 100644 new mode 100755 diff --git a/data/image/hb.png b/data/image/hb.png old mode 100644 new mode 100755 diff --git a/data/image/insuline Zn.png b/data/image/insuline Zn.png old mode 100644 new mode 100755 diff --git a/data/image/insuline.png b/data/image/insuline.png old mode 100644 new mode 100755 diff --git a/data/image/lactic acid.png b/data/image/lactic acid.png old mode 100644 new mode 100755 diff --git a/data/image/legumin.png b/data/image/legumin.png old mode 100644 new mode 100755 diff --git a/data/image/pantothenic acid.png b/data/image/pantothenic acid.png old mode 100644 new mode 100755 diff --git a/data/image/phénylalanine.png b/data/image/phénylalanine.png old mode 100644 new mode 100755 diff --git a/data/image/pyridoxin.png b/data/image/pyridoxin.png old mode 100644 new mode 100755 diff --git a/data/image/riboflavin.png b/data/image/riboflavin.png old mode 100644 new mode 100755 diff --git a/data/image/ribonuclease.png b/data/image/ribonuclease.png old mode 100644 new mode 100755 diff --git a/data/image/xyz icon.png b/data/image/xyz icon.png old mode 100644 new mode 100755 diff --git a/data/stamp/ADP.jpg b/data/stamp/ADP.jpg old mode 100644 new mode 100755 diff --git a/data/stamp/ADP.pdf b/data/stamp/ADP.pdf old mode 100644 new mode 100755 diff --git a/data/stamp/AMP.jpg b/data/stamp/AMP.jpg old mode 100644 new mode 100755 diff --git a/data/stamp/AMP.xcf b/data/stamp/AMP.xcf old mode 100644 new mode 100755 diff --git a/data/stamp/DNA.png b/data/stamp/DNA.png old mode 100644 new mode 100755 diff --git a/data/stamp/balance icon.png b/data/stamp/balance icon.png old mode 100644 new mode 100755 diff --git a/data/stamp/bug.png b/data/stamp/bug.png old mode 100644 new mode 100755 diff --git a/data/stamp/buoy.png b/data/stamp/buoy.png old mode 100644 new mode 100755 diff --git a/data/stamp/calibrate.png b/data/stamp/calibrate.png old mode 100644 new mode 100755 diff --git a/data/stamp/camera icon.png b/data/stamp/camera icon.png old mode 100644 new mode 100755 diff --git a/data/stamp/camera.png b/data/stamp/camera.png old mode 100644 new mode 100755 diff --git a/data/stamp/chart error bar.png b/data/stamp/chart error bar.png old mode 100644 new mode 100755 diff --git a/data/stamp/choice.png b/data/stamp/choice.png old mode 100644 new mode 100755 diff --git a/data/stamp/clean.png b/data/stamp/clean.png old mode 100644 new mode 100755 diff --git a/data/stamp/crop.png b/data/stamp/crop.png old mode 100644 new mode 100755 diff --git a/data/stamp/crossroads.png b/data/stamp/crossroads.png old mode 100644 new mode 100755 diff --git a/data/stamp/data collection.png b/data/stamp/data collection.png old mode 100644 new mode 100755 diff --git a/data/stamp/diameter icon.png b/data/stamp/diameter icon.png old mode 100644 new mode 100755 diff --git a/data/stamp/factory.png b/data/stamp/factory.png old mode 100644 new mode 100755 diff --git a/data/stamp/gem graph.png b/data/stamp/gem graph.png old mode 100644 new mode 100755 diff --git a/data/stamp/harbor.png b/data/stamp/harbor.png old mode 100644 new mode 100755 diff --git a/data/stamp/histo line empty dots.png b/data/stamp/histo line empty dots.png old mode 100644 new mode 100755 diff --git a/data/stamp/linux.png b/data/stamp/linux.png old mode 100644 new mode 100755 diff --git a/data/stamp/measure balance science icon.png b/data/stamp/measure balance science icon.png old mode 100644 new mode 100755 diff --git a/data/stamp/measure caliper icon.png b/data/stamp/measure caliper icon.png old mode 100644 new mode 100755 diff --git a/data/stamp/measure centimeter icon.png b/data/stamp/measure centimeter icon.png old mode 100644 new mode 100755 diff --git a/data/stamp/measure compass icon.png b/data/stamp/measure compass icon.png old mode 100644 new mode 100755 diff --git a/data/stamp/measure pressure icon.png b/data/stamp/measure pressure icon.png old mode 100644 new mode 100755 diff --git a/data/stamp/measure size (height) icon.png b/data/stamp/measure size (height) icon.png old mode 100644 new mode 100755 diff --git a/data/stamp/measure size icon.png b/data/stamp/measure size icon.png old mode 100644 new mode 100755 diff --git a/data/stamp/measure sizes icon.png b/data/stamp/measure sizes icon.png old mode 100644 new mode 100755 diff --git a/data/stamp/measure temperature icon.png b/data/stamp/measure temperature icon.png old mode 100644 new mode 100755 diff --git a/data/stamp/measure time icon.png b/data/stamp/measure time icon.png old mode 100644 new mode 100755 diff --git a/data/stamp/measure tool scale icon.png b/data/stamp/measure tool scale icon.png old mode 100644 new mode 100755 diff --git a/data/stamp/mesure diameter icon.png b/data/stamp/mesure diameter icon.png old mode 100644 new mode 100755 diff --git a/data/stamp/microscope.png b/data/stamp/microscope.png old mode 100644 new mode 100755 diff --git a/data/stamp/presentation.png b/data/stamp/presentation.png old mode 100644 new mode 100755 diff --git a/data/stamp/radar.png b/data/stamp/radar.png old mode 100644 new mode 100755 diff --git a/data/stamp/radioactive.png b/data/stamp/radioactive.png old mode 100644 new mode 100755 diff --git a/data/stamp/rider.png b/data/stamp/rider.png old mode 100644 new mode 100755 diff --git a/data/stamp/running.png b/data/stamp/running.png old mode 100644 new mode 100755 diff --git a/data/stamp/répare.png b/data/stamp/répare.png old mode 100644 new mode 100755 diff --git a/data/stamp/slack.png b/data/stamp/slack.png old mode 100644 new mode 100755 diff --git a/data/stamp/sprout (plant).png b/data/stamp/sprout (plant).png old mode 100644 new mode 100755 diff --git a/data/stamp/stamp.png b/data/stamp/stamp.png old mode 100644 new mode 100755 diff --git a/data/stamp/this way.png b/data/stamp/this way.png old mode 100644 new mode 100755 diff --git a/data/stamp/transmission.png b/data/stamp/transmission.png old mode 100644 new mode 100755 diff --git a/data/stamp/tree view.png b/data/stamp/tree view.png old mode 100644 new mode 100755 diff --git a/data/stamp/venn diagram.png b/data/stamp/venn diagram.png old mode 100644 new mode 100755 diff --git a/data/stamp/wheat.png b/data/stamp/wheat.png old mode 100644 new mode 100755 diff --git a/data/stamp/work in progress.png b/data/stamp/work in progress.png old mode 100644 new mode 100755 diff --git a/data/text/pratique.txt b/data/text/pratique.txt old mode 100644 new mode 100755 diff --git a/data/text/théorie.txt b/data/text/théorie.txt old mode 100644 new mode 100755 diff --git a/include/action.h b/include/action.h old mode 100644 new mode 100755 diff --git a/include/base.h b/include/base.h old mode 100644 new mode 100755 diff --git a/include/fsm.h b/include/fsm.h old mode 100644 new mode 100755 diff --git a/include/graphics.h b/include/graphics.h old mode 100644 new mode 100755 diff --git a/include/parse.h b/include/parse.h old mode 100644 new mode 100755 diff --git a/include/signal.h b/include/signal.h old mode 100644 new mode 100755 diff --git a/include/util.h b/include/util.h old mode 100644 new mode 100755 diff --git a/include/widget.h b/include/widget.h old mode 100644 new mode 100755 diff --git a/instanced_cubes b/instanced_cubes new file mode 100755 index 0000000000000000000000000000000000000000..7c5f3f9410728c65a76613ab3409060da7a482b6 GIT binary patch literal 45552 zcmeHwdwkqgnfI@ksTD0rfof4MBR5mEA!*Z_h)geOhm}GEimd|ENixX{nM|fLlQgY} zfik>}F&Y(IRD2B=HH*3%6}7M~1VkELlz3UKtL{ccO{8cP)U3;z_xpXGbAEH?m&D!W z{e0d(-sSW&^PJ~;p7Wf`@BGd=>AbW4lI;r@Ebwev=)KV+HgHx%Nc!!0*?R>ww2j^} zFXElyo$f6GWidVx;Sg%h!ea}SVc}9Ew+N7WE13}(DT57yd7g#VLqh76Qp98pJj0+C zRw_=t5VK)^A%!CXEIf6Wq856No|M<4e6J^>83U(Zq^O0i9%D1{Zskwh5s{3ALu4X_ zPf%#}7%sA=jo!4;vv8aONEX_7(no%hCZ5Sf5n#j>>bK`v7}OgwdP7F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7d8=f#6$8Co;{_vn*vtqF{#KCFa_eABfF`LcA#%h@hfZbadvL5?;KiBVQiG-~h@c z_I0LmiRKvQk3247c^C(&0_J2kjvXsv~I`bZR<_|mlJCg*yh~D<#9LC$g`{;B^P)^kR$2S6b+Zr; z^j7VK;sRS4lP*jpfXCQJW3k43-Z~rWXynDYSZ5}e&?(kVah$Ss^ynmH$B-N5S$$|n zBI8WrrJ$llZPs0J#7?w+jX3!H0BlR76SKyrP7iL}^huH5mn)QaG;37b?TXGuzv*Vp ziF!rNe?HmDvtkK65pvR;mdaT_-dX6t+#`=tH$46zm(l680F~_hwOFjR9ZzDN)Jpvr zQBzm#gGVM1Ke%!O&8yBIXfMPY0Sh^WNt=_IHtSVqItq#E)=XzL1`V$DVQr$M&08*B z&BcxI@YqUv)y)Sou&1z)Q;r>mB4&^nc$jJ9R4}=0y5Qkf7e;C|FVK0_GGABcI;7^+ ziDV4VyY@sZ*$iEasRkaNe71{*&BJiKJ=FvkI$#T5)lz^OLr?Xpar;azD9Y09|LTk9 zj(iovc8sKziy{Up-k`w$rmUOJ27;xqub(vfN$f8$MdZ8mg=J@1!v7Usrf>Jthm3x> zOuDp>V98Nr@Ji^HKWfS!HTqSiVoQvIE#JQXYyY`30y#@y*6JIw zcPTR51Gf71eD#ok&GLP;G4d>sTYW=9}Y)^9S#fd zvbJK1awl1mg|`B8_3b{-z*#ESbGbtMZS^evVPsr=dq1GEQzh)VxRnq3KWOxQH+v!~ z+M^(1`mths*Dp^)Kv}-kx91L#qRPFyTzppiz8KISD@H_P%;?+kXU*95v-k)yC*os< ztA8J2!W0~ox44CmL$|`wxA!Hc{)_s@pv%5v%eUt%(?);X1cv>e$(C#5_!H0=KdXPt z+>bc+UP{l7x7D}s7m#uF?fr@gqaP*HNmkFo-+<@p+kLCZ`&6mHHmtD`Hqe6KBSTx( z|G~Q>!W!T~9g>~L74y8X%^3J6K$c$ +#include +#include +#include +#include // General GDK events and types +#include // GTK types + + +#define N_INSTANCE 5 +#define N_SPACE_SIZE 20 + +GtkWidget *window; + +// OpenGL objects +GLuint vao, vbo, ebo, instance_vbo, arrow_instance_vbo; +GLuint arrow_vao, arrow_vbo, arrow_ebo; +GLuint edge_ebo; +GLuint shader_program; +unsigned int num_instances = N_INSTANCE; +mat4 instance_matrices[N_INSTANCE]; + +static float pitch = 0.0f, yaw = -90.0f; // Initial angles for camera orientation +static const float sensitivity = 4.0f; // Adjust this for smoother mouse control +static float lastX = 400, lastY = 300; // Initial cursor position (center of the screen) +static float fov = 45.0f; // Field of View for zoom control +static gboolean firstMouse = TRUE; // To handle first mouse movement +static float rotation_angle_x = 0.0f; // Rotation angle around the X-axis +static float rotation_angle_y = 0.0f; // Rotation angle around the Y-axis +static float rotation_angle_z = 0.0f; // Rotation angle around the Z-axis + +static mat4 rotation_matrix; +static bool rotate; + +// Projection and view matrices +mat4 projection, view; + + +// Function Prototypes +GLuint create_shader_program (); +void setup_buffers (); +void setup_arrow_buffers (); +void setup_instance_data (); +void setup_arrow_instance_data(); +static void on_realize (GtkGLArea *area); +static gboolean on_render (GtkGLArea *area, GdkGLContext *context); +static void on_activate (GtkApplication *app, gpointer user_data); +static gboolean on_mouse_scroll(GtkEventControllerScroll *controller, gdouble dx, gdouble dy, gpointer user_data); +static gboolean on_mouse_move(GtkEventControllerMotion *controller, gdouble x, gdouble y, gpointer user_data); + +// Vertex and fragment shader source code +const char *vertex_shader_src = "#version 460 core\n" + "layout (location = 0) in vec3 aPos;\n" + "layout (location = 2) in mat4 instanceMatrix;\n" + "uniform mat4 projection;\n" + "uniform mat4 view;\n" + "void main() {\n" + " gl_Position = projection * view * instanceMatrix * vec4(aPos, 1.0);\n" + "}\n"; + +const char *fragment_shader_src = "#version 460 core\n" + "uniform vec4 FragColor;\n" + "out vec4 finalColor;\n" + "void main() {\n" + " finalColor = vec4(FragColor.rgb, 0.3); // Set alpha to 30%\n" + "}\n"; + +// Cube vertices and indices +GLfloat vertices[] = { + -0.5f, -0.5f, -0.5f, // 0 + 0.5f, -0.5f, -0.5f, // 1 + 0.5f, 0.5f, -0.5f, // 2 + -0.5f, 0.5f, -0.5f, // 3 + -0.5f, -0.5f, 0.5f, // 4 + 0.5f, -0.5f, 0.5f, // 5 + 0.5f, 0.5f, 0.5f, // 6 + -0.5f, 0.5f, 0.5f // 7 +}; + +GLuint indices[] = { + 4, 5, 6, 6, 7, 4, // Front face + 0, 3, 2, 2, 1, 0, // Back face + 0, 4, 7, 7, 3, 0, // Left face + 1, 2, 6, 6, 5, 1, // Right face + 3, 7, 6, 6, 2, 3, // Top face + 0, 1, 5, 5, 4, 0 // Bottom face +}; + +GLuint edge_indices[] = { + // Bottom edges + 0, 1, + 1, 5, + 5, 4, + 4, 0, + + // Top edges + 3, 2, + 2, 6, + 6, 7, + 7, 3, + + // Vertical edges + 0, 3, + 1, 2, + 5, 6, + 4, 7 +}; + +GLfloat arrow_vertices[] = { + 0.0f, 0.0f, 0.0f, // Center of cube + 0.5f, 0.0f, 0.0f, // Right face + -0.5f, 0.0f, 0.0f, // Left face + 0.0f, 0.5f, 0.0f, // Top face + 0.0f, -0.5f, 0.0f, // Bottom face + 0.0f, 0.0f, 0.5f, // Front face + 0.0f, 0.0f, -0.5f // Back face +}; + +GLuint arrow_indices[] = { + 0, 1, // Center to Right face + 0, 2, // Center to Left face + 0, 3, // Center to Top face + 0, 4, // Center to Bottom face + 0, 5, // Center to Front face + 0, 6 // Center to Back face +}; + +// Maps a 2D point on the screen to a 3D point on a virtual trackball (sphere) +void trackball_map(float x, float y, int width, int height, vec3 out) +{ + // Normalize x and y to the range [-1, 1] + float normalized_x = (2.0f * x - width) / width; + float normalized_y = (height - 2.0f * y) / height; // Inverted y axis + + // Compute the distance from the origin + float d = sqrtf(normalized_x * normalized_x + normalized_y * normalized_y); + + // Clamp the distance to 1 (the edge of the virtual trackball) + if (d > 1.0f) d = 1.0f; + + // Compute the z coordinate based on the spherical projection + float z = sqrtf(1.0f - d * d); + + // The output 3D point + out[0] = normalized_x; + out[1] = normalized_y; + out[2] = z; +} + + +static gboolean on_mouse_move(GtkEventControllerMotion *controller, gdouble x, gdouble y, gpointer user_data) +{ + GdkModifierType state = gtk_event_controller_get_current_event_state(GTK_EVENT_CONTROLLER(controller)); + + if (state & GDK_BUTTON1_MASK) { // If the left mouse button is held + + // Define screen width and height (adjust accordingly) + int width = gtk_widget_get_width(window); + int height = gtk_widget_get_height(window); + + + // Variables to store trackball positions + vec3 last_pos, cur_pos; + + // Map the last and current mouse positions to the virtual trackball + trackball_map(lastX, lastY, width, height, last_pos); + trackball_map(x, y, width, height, cur_pos); + + lastX = x; + lastY = y; + + // Calculate the rotation axis as the cross product between the last and current positions + vec3 axis; + glm_vec3_cross(last_pos, cur_pos, axis); + + // Calculate the angle of rotation based on the distance moved by the mouse + float angle = acosf(fmin(1.0f, glm_vec3_dot(last_pos, cur_pos))); + + // Apply the rotation using the axis-angle method + if (angle > 0.001f) { // Avoid very small rotations + mat4 temp_rotation; + glm_mat4_identity(temp_rotation); // Initialize a temporary rotation matrix + glm_rotate(temp_rotation, angle * sensitivity, axis); // Rotate around the computed axis + glm_mul(temp_rotation, rotation_matrix, rotation_matrix); // Accumulate the rotation + } + + // Request to redraw the scene with the updated rotation + gtk_widget_queue_draw(GTK_WIDGET(user_data)); + } + + rotate = TRUE; + + return TRUE; +} + + +static gboolean on_mouse_scroll(GtkEventControllerScroll *controller, gdouble dx, gdouble dy, gpointer user_data) +{ + if (dy > 0) + fov -= 2.0f; + else if (dy < 0) + fov += 2.0f; + + // Clamp the field of view to avoid extreme zooms + if (fov < 10.0f) fov = 10.0f; + if (fov > 90.0f) fov = 90.0f; + + // Update the projection matrix with the new FOV + glm_perspective(glm_rad(fov), 800.0f / 600.0f, 0.1f, 100.0f, projection); + + // Recalculate the view matrix for zoom (moving the camera in/out) + glm_lookat((vec3){0.0f, 0.0f, 20.0f}, (vec3){0.0f, 0.0f, 0.0f}, (vec3){0.0f, 1.0f, 0.0f}, view); + + gtk_widget_queue_draw(GTK_WIDGET(user_data)); // Request to redraw the scene + + return TRUE; +} + + + +// Called when GtkApplication is activated +static void on_activate (GtkApplication *app, gpointer user_data) +{ + g_message("[%s] activation in progress...", + __func__); + window = gtk_application_window_new(app); + gtk_window_set_title(GTK_WINDOW(window), "OpenGL 4.6 experiment"); + gtk_window_set_default_size(GTK_WINDOW(window), 800, 600); + + g_message("[%s] window created", + __func__); + + GtkWidget *gl_area = gtk_gl_area_new(); + gtk_gl_area_set_required_version(GTK_GL_AREA(gl_area), 4, 6); + gtk_gl_area_set_has_depth_buffer(GTK_GL_AREA(gl_area), TRUE); + gtk_gl_area_set_auto_render(GTK_GL_AREA(gl_area), TRUE); + + g_message("[%s] GLArea created", + __func__); + + g_signal_connect(gl_area, "realize", G_CALLBACK(on_realize), NULL); + g_signal_connect(gl_area, "render", G_CALLBACK(on_render), NULL); + + g_message("[%s] GLArea signals linked", + __func__); + + // Create and add motion event controller + GtkEventController *motion_controller = gtk_event_controller_motion_new(); + g_signal_connect(motion_controller, "motion", G_CALLBACK(on_mouse_move), gl_area); // Pass gl_area as user_data + gtk_widget_add_controller(gl_area, GTK_EVENT_CONTROLLER(motion_controller)); + + // Create and add scroll event controller + GtkEventController *scroll_controller = gtk_event_controller_scroll_new(GTK_EVENT_CONTROLLER_SCROLL_BOTH_AXES); + g_signal_connect(scroll_controller, "scroll", G_CALLBACK(on_mouse_scroll), gl_area); // Pass gl_area as user_data + gtk_widget_add_controller(gl_area, GTK_EVENT_CONTROLLER(scroll_controller)); + + g_message("[%s] Mouse events now linked to signals", + __func__); + + gtk_window_set_child(GTK_WINDOW(window), gl_area); + gtk_widget_set_visible(window, TRUE); + + g_message("[%s] GLArea set visible", + __func__); +} + +// Called when GtkGLArea is realized (OpenGL context is created) +static void on_realize(GtkGLArea *area) +{ + g_message("[%s] GLArea realization in progress...", __func__); + + gtk_gl_area_make_current(GTK_GL_AREA(area)); + + g_message("[%s] GLArea made current", __func__); + + if (gtk_gl_area_get_error(GTK_GL_AREA(area)) != NULL) return; + + g_message("[%s] OpenGL context successfully created", __func__); + + // Enable depth testing + glEnable(GL_DEPTH_TEST); + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + + glDepthFunc(GL_LESS); + + // Initialize cglm projection and view matrices + glm_mat4_identity(projection); + glm_perspective(glm_rad(60.0f), 800.0f / 600.0f, 0.1f, 100.0f, projection); + + glm_mat4_identity(view); + glm_lookat((vec3){0.0f, 0.0f, 20.0f}, (vec3){0.0f, 0.0f, 0.0f}, (vec3){0.0f, 1.0f, 0.0f}, view); + + // Initialize rotation matrix + glm_mat4_identity(rotation_matrix); // Initialize to identity + + // Create shader program and setup buffers + shader_program = create_shader_program(); + setup_buffers(); + setup_arrow_buffers(); + setup_instance_data(); + setup_arrow_instance_data(); // Setup arrow data + + // Set the background color + glClearColor(0.1f, 0.1f, 0.1f, 1.0f); // Dark gray background + glLineWidth(2.0f); // Increase the line width for cube edges +} + + +// Called on each frame to render the scene +static gboolean on_render(GtkGLArea *area, GdkGLContext *context) +{ + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glEnable(GL_DEPTH_TEST); + glDepthFunc(GL_LESS); + + glUseProgram(shader_program); + + // Pass projection and view matrices to the shader + GLint projectionLoc = glGetUniformLocation(shader_program, "projection"); + GLint viewLoc = glGetUniformLocation(shader_program, "view"); + glUniformMatrix4fv(projectionLoc, 1, GL_FALSE, (const GLfloat *)projection); + glUniformMatrix4fv(viewLoc, 1, GL_FALSE, (const GLfloat *)view); + + // Update instance matrices with the accumulated rotation matrix + if (rotate) { + for (unsigned int i = 0; i < num_instances; i++) { + mat4 model; + glm_mat4_copy(rotation_matrix, model); // Copy the accumulated rotation matrix + + // Combine the rotation with the instance's individual matrix + glm_mul(model, instance_matrices[i], instance_matrices[i]); + } + rotate = FALSE; + } + + // Update the instance matrix buffer with the modified instance matrices + glBindBuffer(GL_ARRAY_BUFFER, instance_vbo); + glBufferSubData(GL_ARRAY_BUFFER, 0, num_instances * sizeof(mat4), instance_matrices); + + // Draw the cubes with the updated instance matrices + glUniform4f(glGetUniformLocation(shader_program, "FragColor"), 0.4f, 0.6f, 0.9f, 1.0f); + glBindVertexArray(vao); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ebo); + glDrawElementsInstanced(GL_TRIANGLES, 36, GL_UNSIGNED_INT, 0, num_instances); + + // Draw the cube edges + glUniform4f(glGetUniformLocation(shader_program, "FragColor"), 1.0f, 1.0f, 1.0f, 1.0f); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, edge_ebo); + glDrawElementsInstanced(GL_LINES, 24, GL_UNSIGNED_INT, 0, num_instances); + + + glDisable(GL_DEPTH_TEST); + + // Set arrow color (e.g., red) and draw arrows + glUniform4f(glGetUniformLocation(shader_program, "FragColor"), 1.0f, 0.0f, 0.0f, 1.0f); // Red, opaque + glBindVertexArray(arrow_vao); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, arrow_ebo); + glDrawElementsInstanced(GL_LINES, 12, GL_UNSIGNED_INT, 0, num_instances); + + glEnable(GL_DEPTH_TEST); + glBindVertexArray(0); + + // Reset the rotation matrix to prevent continuous accumulation + glm_mat4_identity(rotation_matrix); + + return TRUE; +} + +// Create the shader program +GLuint create_shader_program () +{ + GLuint vertex_shader = glCreateShader(GL_VERTEX_SHADER); + glShaderSource(vertex_shader, 1, &vertex_shader_src, NULL); + glCompileShader(vertex_shader); + + GLuint fragment_shader = glCreateShader(GL_FRAGMENT_SHADER); + glShaderSource(fragment_shader, 1, &fragment_shader_src, NULL); + glCompileShader(fragment_shader); + + GLuint program = glCreateProgram(); + glAttachShader(program, vertex_shader); + glAttachShader(program, fragment_shader); + glLinkProgram(program); + + glDeleteShader(vertex_shader); + glDeleteShader(fragment_shader); + + return program; +} + +// Setup OpenGL buffers (VBO, VAO, EBO for cubes and edges) +void setup_buffers () +{ + glGenVertexArrays(1, &vao); + glBindVertexArray(vao); + + // Vertex buffer + glGenBuffers(1, &vbo); + glBindBuffer(GL_ARRAY_BUFFER, vbo); + glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW); + + // Face Index buffer (EBO for cube faces) + glGenBuffers(1, &ebo); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ebo); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(indices), indices, GL_STATIC_DRAW); + + // Vertex attributes + glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 3 * sizeof(float), (void*)0); + glEnableVertexAttribArray(0); + + // Edge Index buffer (EBO for cube edges) + glGenBuffers(1, &edge_ebo); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, edge_ebo); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(edge_indices), edge_indices, GL_STATIC_DRAW); + + glBindVertexArray(0); +} + +void setup_arrow_buffers() { + glGenVertexArrays(1, &arrow_vao); + glBindVertexArray(arrow_vao); + + // Vertex buffer for arrows + glGenBuffers(1, &arrow_vbo); + glBindBuffer(GL_ARRAY_BUFFER, arrow_vbo); + glBufferData(GL_ARRAY_BUFFER, sizeof(arrow_vertices), arrow_vertices, GL_STATIC_DRAW); + + // Index buffer for arrows + glGenBuffers(1, &arrow_ebo); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, arrow_ebo); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(arrow_indices), arrow_indices, GL_STATIC_DRAW); + + // Vertex attributes + glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 3 * sizeof(float), (void*)0); + glEnableVertexAttribArray(0); + + glBindVertexArray(0); +} + +// Setup instance data for cubes (random positions) +void setup_instance_data () +{ + g_message("[%s] setting up cube instance data...", + __func__); + + srand(time(NULL)); + + g_message("[%s] random seed initialized", + __func__); + + glGenBuffers(1, &instance_vbo); + glBindBuffer(GL_ARRAY_BUFFER, instance_vbo); + + g_message("[%s] instance_vbo buffer bound", + __func__); + + for (unsigned int i = 0; i < num_instances; i++) { + glm_mat4_identity(instance_matrices[i]); + + // Randomize positions + vec3 position = { + (float)(rand() % N_SPACE_SIZE) - 10.0f, // Random x from -10 to 10 + (float)(rand() % N_SPACE_SIZE) - 10.0f, // Random y from -10 to 10 + (float)(rand() % N_SPACE_SIZE) - 10.0f // Random z from -10 to 10 + }; + + glm_translate(instance_matrices[i], position); + } + g_message("[%s] generated %d cube instances", + __func__, + num_instances); + + // Pass the instance matrices to the instance VBO + glBufferData(GL_ARRAY_BUFFER, num_instances * sizeof(mat4), instance_matrices, GL_STATIC_DRAW); + + g_message("[%s] instance matrices passed to VBO", + __func__); + + // Setup vertex attribute for the model matrix (location = 2) +// Setup vertex attribute for the model matrix (location = 2) + glBindVertexArray(vao); + for (int i = 0; i < 4; i++) { + glVertexAttribPointer(2 + i, 4, GL_FLOAT, GL_FALSE, sizeof(mat4), (void*)(sizeof(vec4) * i)); + glEnableVertexAttribArray(2 + i); + glVertexAttribDivisor(2 + i, 1); // Tell OpenGL this is per-instance data + } + glBindVertexArray(0); + + + g_message("[%s] finalized model matrix vertex attribute ", + __func__); +} + +void setup_arrow_instance_data() { + // Define indices for the arrows (lines from center to cube faces) + GLuint arrow_indices[] = { + 0, 1, // Arrow pointing to right face + 0, 2, // Arrow pointing upwards + 0, 3, // Arrow pointing to front face + 0, 4, // Arrow pointing to left face + 0, 5, // Arrow pointing downwards + 0, 6 // Arrow pointing to back face + }; + + // Generate Vertex Array Object for arrows + glGenVertexArrays(1, &arrow_vao); + glBindVertexArray(arrow_vao); + + // Generate Vertex Buffer Object for arrows + GLuint arrow_vbo; + glGenBuffers(1, &arrow_vbo); + glBindBuffer(GL_ARRAY_BUFFER, arrow_vbo); + glBufferData(GL_ARRAY_BUFFER, sizeof(arrow_vertices), arrow_vertices, GL_STATIC_DRAW); + + // Generate Element Buffer Object for arrows + GLuint arrow_ebo; + glGenBuffers(1, &arrow_ebo); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, arrow_ebo); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(arrow_indices), arrow_indices, GL_STATIC_DRAW); + + // Define arrow vertex attributes + glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 3 * sizeof(float), (void*)0); + glEnableVertexAttribArray(0); + + // Arrow instance matrices (positions) -- same as cubes + glGenBuffers(1, &arrow_instance_vbo); + glBindBuffer(GL_ARRAY_BUFFER, arrow_instance_vbo); + glBufferData(GL_ARRAY_BUFFER, num_instances * sizeof(mat4), instance_matrices, GL_STATIC_DRAW); + + // Define vertex attribute for arrow instance matrix + for (int i = 0; i < 4; i++) { + glVertexAttribPointer(2 + i, 4, GL_FLOAT, GL_FALSE, sizeof(mat4), (void*)(sizeof(vec4) * i)); + glEnableVertexAttribArray(2 + i); + glVertexAttribDivisor(2 + i, 1); // Make this per-instance data + } + + glBindVertexArray(0); +} + +// Main Function +int main (int argc, char *argv[]) +{ + GtkApplication *app; + int status; + + g_message("[%s] welcome in this experiment with OpenGL 4.6 in GTK4", + __func__); + + // Create a new GtkApplication + app = gtk_application_new("org.example.instanced_cubes", G_APPLICATION_DEFAULT_FLAGS); + + g_message("[%s] application created", + __func__); + // Connect the "activate" signal to the activate callback + g_signal_connect(app, "activate", G_CALLBACK(on_activate), NULL); + + g_message("[%s] activate callback linked", + __func__); + + // Run the application + status = g_application_run(G_APPLICATION(app), argc, argv); + + g_message("[%s] application terminated", + __func__); + + // Free the application object + g_object_unref(app); + + g_message("[%s] bye!", + __func__); + + return status; +} diff --git a/journal.c b/journal.c old mode 100644 new mode 100755 diff --git a/manifest.scm b/manifest.scm old mode 100644 new mode 100755 diff --git a/src/actions.c b/src/actions.c old mode 100644 new mode 100755 diff --git a/src/fsm/dispatch.c b/src/fsm/dispatch.c old mode 100644 new mode 100755 diff --git a/src/fsm/engine/engine.c b/src/fsm/engine/engine.c old mode 100644 new mode 100755 diff --git a/src/fsm/journal.c b/src/fsm/journal.c old mode 100644 new mode 100755 diff --git a/src/fsm/measure/data_list.c b/src/fsm/measure/data_list.c old mode 100644 new mode 100755 diff --git a/src/fsm/measure/disp_list.c b/src/fsm/measure/disp_list.c old mode 100644 new mode 100755 diff --git a/src/fsm/measure/manage.c b/src/fsm/measure/manage.c old mode 100644 new mode 100755 diff --git a/src/fsm/measure/tool_list.c b/src/fsm/measure/tool_list.c old mode 100644 new mode 100755 diff --git a/src/fsm/prefer.c b/src/fsm/prefer.c old mode 100644 new mode 100755 diff --git a/src/fsm/result.c b/src/fsm/result.c old mode 100644 new mode 100755 diff --git a/src/graphics/draw.c b/src/graphics/draw.c old mode 100644 new mode 100755 diff --git a/src/graphics/grid.c b/src/graphics/grid.c old mode 100644 new mode 100755 diff --git a/src/graphics/init.c b/src/graphics/init.c old mode 100644 new mode 100755 diff --git a/src/graphics/shader.frag b/src/graphics/shader.frag old mode 100644 new mode 100755 diff --git a/src/graphics/shader.vert b/src/graphics/shader.vert old mode 100644 new mode 100755 diff --git a/src/main.c b/src/main.c old mode 100644 new mode 100755 diff --git a/src/parse.c b/src/parse.c old mode 100644 new mode 100755 diff --git a/src/signal.c b/src/signal.c old mode 100644 new mode 100755 diff --git a/src/util/draw/gl.c b/src/util/draw/gl.c old mode 100644 new mode 100755 index 88ee2a0..0e7c6f3 --- a/src/util/draw/gl.c +++ b/src/util/draw/gl.c @@ -331,8 +331,7 @@ GtkWidget *create_axis_slider(int axis) /* return true; */ /* } */ -static void -on_realize_debug (GtkGLArea *area) +static void on_realize_debug (GtkGLArea *area) { gdk_gl_context_make_current(gtk_gl_area_get_context(area)); if (gtk_gl_area_get_error(area) != NULL) { @@ -341,8 +340,7 @@ on_realize_debug (GtkGLArea *area) gtk_gl_area_set_has_depth_buffer(GTK_GL_AREA(area), TRUE); } -static gboolean -on_render_debug (GtkGLArea *area, GdkGLContext *context) +static gboolean on_render_debug (GtkGLArea *area, GdkGLContext *context) { GLenum err; while ((err = glGetError()) != GL_NO_ERROR) { diff --git a/src/util/io.c b/src/util/io.c old mode 100644 new mode 100755 diff --git a/src/util/list_2x2.c b/src/util/list_2x2.c old mode 100644 new mode 100755 diff --git a/src/util/pile.c b/src/util/pile.c old mode 100644 new mode 100755 diff --git a/src/util/sorted_list.c b/src/util/sorted_list.c old mode 100644 new mode 100755 diff --git a/src/util/tests.c b/src/util/tests.c old mode 100644 new mode 100755 diff --git a/src/widget/all_rules/compare/interest.c b/src/widget/all_rules/compare/interest.c old mode 100644 new mode 100755 diff --git a/src/widget/all_rules/dispatch.c b/src/widget/all_rules/dispatch.c old mode 100644 new mode 100755 diff --git a/src/widget/all_rules/tree/dispatch.c b/src/widget/all_rules/tree/dispatch.c old mode 100644 new mode 100755 diff --git a/src/widget/all_rules/tree/freq.c b/src/widget/all_rules/tree/freq.c old mode 100644 new mode 100755 diff --git a/src/widget/all_rules/tree/labo.c b/src/widget/all_rules/tree/labo.c old mode 100644 new mode 100755 diff --git a/src/widget/all_rules/tree/pilot_box.c b/src/widget/all_rules/tree/pilot_box.c old mode 100644 new mode 100755 diff --git a/src/widget/all_rules/tree/tree.c b/src/widget/all_rules/tree/tree.c old mode 100644 new mode 100755 diff --git a/src/widget/dispatch.c b/src/widget/dispatch.c old mode 100644 new mode 100755 diff --git a/src/widget/measure/dispatch.c b/src/widget/measure/dispatch.c old mode 100644 new mode 100755 diff --git a/src/widget/one_rule/algebra/assign.c b/src/widget/one_rule/algebra/assign.c old mode 100644 new mode 100755 diff --git a/src/widget/one_rule/algebra/conditions.c b/src/widget/one_rule/algebra/conditions.c old mode 100644 new mode 100755 diff --git a/src/widget/one_rule/algebra/dispatch.c b/src/widget/one_rule/algebra/dispatch.c old mode 100644 new mode 100755 diff --git a/src/widget/one_rule/algebra/identity.c b/src/widget/one_rule/algebra/identity.c old mode 100644 new mode 100755 diff --git a/src/widget/one_rule/algebra/utilities.c b/src/widget/one_rule/algebra/utilities.c old mode 100644 new mode 100755 diff --git a/src/widget/one_rule/dispatch.c b/src/widget/one_rule/dispatch.c old mode 100644 new mode 100755 diff --git a/src/widget/one_rule/geometry/camera.c b/src/widget/one_rule/geometry/camera.c old mode 100644 new mode 100755 diff --git a/src/widget/one_rule/geometry/dispatch.c b/src/widget/one_rule/geometry/dispatch.c old mode 100644 new mode 100755 diff --git a/src/widget/one_rule/geometry/edit_tools.c b/src/widget/one_rule/geometry/edit_tools.c old mode 100644 new mode 100755 diff --git a/src/widget/one_rule/geometry/enquire.c b/src/widget/one_rule/geometry/enquire.c old mode 100644 new mode 100755 diff --git a/src/widget/one_rule/geometry/geometry.c b/src/widget/one_rule/geometry/geometry.c old mode 100644 new mode 100755 diff --git a/src/widget/results/dispatch.c b/src/widget/results/dispatch.c old mode 100644 new mode 100755 diff --git a/src/widget/results/display.c b/src/widget/results/display.c old mode 100644 new mode 100755 diff --git a/src/widget/results/organize.c b/src/widget/results/organize.c old mode 100644 new mode 100755 diff --git a/src/widget/state/bottom.c b/src/widget/state/bottom.c old mode 100644 new mode 100755 diff --git a/src/widget/state/dispatch.c b/src/widget/state/dispatch.c old mode 100644 new mode 100755 diff --git a/src/widget/state/middle.c b/src/widget/state/middle.c old mode 100644 new mode 100755 diff --git a/src/widget/state/top.c b/src/widget/state/top.c old mode 100644 new mode 100755 diff --git a/src/widget/synth/dispatch.c b/src/widget/synth/dispatch.c old mode 100644 new mode 100755 diff --git a/src/widget/synth/time.c b/src/widget/synth/time.c old mode 100644 new mode 100755 diff --git a/src/widget/topbar/dialog.c b/src/widget/topbar/dialog.c old mode 100644 new mode 100755 diff --git a/src/widget/topbar/dispatch.c b/src/widget/topbar/dispatch.c old mode 100644 new mode 100755 diff --git a/src/widget/topbar/left.c b/src/widget/topbar/left.c old mode 100644 new mode 100755 diff --git a/src/widget/topbar/polytext.c b/src/widget/topbar/polytext.c old mode 100644 new mode 100755 diff --git a/src/widget/topbar/right.c b/src/widget/topbar/right.c old mode 100644 new mode 100755 diff --git a/src/widget/tree.c b/src/widget/tree.c old mode 100644 new mode 100755