AppImage example

This commit is contained in:
2024-03-20 00:21:51 +03:00
parent 1cb337c7b1
commit c7fd1da457
6 changed files with 56 additions and 0 deletions
+2
View File
@@ -0,0 +1,2 @@
MyApp.AppDir/usr/bin/myapp
MyApp.AppDir/myapp.svg
+5
View File
@@ -0,0 +1,5 @@
#!/bin/sh
touch ~/ololo.names
$APPDIR/usr/bin/myapp
@@ -0,0 +1,6 @@
[Desktop Entry]
Name=MyApp
Exec=myapp
Icon=myapp
Type=Application
Categories=Utility;
View File
+9
View File
@@ -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
+34
View File
@@ -0,0 +1,34 @@
#include <GLFW/glfw3.h>
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;
}