diff --git a/projects/AppImage/.gitignore b/projects/AppImage/.gitignore new file mode 100644 index 0000000..10d8a1c --- /dev/null +++ b/projects/AppImage/.gitignore @@ -0,0 +1,2 @@ +MyApp.AppDir/usr/bin/myapp +MyApp.AppDir/myapp.svg diff --git a/projects/AppImage/MyApp.AppDir/AppRun b/projects/AppImage/MyApp.AppDir/AppRun new file mode 100755 index 0000000..b5fcf21 --- /dev/null +++ b/projects/AppImage/MyApp.AppDir/AppRun @@ -0,0 +1,5 @@ +#!/bin/sh + +touch ~/ololo.names + +$APPDIR/usr/bin/myapp diff --git a/projects/AppImage/MyApp.AppDir/myapp.desktop b/projects/AppImage/MyApp.AppDir/myapp.desktop new file mode 100644 index 0000000..73aaf9e --- /dev/null +++ b/projects/AppImage/MyApp.AppDir/myapp.desktop @@ -0,0 +1,6 @@ +[Desktop Entry] +Name=MyApp +Exec=myapp +Icon=myapp +Type=Application +Categories=Utility; diff --git a/projects/AppImage/README.md b/projects/AppImage/README.md new file mode 100644 index 0000000..e69de29 diff --git a/projects/AppImage/build.sh b/projects/AppImage/build.sh new file mode 100755 index 0000000..72d08cf --- /dev/null +++ b/projects/AppImage/build.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +# build executable +tcc example_app.c -lGL -lglfw -o MyApp.AppDir/usr/bin/myapp + +# build icon +# ICON=MyApp.AppDir/myapp.png +# [ ! -f $ICON ] && convert /usr/share/icons/breeze/apps/48/smartgit.svg -transparent white $ICON +cp /usr/share/icons/breeze/apps/48/smartgit.svg MyApp.AppDir/myapp.svg diff --git a/projects/AppImage/example_app.c b/projects/AppImage/example_app.c new file mode 100644 index 0000000..3762e30 --- /dev/null +++ b/projects/AppImage/example_app.c @@ -0,0 +1,34 @@ +#include + +int main(void) { + GLFWwindow *window; + + /* Initialize the library */ + if (!glfwInit()) + return -1; + + /* Create a windowed mode window and its OpenGL context */ + window = glfwCreateWindow(640, 480, "Hello World", NULL, NULL); + if (!window) { + glfwTerminate(); + return -1; + } + + /* Make the window's context current */ + glfwMakeContextCurrent(window); + + /* Loop until the user closes the window */ + while (!glfwWindowShouldClose(window)) { + /* Render here */ + glClear(GL_COLOR_BUFFER_BIT); + + /* Swap front and back buffers */ + glfwSwapBuffers(window); + + /* Poll for and process events */ + glfwPollEvents(); + } + + glfwTerminate(); + return 0; +}