From 921ae9cd429d236301abeed6c4a53c78dd698f9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=27=C3=A9lectron=20rare?= <108685187+electron-rare@users.noreply.github.com> Date: Mon, 18 May 2026 17:05:44 +0200 Subject: [PATCH] build: add openFrameworks app skeleton Copy oscope-of's Makefile and libusb-aware config.make, add a window bootstrap and a placeholder ofApp so the GL build is verified before any feature code lands. --- oscope-sphere/Makefile | 14 +++++++++++ oscope-sphere/config.make | 50 +++++++++++++++++++++++++++++++++++++ oscope-sphere/src/main.cpp | 17 +++++++++++++ oscope-sphere/src/ofApp.cpp | 13 ++++++++++ oscope-sphere/src/ofApp.h | 9 +++++++ 5 files changed, 103 insertions(+) create mode 100644 oscope-sphere/Makefile create mode 100644 oscope-sphere/config.make create mode 100644 oscope-sphere/src/main.cpp create mode 100644 oscope-sphere/src/ofApp.cpp create mode 100644 oscope-sphere/src/ofApp.h diff --git a/oscope-sphere/Makefile b/oscope-sphere/Makefile new file mode 100644 index 0000000..bbfb31f --- /dev/null +++ b/oscope-sphere/Makefile @@ -0,0 +1,14 @@ +# Délègue au Makefile générique d'openFrameworks. +# Suppose que le projet est cloné dans /apps/myApps/oscope-of/. + +ifndef PROJECT_ROOT + PROJECT_ROOT := $(realpath ./) +endif + +include $(PROJECT_ROOT)/config.make + +ifndef OF_ROOT + OF_ROOT = ../../.. +endif + +include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk diff --git a/oscope-sphere/config.make b/oscope-sphere/config.make new file mode 100644 index 0000000..3c8caf7 --- /dev/null +++ b/oscope-sphere/config.make @@ -0,0 +1,50 @@ +################################################################################ +# CONFIGURE PROJECT MAKEFILE (optional) +# This file is where we make project specific configurations. +################################################################################ + +################################################################################ +# OF ROOT +################################################################################ +OF_ROOT = ../../.. + +################################################################################ +# PROJECT EXCLUSIONS +################################################################################ +# PROJECT_EXCLUSIONS = + +################################################################################ +# LIBUSB AUTO-DETECT +# Préfère pkg-config (Apple Silicon + Intel + Linux), fallback à +# `brew --prefix libusb` si pkg-config n'est pas installé. +################################################################################ +HAS_PKGCONFIG := $(shell command -v pkg-config 2>/dev/null) +ifneq ($(HAS_PKGCONFIG),) + LIBUSB_CFLAGS := $(shell pkg-config --cflags libusb-1.0) + LIBUSB_LDFLAGS := $(shell pkg-config --libs libusb-1.0) +else + HAS_BREW := $(shell command -v brew 2>/dev/null) + ifneq ($(HAS_BREW),) + LIBUSB_PREFIX := $(shell brew --prefix libusb) + LIBUSB_CFLAGS := -I$(LIBUSB_PREFIX)/include/libusb-1.0 + LIBUSB_LDFLAGS := -L$(LIBUSB_PREFIX)/lib -lusb-1.0 + else + # Fallback générique + LIBUSB_CFLAGS := -I/usr/local/include/libusb-1.0 -I/opt/homebrew/include/libusb-1.0 + LIBUSB_LDFLAGS := -L/usr/local/lib -L/opt/homebrew/lib -lusb-1.0 + endif +endif + +PROJECT_CFLAGS = $(LIBUSB_CFLAGS) +PROJECT_LDFLAGS = $(LIBUSB_LDFLAGS) + +################################################################################ +# PROJECT CPPFLAGS +################################################################################ +PROJECT_CPPFLAGS = -std=c++17 + +################################################################################ +# PROJECT OPTIMIZATION CFLAGS +################################################################################ +# PROJECT_OPTIMIZATION_CFLAGS_RELEASE = +# PROJECT_OPTIMIZATION_CFLAGS_DEBUG = diff --git a/oscope-sphere/src/main.cpp b/oscope-sphere/src/main.cpp new file mode 100644 index 0000000..98c5022 --- /dev/null +++ b/oscope-sphere/src/main.cpp @@ -0,0 +1,17 @@ +// oscope-sphere — window bootstrap. GL 3.2 core profile, MSAA 8x. +#include "ofMain.h" +#include "ofApp.h" + +int main() { + ofGLFWWindowSettings settings; + settings.setGLVersion(3, 2); + settings.setSize(1920, 1080); + settings.numSamples = 8; + settings.windowMode = OF_WINDOW; + settings.title = "oscope-sphere"; + + auto window = ofCreateWindow(settings); + ofRunApp(window, std::make_shared()); + ofRunMainLoop(); + return 0; +} diff --git a/oscope-sphere/src/ofApp.cpp b/oscope-sphere/src/ofApp.cpp new file mode 100644 index 0000000..6a6ab0c --- /dev/null +++ b/oscope-sphere/src/ofApp.cpp @@ -0,0 +1,13 @@ +#include "ofApp.h" + +void ofApp::setup() { + ofSetFrameRate(60); + ofBackground(6, 6, 10); +} + +void ofApp::update() {} + +void ofApp::draw() { + ofSetColor(230); + ofDrawBitmapString("oscope-sphere skeleton", 16, 24); +} diff --git a/oscope-sphere/src/ofApp.h b/oscope-sphere/src/ofApp.h new file mode 100644 index 0000000..a9197b9 --- /dev/null +++ b/oscope-sphere/src/ofApp.h @@ -0,0 +1,9 @@ +#pragma once +#include "ofMain.h" + +class ofApp : public ofBaseApp { +public: + void setup() override; + void update() override; + void draw() override; +};