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.
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
# Délègue au Makefile générique d'openFrameworks.
|
||||
# Suppose que le projet est cloné dans <OF_ROOT>/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
|
||||
@@ -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 =
|
||||
@@ -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<ofApp>());
|
||||
ofRunMainLoop();
|
||||
return 0;
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
#pragma once
|
||||
#include "ofMain.h"
|
||||
|
||||
class ofApp : public ofBaseApp {
|
||||
public:
|
||||
void setup() override;
|
||||
void update() override;
|
||||
void draw() override;
|
||||
};
|
||||
Reference in New Issue
Block a user