AppImage example
This commit is contained in:
parent
1cb337c7b1
commit
c7fd1da457
2
projects/AppImage/.gitignore
vendored
Normal file
2
projects/AppImage/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
MyApp.AppDir/usr/bin/myapp
|
||||||
|
MyApp.AppDir/myapp.svg
|
5
projects/AppImage/MyApp.AppDir/AppRun
Executable file
5
projects/AppImage/MyApp.AppDir/AppRun
Executable file
@ -0,0 +1,5 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
touch ~/ololo.names
|
||||||
|
|
||||||
|
$APPDIR/usr/bin/myapp
|
6
projects/AppImage/MyApp.AppDir/myapp.desktop
Normal file
6
projects/AppImage/MyApp.AppDir/myapp.desktop
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
[Desktop Entry]
|
||||||
|
Name=MyApp
|
||||||
|
Exec=myapp
|
||||||
|
Icon=myapp
|
||||||
|
Type=Application
|
||||||
|
Categories=Utility;
|
0
projects/AppImage/README.md
Normal file
0
projects/AppImage/README.md
Normal file
9
projects/AppImage/build.sh
Executable file
9
projects/AppImage/build.sh
Executable 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
projects/AppImage/example_app.c
Normal file
34
projects/AppImage/example_app.c
Normal 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;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user