main files
This commit is contained in:
@@ -19,6 +19,5 @@ config.status
|
||||
forge
|
||||
*.tar.gz
|
||||
configure
|
||||
src/forge*
|
||||
*.pkg.tar.zst
|
||||
pkg
|
||||
@@ -1,4 +1,5 @@
|
||||
AUTOMAKE_OPTIONS = foreign subdir-objects -Wall
|
||||
bin_PROGRAMS = forge
|
||||
forge_SOURCES = src/main.c src/args.c src/forge.c
|
||||
forge_CFLAGS = -Ofast -march=native -flto -funroll-loops -fprefetch-loop-arrays -fno-exceptions -fopenmp
|
||||
include_HEADERS = src/main.h src/args.h src/config.h src/types.h src/forge.h
|
||||
+1
-1
@@ -9,7 +9,7 @@ clean:
|
||||
|
||||
build:
|
||||
@mkdir -p build
|
||||
gcc -Wall src/*.c src/*.h -lglfw -lGL -lm -o build/$(TARGET)
|
||||
gcc -Wall -Wextra src/*.c src/*.h -lglfw -lGL -lm -o build/$(TARGET)
|
||||
|
||||
.PHONY: install
|
||||
install: build
|
||||
|
||||
@@ -15,7 +15,7 @@ TODO
|
||||
|
||||
See [Releases](https://github.com/klemek/forge/releases)
|
||||
|
||||
```sh
|
||||
```shell
|
||||
tar xvzf forge-x.y.z.tar.gz
|
||||
cd forge-x.y.z
|
||||
./configure
|
||||
@@ -25,7 +25,7 @@ make install
|
||||
|
||||
### From repository (PKGBUILD)
|
||||
|
||||
```sh
|
||||
```shell
|
||||
git clone https://github.com/klemek/forge
|
||||
cd forge
|
||||
forge -si
|
||||
@@ -34,7 +34,7 @@ forge -si
|
||||
|
||||
### From repository (dev version)
|
||||
|
||||
```sh
|
||||
```shell
|
||||
git clone https://github.com/klemek/forge
|
||||
cd forge
|
||||
aclocal
|
||||
@@ -59,21 +59,24 @@ options:
|
||||
|
||||
## Release guide
|
||||
|
||||
```bash
|
||||
```shell
|
||||
# get latest version
|
||||
git pull origin master
|
||||
# update configure.ac with new version
|
||||
$EDITOR configure.ac
|
||||
# make full build
|
||||
make -f Makefile.dev release
|
||||
# update PKGBUILD with new version and sha256 sum
|
||||
sha256sum forge-x.y.z.tar.gz
|
||||
$EDITOR PKGBUILD
|
||||
# push to repo
|
||||
git commit -am "forge vX.Y.Z"
|
||||
git tag vX.Y.Z
|
||||
git push origin master --tags
|
||||
# create release from tag on github
|
||||
# update PKGBUILD with new sha256 sum
|
||||
sha256sum forge-x.y.z.tar.gz
|
||||
# attach .tar.gz to the github release
|
||||
make -f Makefile.dev release-arch
|
||||
git commit -am "update arch sha256"
|
||||
# add .pkg.tar.zst on the release
|
||||
# attach .pkg.tar.zst to the github release
|
||||
```
|
||||
|
||||
## Roadmap
|
||||
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
#include "config.h"
|
||||
#include "types.h"
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
void error_callback(int error, const char *description) {
|
||||
fprintf(stderr, "Error: %s\n", description);
|
||||
}
|
||||
|
||||
static void key_callback(GLFWwindow *window, int key, int scancode, int action,
|
||||
int mods) {
|
||||
if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
|
||||
glfwSetWindowShouldClose(window, GLFW_TRUE);
|
||||
}
|
||||
|
||||
void forge_run(parameters params) {
|
||||
GLFWwindow *window;
|
||||
glfwSetErrorCallback(error_callback);
|
||||
|
||||
fprintf(stdout, "[GLFW] %s\n", glfwGetVersionString());
|
||||
|
||||
if (!glfwInit()) {
|
||||
fprintf(stderr, "[GLFW] Initialization failed\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
window = glfwCreateWindow(640, 480, PACKAGE " " VERSION, NULL, NULL);
|
||||
|
||||
if (!window) {
|
||||
fprintf(stderr, "[GLFW] Window or context creation failed\n");
|
||||
glfwTerminate();
|
||||
exit(1);
|
||||
}
|
||||
|
||||
glfwMakeContextCurrent(window);
|
||||
glfwSetKeyCallback(window, key_callback);
|
||||
glfwSwapInterval(1);
|
||||
|
||||
while (!glfwWindowShouldClose(window)) {
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
glfwSwapBuffers(window);
|
||||
glfwPollEvents();
|
||||
}
|
||||
|
||||
glfwTerminate();
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
#include "types.h"
|
||||
|
||||
#ifndef FORGE_H
|
||||
#define FORGE_H
|
||||
|
||||
void forge_run(parameters params);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user