Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9b7fbfbeeb | ||
|
|
192cf571b1 | ||
|
|
519a9b88f4 |
@@ -1,12 +1,12 @@
|
||||
pkgname=forge-steel
|
||||
pkgver=1.2.1
|
||||
pkgver=1.2.2
|
||||
pkgrel=1
|
||||
pkgdesc="Fusion Of Real Time Generative Effects"
|
||||
arch=('i686' 'pentium4' 'x86_64' 'arm' 'armv7h' 'armv6h' 'aarch64' 'riscv64')
|
||||
depends=('glfw>=1:3', 'v4l-utils>=1.32', 'alsa-lib>=1.2', 'libglvnd>=1.7')
|
||||
url="https://git.klemek.fr/klemek/forge-steel"
|
||||
source=("${pkgname}-steel-${pkgver}.tar.gz::https://git.klemek.fr/klemek/forge-steel/releases/download/v${pkgver}/${pkgname}-${pkgver}.tar.gz")
|
||||
sha256sums=('57559bde7a524e3c9e70de4bc9b675a5a086590a8d85697cebd80c0ebd09f149')
|
||||
sha256sums=('e1c7c7bb9a614609b3d7e8647511c23cbe7a7a3d715b0c236b627c4e2dcbf4dd')
|
||||
srcdir=build
|
||||
backup=("usr/share/${pkgname}")
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
AC_INIT([forge], [steel-1.2.1], [klemek.dev@proton.me])
|
||||
AC_INIT([forge], [steel-1.2.2], [klemek.dev@proton.me])
|
||||
AM_INIT_AUTOMAKE
|
||||
AC_PROG_CC
|
||||
|
||||
|
||||
+20
-1
@@ -7,6 +7,8 @@
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "constants.h"
|
||||
|
||||
#include "args.h"
|
||||
#include "config.h"
|
||||
#include "string.h"
|
||||
@@ -42,6 +44,10 @@ static void print_help(int status_code) {
|
||||
"[-mr / -nmr] "
|
||||
"[-tm] "
|
||||
"[-tf] "
|
||||
"[--x11] "
|
||||
"[--wayland] "
|
||||
"[--cocoa] "
|
||||
"[--win32] "
|
||||
"\n\n"
|
||||
"Fusion Of Real-time Generative Effects.\n\n"
|
||||
"options:\n"
|
||||
@@ -81,7 +87,11 @@ static void print_help(int status_code) {
|
||||
" -mr, --midi-reconnect auto-reconnect midi (default)\n"
|
||||
" -nmr, --no-midi-reconnect do not auto-reconnect midi\n"
|
||||
" -tm, --trace-midi print midi code and values\n"
|
||||
" -tf, --trace-fps print fps status of subsystems\n");
|
||||
" -tf, --trace-fps print fps status of subsystems\n"
|
||||
" --x11 force X11 GLFW backend\n"
|
||||
" --wayland force Wayland GLFW backend\n"
|
||||
" --cocoa force Cocoa GLFW backend\n"
|
||||
" --win32 force Win32 GLFW backend\n");
|
||||
exit(status_code);
|
||||
}
|
||||
|
||||
@@ -152,6 +162,7 @@ void args_parse(Parameters *params, int argc, char **argv) {
|
||||
params->midi_reconnect = true;
|
||||
params->trace_midi = false;
|
||||
params->trace_fps = false;
|
||||
params->glfw_backend = GLFW_BACKEND_ANY;
|
||||
|
||||
for (int i = 1; i < argc; i++) {
|
||||
arg = argv[i];
|
||||
@@ -220,6 +231,14 @@ void args_parse(Parameters *params, int argc, char **argv) {
|
||||
params->trace_midi = true;
|
||||
} else if (is_arg(arg, "-tf") || is_arg(arg, "--trace-fps")) {
|
||||
params->trace_fps = true;
|
||||
} else if (is_arg(arg, "--x11")) {
|
||||
params->glfw_backend = GLFW_BACKEND_X11;
|
||||
} else if (is_arg(arg, "--wayland")) {
|
||||
params->glfw_backend = GLFW_BACKEND_WAYLAND;
|
||||
} else if (is_arg(arg, "--cocoa")) {
|
||||
params->glfw_backend = GLFW_BACKEND_COCOA;
|
||||
} else if (is_arg(arg, "--win32")) {
|
||||
params->glfw_backend = GLFW_BACKEND_WIN32;
|
||||
} else {
|
||||
#ifdef VIDEO_IN
|
||||
if (is_arg(arg, "-vi") || is_arg(arg, "--video-in")) {
|
||||
|
||||
@@ -3,6 +3,12 @@
|
||||
#ifndef CONSTANTS_H
|
||||
#define CONSTANTS_H
|
||||
|
||||
static const unsigned int GLFW_BACKEND_ANY = 0;
|
||||
static const unsigned int GLFW_BACKEND_X11 = 1;
|
||||
static const unsigned int GLFW_BACKEND_WAYLAND = 2;
|
||||
static const unsigned int GLFW_BACKEND_COCOA = 3;
|
||||
static const unsigned int GLFW_BACKEND_WIN32 = 4;
|
||||
|
||||
static const char *vertex_shader_text =
|
||||
"#version 460\n"
|
||||
"const mat4 mvp = "
|
||||
|
||||
+1
-1
@@ -286,7 +286,7 @@ static bool init(const Parameters *params) {
|
||||
|
||||
start_state_background_write();
|
||||
|
||||
window_startup(error_callback);
|
||||
window_startup(error_callback, params->glfw_backend);
|
||||
|
||||
context.tex_resolution[0] = params->internal_size;
|
||||
context.tex_resolution[1] = params->internal_size;
|
||||
|
||||
@@ -58,6 +58,7 @@ typedef struct Parameters {
|
||||
bool midi_reconnect;
|
||||
bool trace_midi;
|
||||
bool trace_fps;
|
||||
unsigned int glfw_backend;
|
||||
} Parameters;
|
||||
|
||||
// file.c
|
||||
|
||||
+31
-3
@@ -5,9 +5,12 @@
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "constants.h"
|
||||
|
||||
#include "window.h"
|
||||
|
||||
static void init_glfw(void (*error_callback)(int, const char *)) {
|
||||
static void init_glfw(void (*error_callback)(int, const char *),
|
||||
const unsigned int backend) {
|
||||
log_info("[GLFW] Initializing...");
|
||||
|
||||
// set errors handler
|
||||
@@ -16,6 +19,28 @@ static void init_glfw(void (*error_callback)(int, const char *)) {
|
||||
// print current GLFW version
|
||||
log_info("[GLFW] %s", glfwGetVersionString());
|
||||
|
||||
switch (backend) {
|
||||
case GLFW_BACKEND_X11:
|
||||
glfwInitHint(GLFW_PLATFORM, GLFW_PLATFORM_X11);
|
||||
log_info("[GLFW] platform: X11");
|
||||
break;
|
||||
case GLFW_BACKEND_WAYLAND:
|
||||
glfwInitHint(GLFW_PLATFORM, GLFW_PLATFORM_WAYLAND);
|
||||
log_info("[GLFW] platform: Wayland");
|
||||
break;
|
||||
case GLFW_BACKEND_COCOA:
|
||||
glfwInitHint(GLFW_PLATFORM, GLFW_PLATFORM_COCOA);
|
||||
log_info("[GLFW] platform: Cocoa");
|
||||
break;
|
||||
case GLFW_BACKEND_WIN32:
|
||||
glfwInitHint(GLFW_PLATFORM, GLFW_BACKEND_WIN32);
|
||||
log_info("[GLFW] platform: Win32");
|
||||
break;
|
||||
default:
|
||||
log_info("[GLFW] platform: Any");
|
||||
break;
|
||||
}
|
||||
|
||||
// init GLFW
|
||||
if (!glfwInit()) {
|
||||
log_error("[GLFW] Initialization failed");
|
||||
@@ -86,8 +111,9 @@ create_window(GLFWmonitor *monitor, const char *title, Window *shared_context,
|
||||
|
||||
static void use_window(GLFWwindow *window) { glfwMakeContextCurrent(window); }
|
||||
|
||||
void window_startup(void (*error_callback)(int, const char *)) {
|
||||
init_glfw(error_callback);
|
||||
void window_startup(void (*error_callback)(int, const char *),
|
||||
const unsigned int backend) {
|
||||
init_glfw(error_callback, backend);
|
||||
}
|
||||
|
||||
void window_terminate() {
|
||||
@@ -107,6 +133,8 @@ Window *window_init(const char *title, unsigned char monitor_index,
|
||||
|
||||
use_window(window);
|
||||
|
||||
glfwSwapInterval(0);
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
#ifndef WINDOW_H
|
||||
#define WINDOW_H
|
||||
|
||||
void window_startup(void (*error_callback)(int, const char *));
|
||||
void window_startup(void (*error_callback)(int, const char *), const unsigned int backend);
|
||||
|
||||
void window_terminate();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user