{"id":15366769,"url":"https://github.com/erkkah/timogr","last_synced_at":"2025-04-15T06:16:01.614Z","repository":{"id":39579814,"uuid":"335202461","full_name":"erkkah/timogr","owner":"erkkah","description":"TIny MObile GRaphics starter. Create tiny Android apps based on the TIGR library.","archived":false,"fork":false,"pushed_at":"2024-07-11T18:56:05.000Z","size":1085,"stargazers_count":31,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-15T06:15:56.755Z","etag":null,"topics":["2d-graphics","android","mobile-game","tigr","tiny"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/erkkah.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-02T07:20:13.000Z","updated_at":"2025-03-23T06:13:14.000Z","dependencies_parsed_at":"2024-10-16T08:40:37.332Z","dependency_job_id":"1ea1d882-8cf3-452a-9907-b1a0638692f1","html_url":"https://github.com/erkkah/timogr","commit_stats":{"total_commits":76,"total_committers":1,"mean_commits":76.0,"dds":0.0,"last_synced_commit":"7d23fb8ce0af1d860fd730c84b33f9447d8bd7e7"},"previous_names":[],"tags_count":4,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erkkah%2Ftimogr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erkkah%2Ftimogr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erkkah%2Ftimogr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erkkah%2Ftimogr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erkkah","download_url":"https://codeload.github.com/erkkah/timogr/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249016643,"owners_count":21198833,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["2d-graphics","android","mobile-game","tigr","tiny"],"created_at":"2024-10-01T13:19:47.705Z","updated_at":"2025-04-15T06:16:01.594Z","avatar_url":"https://github.com/erkkah.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TIMOGR - TIny MObile GRaphics starter template\n\n![logo](./app/src/main/assets/timogr.png)\n\nTIMOGR is a tiny Android starter template for creating fullscreen 2D apps using the\n[TIGR](https://github.com/erkkah/tigr) library.\n\nLike TIGR, TIMOGR is designed to be small and mostly independent.\n\nTIMOGR takes care of the Android life-cycle stuff and lets you write the fun part of your little app.\nOh, and you don't need Android Studio - it works just fine with the plain Android SDK + NDK,\nand you can build, run and debug from [within VS Code](#debugging-in-vs-code).\n\n## Getting started\n\n* [Generate](https://github.com/erkkah/timogr/generate) your own repo based on this template\n* Clone your new repo to get the files to your machine\n* Install Android SDK (or Android Studio)\n* If not already in place, install the Android NDK (Use sdkmanager or Android Studio)\n* Make sure `ANDROID_SDK_ROOT` is set, and `JAVA_HOME` if gradle cannot find the correct version below.\n* Copy keystore.properties.example to keystore.properties (and modify it if you want to sign your app)\n* Run a test build: `./gradlew buildCMakeDebug` (that's `gradlew.bat build` on Windows)\n* Tweak `app/build/build.gradle` if the test build complains about `compileSdkVersion` or `ndkVersion`\n* Plug in your device (or run an emulator), and run `./gradlew installDebug` to install the template TIMOGR app\n* Run the app (and report back if there are problems)\n\nNow, replace the meat of `app/src/main/cpp/main.c` with your TIGR code, and you're done.\n\nJust like with desktop TIGR, the code can be as tiny as this:\n\n```C\n#include \"tigr.h\"\n\nvoid tigrMain()\n{\n    Tigr *screen = tigrWindow(320, 240, \"Hello\", TIGR_4X);\n    while (!tigrClosed(screen))\n    {\n        tigrClear(screen, tigrRGB(0x80, 0x90, 0xa0));\n        tigrPrint(screen, tfont, 120, 110, tigrRGB(0xff, 0xff, 0xff), \"Hello, world.\");\n        tigrUpdate(screen);\n    }\n    tigrFree(screen);\n}\n```\n\n## Debugging in VS Code\n\n**Experimental!**\n\nThe project includes `.vscode` configuration of tasks for building and debugging directly in VS Code.\n\n\u003e This currently requires a working `go` installation, so that you can build `go` executables.\n\nTo get started, connect a device or launch an emulator, then simply press F5 to build and start debugging.\n\n\u003e You can launch the default (first) emulator by running `./dbgtool/dbgtool emulator`.\n\n## Some details and pointers\n\n### Input\n\n* Keyboard input using the virtual keyboard is supported. Use `tigrShowKeyboard()` to show or hide the keyboard.\n* The \"back\" button produces a TK_ESCAPE keypress.\n* The \"buttons\" reported by `tigrMouse` is the number of detected touch points, the position is always of the last triggered touch point.\n* Use `tigrTouch` to process multi-touch input.\n\n### Threads and extending the Android side\n\nThe `tigrMain` entry point runs on a rendering thread separate from the Activity main thread. If you need to do more Android specifics, check out the Activity implementation in `tigractivity.cpp`.\n\n### Files and assets\n\nReading \"files\" by using `tigrLoadImage` for example, reads from the corresponding asset path. Putting `image.png` at `app/src/main/assets` will make it loadable from `/image.png`.\n\nWriting files (`tigrSaveImage`) will write to the given path. TIMOGR will not redirect writes to the app internal storage.\n\n### C/C++\n\nYou can of course replace main.c with main.cpp if you want. Just update `CMakeLists.txt` and declare `tigrMain` as `extern \"C\"`:\n\n```C++\nextern \"C\" void tigrMain() {\n    // ...\n}\n```\n\n### Building a \"real\" app\n\nYou can make a distributable app based on TIMOGR. There is plenty of information of the steps involved on the [Android developer site](https://developer.android.com/studio/publish). Start by changing the application ID in `app/build.gradle`.\n\nThe Android developer site also describes how to [sign your app from the command line](https://developer.android.com/studio/build/building-cmdline#sign_cmdline) or by using Gradle.\n\n### Adding more activities\n\nThere can be only one instance of the TIMOGR native activity. If you need another instance, you could theoretically add another native library target in `CMakeLists.txt` and refer to that in the second activity declaration in `AndroidManifest.xml`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferkkah%2Ftimogr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferkkah%2Ftimogr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferkkah%2Ftimogr/lists"}