Compare commits
No commits in common. "e152c72a04ae22cf23f018d2f433ce8fcf2ed431" and "10d8cdae22b8b681f4f8250a29e0a4d61de78699" have entirely different histories.
e152c72a04
...
10d8cdae22
|
@ -26,7 +26,6 @@ Build dependencies:
|
||||||
|
|
||||||
- bash
|
- bash
|
||||||
- a C++ 20 compiler
|
- a C++ 20 compiler
|
||||||
- GLFW with headers
|
|
||||||
|
|
||||||
Setup dependencies:
|
Setup dependencies:
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ COMPILE_COMMANDS=(
|
||||||
"$CXX_WITH_FLAGS src/tools/arraydump.cpp -I./include -Lbin/lib -l:file.so -l:cli.so -o bin/tools/arraydump"
|
"$CXX_WITH_FLAGS src/tools/arraydump.cpp -I./include -Lbin/lib -l:file.so -l:cli.so -o bin/tools/arraydump"
|
||||||
"$CXX_WITH_FLAGS src/tools/baseconvert.cpp -I./include -Lbin/lib -l:cli.so -o bin/tools/baseconvert"
|
"$CXX_WITH_FLAGS src/tools/baseconvert.cpp -I./include -Lbin/lib -l:cli.so -o bin/tools/baseconvert"
|
||||||
"$CXX_WITH_FLAGS -pthread src/tools/hexnet.cpp -I./include -Lbin/lib -l:cli.so -l:libsockpp.so -o bin/tools/hexnet"
|
"$CXX_WITH_FLAGS -pthread src/tools/hexnet.cpp -I./include -Lbin/lib -l:cli.so -l:libsockpp.so -o bin/tools/hexnet"
|
||||||
"$CXX_WITH_FLAGS src/fossvg.cpp -I./include -Lbin/lib -l:cli.so -lglfw -o bin/fossvg"
|
"$CXX_WITH_FLAGS src/fossvg.cpp -I./include -Lbin/lib -l:cli.so -o bin/fossvg"
|
||||||
"$CXX_WITH_FLAGS src/fossvgd.cpp -I./include -Lbin/lib -l:cli.so -o bin/fossvgd"
|
"$CXX_WITH_FLAGS src/fossvgd.cpp -I./include -Lbin/lib -l:cli.so -o bin/fossvgd"
|
||||||
)
|
)
|
||||||
for command in ${!COMPILE_COMMANDS[@]}; do
|
for command in ${!COMPILE_COMMANDS[@]}; do
|
||||||
|
|
|
@ -25,7 +25,6 @@ remove .endianness
|
||||||
remove resources/check_endianness
|
remove resources/check_endianness
|
||||||
create_directory ./bin
|
create_directory ./bin
|
||||||
create_directory ./bin/lib
|
create_directory ./bin/lib
|
||||||
create_directory ./bin/lib/net
|
|
||||||
create_directory ./include
|
create_directory ./include
|
||||||
|
|
||||||
ln -vs ../../dependencies/sockpp-0.7.1/build/libsockpp.so bin/lib/
|
ln -vs ../../dependencies/sockpp-0.7.1/build/libsockpp.so bin/lib/
|
||||||
|
|
|
@ -18,10 +18,6 @@
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <cstdint>
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
#include <GLFW/glfw3.h>
|
|
||||||
|
|
||||||
#include "./lib/cli.hpp"
|
#include "./lib/cli.hpp"
|
||||||
|
|
||||||
|
@ -29,27 +25,6 @@
|
||||||
#define EXIT_RUNTIME 1
|
#define EXIT_RUNTIME 1
|
||||||
#define EXIT_USAGE 2
|
#define EXIT_USAGE 2
|
||||||
|
|
||||||
//TODO: check the TODO above glfwInit() in void main()
|
|
||||||
// #### Callbacks ##############################################################
|
|
||||||
void cursorPositionCallback(GLFWwindow* window, double x, double y) {
|
|
||||||
}
|
|
||||||
|
|
||||||
void keyCallback(GLFWwindow* window, int32_t key, int32_t scancode, int32_t action, int32_t mods) {
|
|
||||||
}
|
|
||||||
|
|
||||||
void textInputCallback(GLFWwindow* window, uint32_t codepoint) {
|
|
||||||
}
|
|
||||||
|
|
||||||
void cursorEnterLeaveCallback(GLFWwindow* window, int32_t entered) {
|
|
||||||
}
|
|
||||||
|
|
||||||
void mouseButtonCallback(GLFWwindow* window, int32_t button, int32_t action, int32_t mods) {
|
|
||||||
}
|
|
||||||
|
|
||||||
void scrollCallback(GLFWwindow* window, double x, double y) {
|
|
||||||
}
|
|
||||||
// #### End Callbacks ##########################################################
|
|
||||||
|
|
||||||
int main(int argc, char* argv[]) {
|
int main(int argc, char* argv[]) {
|
||||||
std::vector<CLI::Flag> flags;
|
std::vector<CLI::Flag> flags;
|
||||||
flags.push_back(CLI::Flag('h', "help", "print help and exit"));
|
flags.push_back(CLI::Flag('h', "help", "print help and exit"));
|
||||||
|
@ -88,50 +63,5 @@ int main(int argc, char* argv[]) {
|
||||||
return EXIT_USAGE;
|
return EXIT_USAGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// TODO: Find a better place for this
|
|
||||||
// Ideally, the window management and rendering portion of FOSS-VG should
|
|
||||||
// live in a library so it can be easily reloaded/restarted for things like
|
|
||||||
// switching from/to fullscreen. For now, I am going to put it here because
|
|
||||||
// I want to get it going before making it pretty.
|
|
||||||
{
|
|
||||||
if (!glfwInit()) {
|
|
||||||
return EXIT_RUNTIME;
|
|
||||||
}
|
|
||||||
|
|
||||||
//TODO: allow to set startup window size using CLI options
|
|
||||||
uint32_t windowWidth = 1366;
|
|
||||||
uint32_t windowHeight = 768;
|
|
||||||
//TODO: add a version macro
|
|
||||||
// (for example Git commit hash passed on the compiler command line)
|
|
||||||
std::string windowTitle = "FOSS-VG";
|
|
||||||
|
|
||||||
// Apparently, this also allows to set things like whether the window is full-screen
|
|
||||||
GLFWwindow* window = glfwCreateWindow(windowWidth, windowHeight, windowTitle.c_str(), nullptr, nullptr);
|
|
||||||
|
|
||||||
if (window == nullptr) {
|
|
||||||
return EXIT_RUNTIME;
|
|
||||||
}
|
|
||||||
|
|
||||||
// What dis do? It was in a tutorial.
|
|
||||||
glfwMakeContextCurrent(window);
|
|
||||||
|
|
||||||
glfwSetCursorPosCallback(window, cursorPositionCallback);
|
|
||||||
glfwSetKeyCallback(window, keyCallback);
|
|
||||||
glfwSetCharCallback(window, textInputCallback);
|
|
||||||
glfwSetCursorEnterCallback(window, cursorEnterLeaveCallback);
|
|
||||||
glfwSetMouseButtonCallback(window, mouseButtonCallback);
|
|
||||||
glfwSetScrollCallback(window, scrollCallback);
|
|
||||||
|
|
||||||
while (!glfwWindowShouldClose(window)) {
|
|
||||||
|
|
||||||
glfwSwapBuffers(window);
|
|
||||||
|
|
||||||
glfwPollEvents();
|
|
||||||
}
|
|
||||||
|
|
||||||
glfwTerminate();
|
|
||||||
}
|
|
||||||
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,8 +16,6 @@
|
||||||
// version 3 along with this program.
|
// version 3 along with this program.
|
||||||
// If not, see https://www.gnu.org/licenses/agpl-3.0.en.html
|
// If not, see https://www.gnu.org/licenses/agpl-3.0.en.html
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
|
@ -13,8 +13,6 @@
|
||||||
//version 3 along with this program.
|
//version 3 along with this program.
|
||||||
//If not, see https://www.gnu.org/licenses/agpl-3.0.en.html
|
//If not, see https://www.gnu.org/licenses/agpl-3.0.en.html
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <tinyutf8/tinyutf8.h>
|
#include <tinyutf8/tinyutf8.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "error.hpp"
|
#include "error.hpp"
|
||||||
|
|
|
@ -16,8 +16,6 @@
|
||||||
// version 3 along with this program.
|
// version 3 along with this program.
|
||||||
// If not, see https://www.gnu.org/licenses/agpl-3.0.en.html
|
// If not, see https://www.gnu.org/licenses/agpl-3.0.en.html
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
|
|
@ -16,8 +16,6 @@
|
||||||
// version 3 along with this program.
|
// version 3 along with this program.
|
||||||
// If not, see https://www.gnu.org/licenses/agpl-3.0.en.html
|
// If not, see https://www.gnu.org/licenses/agpl-3.0.en.html
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
|
|
@ -16,8 +16,6 @@
|
||||||
// version 3 along with this program.
|
// version 3 along with this program.
|
||||||
// If not, see https://www.gnu.org/licenses/agpl-3.0.en.html
|
// If not, see https://www.gnu.org/licenses/agpl-3.0.en.html
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue