Compare commits

...

7 Commits

Author SHA1 Message Date
1cea44a84a EGL instead of GL 2026-02-02 17:46:04 -06:00
eaaa30ca90 EGL instead of GL 2026-02-02 17:35:51 -06:00
889b852f5f update flake 2026-02-02 17:35:03 -06:00
9716a8ec46 try macro 2026-02-02 15:25:29 -06:00
7a73c3fc72 try platform check for glfw 2026-02-02 15:19:08 -06:00
c069267c7e update GLFW Error callback 2026-02-02 14:20:40 -06:00
6459d880c3 update Print with events 2026-02-02 13:39:47 -06:00
6 changed files with 42 additions and 35 deletions

View File

@@ -64,9 +64,9 @@
-DRENDERER=1 \ -DRENDERER=1 \
-DWINDOW=1 \ -DWINDOW=1 \
-I include -I $imgui -I . \ -I include -I $imgui -I . \
-lGL -lglfw -lGLEW \ -lEGL -lglfw -lGLEW \
-Wall \ -Wall \
-o $name -o $name -DIMGUI_IMPL_GLFW_DISABLE_X11
''; '';
installPhase = '' installPhase = ''
@@ -106,9 +106,9 @@
-DRENDERER=1 \ -DRENDERER=1 \
-DWINDOW=1 \ -DWINDOW=1 \
-I include -I $imgui -I . \ -I include -I $imgui -I . \
-lGL -lglfw -lGLEW \ -lEGL -lglfw -lGLEW \
-Wall \ -Wall \
-o $name -o $name -DIMGUI_IMPL_GLFW_DISABLE_X11
''; '';
installPhase = '' installPhase = ''

View File

@@ -171,9 +171,9 @@
-DTESTIMGUI_DYNAMIC \ -DTESTIMGUI_DYNAMIC \
-fpic -shared \ -fpic -shared \
-I include -I $imgui -I . \ -I include -I $imgui -I . \
-lGL -lglfw -lGLEW \ -lEGL -lglfw -lGLEW \
-Wall \ -Wall \
-o $name -o $name -DIMGUI_IMPL_GLFW_DISABLE_X11
''; '';
installPhase = '' installPhase = ''
@@ -214,9 +214,9 @@
-DCALCULATOR_DYNAMIC \ -DCALCULATOR_DYNAMIC \
-fpic -shared \ -fpic -shared \
-I include -I $imgui -I . \ -I include -I $imgui -I . \
-lGL -lglfw -lGLEW \ -lEGL -lglfw -lGLEW \
-Wall \ -Wall \
-o $name -o $name -DIMGUI_IMPL_GLFW_DISABLE_X11
''; '';
installPhase = '' installPhase = ''
@@ -360,9 +360,9 @@
-DWINDOW=1 \ -DWINDOW=1 \
-fpic -shared \ -fpic -shared \
-I include -I $imgui -I . \ -I include -I $imgui -I . \
-lGL -lglfw -lGLEW \ -lEGL -lglfw -lGLEW \
-Wall \ -Wall \
-o $name -o $name -DIMGUI_IMPL_GLFW_DISABLE_X11
''; '';
installPhase = '' installPhase = ''
@@ -407,9 +407,9 @@
-DWINDOW=2 \ -DWINDOW=2 \
-fpic -shared \ -fpic -shared \
-I include -I $imgui -I . \ -I include -I $imgui -I . \
-lGL -lSDL3 -lGLEW \ -lEGL -lSDL3 -lGLEW \
-Wall \ -Wall \
-o $name -o $name -DIMGUI_IMPL_GLFW_DISABLE_X11
''; '';
installPhase = '' installPhase = ''
@@ -450,9 +450,9 @@
-DTERMINAL_DYNAMIC \ -DTERMINAL_DYNAMIC \
-fpic -shared \ -fpic -shared \
-I include -I $imgui -I . \ -I include -I $imgui -I . \
-lGL -lglfw -lGLEW \ -lEGL -lglfw -lGLEW \
-Wall \ -Wall \
-o $name -o $name -DIMGUI_IMPL_GLFW_DISABLE_X11
''; '';
installPhase = '' installPhase = ''
@@ -496,11 +496,11 @@
-DOLLAMA_DYNAMIC \ -DOLLAMA_DYNAMIC \
-fpic -shared \ -fpic -shared \
-I include -I $imgui -I . \ -I include -I $imgui -I . \
-lGL -lglfw -lGLEW \ -lEGL -lglfw -lGLEW \
$(curl-config --cflags) \ $(curl-config --cflags) \
$(curl-config --libs) \ $(curl-config --libs) \
-Wall \ -Wall \
-o $name -o $name -DIMGUI_IMPL_GLFW_DISABLE_X11
''; '';
installPhase = '' installPhase = ''

20
flake.lock generated
View File

@@ -3,11 +3,11 @@
"clay": { "clay": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1746753934, "lastModified": 1767081147,
"narHash": "sha256-7Kx536YsmPTXUjs/jBknGAmqYsqqDh6T11AlarTeGLM=", "narHash": "sha256-DbNZXjHAl2cmsWtDyw8BpW6dF7VoWHZ9EvQytSpqaKI=",
"owner": "nicbarker", "owner": "nicbarker",
"repo": "clay", "repo": "clay",
"rev": "76265e4c3c97ebe5a4aab081d5c5a05e5a979d5d", "rev": "76ec3632d80c145158136fd44db501448e7b17c4",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -19,11 +19,11 @@
"imgui": { "imgui": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1747034542, "lastModified": 1769795052,
"narHash": "sha256-kVbyG7LXXHIOiI6dlZVID9DLErR+XNoAGp/R82TEpgo=", "narHash": "sha256-JRA4E/aFcEEoB9FYHcLcEs4tgcX41ix2VjMV61PVQeA=",
"owner": "ocornut", "owner": "ocornut",
"repo": "imgui", "repo": "imgui",
"rev": "e33069ce56d07751ca875eb239f41febef0ebcd3", "rev": "913a3c60561bb07e8fd410ec7d4a8f6f485defd6",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -35,16 +35,16 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1746957726, "lastModified": 1769900590,
"narHash": "sha256-k9ut1LSfHCr0AW82ttEQzXVCqmyWVA5+SHJkS5ID/Jo=", "narHash": "sha256-I7Lmgj3owOTBGuauy9FL6qdpeK2umDoe07lM4V+PnyA=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "a39ed32a651fdee6842ec930761e31d1f242cb94", "rev": "41e216c0ca66c83b12ab7a98cc326b5db01db646",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "nixos",
"ref": "nixos-24.11", "ref": "nixos-25.11",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }

View File

@@ -2,7 +2,7 @@
description = "Build Project Archimedes"; description = "Build Project Archimedes";
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11"; nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
imgui = { imgui = {
url = "github:ocornut/imgui?ref=docking"; url = "github:ocornut/imgui?ref=docking";
flake = false; flake = false;
@@ -114,9 +114,9 @@
-DRENDERER=1 \ -DRENDERER=1 \
-DWINDOW=1 \ -DWINDOW=1 \
-DWINDOWMODULE_DYNAMIC \ -DWINDOWMODULE_DYNAMIC \
-lGL -lglfw -lGLEW \ -lEGL -lglfw -lGLEW \
-Wall \ -Wall \
-o $name -o $name -DIMGUI_IMPL_GLFW_DISABLE_X11
''; '';
installPhase = '' installPhase = ''
@@ -157,9 +157,9 @@
-DCUSTOMFONT=${pkgs.fira-code}/share/fonts/truetype/FiraCode-VF.ttf \ -DCUSTOMFONT=${pkgs.fira-code}/share/fonts/truetype/FiraCode-VF.ttf \
-fpic -shared \ -fpic -shared \
-I include -I $imgui -I . \ -I include -I $imgui -I . \
-lGL -lglfw -lGLEW \ -lEGL -lglfw -lGLEW \
-Wall \ -Wall \
-o $name -o $name -DIMGUI_IMPL_GLFW_DISABLE_X11
''; '';
installPhase = '' installPhase = ''
@@ -243,9 +243,9 @@
-DMAINGUI_DYNAMIC \ -DMAINGUI_DYNAMIC \
-fpic -shared \ -fpic -shared \
-I include -I $imgui -I . \ -I include -I $imgui -I . \
-lGL -lglfw -lGLEW \ -lEGL -lglfw -lGLEW \
-Wall \ -Wall \
-o $name -o $name -DIMGUI_IMPL_GLFW_DISABLE_X11
''; '';
installPhase = '' installPhase = ''

View File

@@ -7,6 +7,7 @@
#include "utils/Window/WindowEvents.h" #include "utils/Window/WindowEvents.h"
#define GLFW_INCLUDE_NONE
#include <GLFW/glfw3.h> #include <GLFW/glfw3.h>
@@ -20,11 +21,16 @@ namespace Archimedes {
WindowGLFW(Window* p, const std::function<void(Event*)>& sendEvent) { WindowGLFW(Window* p, const std::function<void(Event*)>& sendEvent) {
/*if(glfwPlatformSupported(GLFW_PLATFORM_WAYLAND)) {
glfwInitHint(GLFW_PLATFORM, GLFW_PLATFORM_WAYLAND);
}*/
data.window = p; data.window = p;
data.sendEvent = sendEvent; data.sendEvent = sendEvent;
glfwSetErrorCallback([](int e, const char* m){ glfwSetErrorCallback([](int e, const char* m){
std::cout << "GLFW Error: " << m << std::endl; std::cout << "GLFW Error " << e << ": " << m << std::endl;
}); });
if(!glfwInit()) { if(!glfwInit()) {
@@ -34,6 +40,7 @@ namespace Archimedes {
w = glfwCreateWindow(640, 480, "Archimedes", NULL, NULL); w = glfwCreateWindow(640, 480, "Archimedes", NULL, NULL);
if(!w) { if(!w) {
std::cout << "glfwCreateWindow failed!\n";
glfwTerminate(); glfwTerminate();
std::abort(); std::abort();
} }

View File

@@ -13,5 +13,5 @@ Print::~Print() {
void Print::run() { void Print::run() {
std::cout << "Print lib loaded and run!\n"; std::cout << "Print lib loaded and run!\n";
app->stopModule(name); app->emitEvent(new Archimedes::DoUnloadModuleEvent(name));
} }