Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@
"configurations": [
{
"type": "lldb",
"request": "custom",
"request": "launch",
"name": "Debug",
"initCommands": [
"platform select remote-android",
],
"targetCreateCommands": [
"target create ${workspaceFolder}/.debug/exe",
],
"processCreateCommands": [
"gdb-remote 6666",
"process handle SIGSEGV -s false -n false",
"continue"
],
"preLaunchTask": "timogr: debug",
"postDebugTask": "timogr: stop",
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ TIMOGR takes care of the Android life-cycle stuff and lets you write the fun par
Oh, and you don't need Android Studio - it works just fine with the plain Android SDK + NDK,
and you can build, run and debug from [within VS Code](#debugging-in-vs-code).

## Demo app

The template app in this repo is available on [Google Play :arrow_forward:](https://play.google.com/store/apps/details?id=timogr.app).

## Getting started

* [Generate](https://github.com/erkkah/timogr/generate) your own repo based on this template
Expand All @@ -19,7 +23,7 @@ and you can build, run and debug from [within VS Code](#debugging-in-vs-code).
* If not already in place, install the Android NDK (Use sdkmanager or Android Studio)
* Make sure `ANDROID_SDK_ROOT` is set, and `JAVA_HOME` if gradle cannot find the correct version below.
* Copy keystore.properties.example to keystore.properties (and modify it if you want to sign your app)
* Run a test build: `./gradlew buildCMakeDebug` (that's `gradlew.bat build` on Windows)
* Run a test build: `./gradlew build` (that's `gradlew.bat build` on Windows)
* Tweak `app/build/build.gradle` if the test build complains about `compileSdkVersion` or `ndkVersion`
* Plug in your device (or run an emulator), and run `./gradlew installDebug` to install the template TIMOGR app
* Run the app (and report back if there are problems)
Expand Down
11 changes: 5 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@ keystoreProperties.load(new FileInputStream(keystorePropertiesFile))

android {
namespace 'timogr.app'
compileSdk 34
compileSdk 35
ndkVersion '27.0.11902837'

defaultConfig {
applicationId 'timogr.app'
minSdk 26
targetSdk 33
targetSdk 35
externalNativeBuild {
cmake {
arguments '-DANDROID_STL=c++_shared'
arguments "-DANDROID_STL=c++_shared", "-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON"
}
}
versionCode 2
versionName '1.0.1'
versionCode 7
versionName '1.0.3'
}
signingConfigs {
release {
Expand Down Expand Up @@ -69,7 +69,6 @@ android {
}
externalNativeBuild {
cmake {
// version '3.10.2'
path 'src/main/cpp/CMakeLists.txt'
}
}
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:8.5.0"
classpath 'com.android.tools.build:gradle:8.10.1'
}
}

Expand Down
4 changes: 2 additions & 2 deletions dbgtool/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/xml"
"fmt"
"io/fs"
"io/ioutil"
"os"
"path"
"path/filepath"
"strings"
Expand Down Expand Up @@ -84,7 +84,7 @@ func (m *AndroidManifest) mainActivityIntent() string {
}

func parseManifest(manifest string) (*AndroidManifest, error) {
bytes, err := ioutil.ReadFile(manifest)
bytes, err := os.ReadFile(manifest)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
3 changes: 1 addition & 2 deletions tigr/.github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ jobs:
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [macos-11, ubuntu-latest, windows-latest]
#os: [ubuntu-latest]
os: [macos-latest, ubuntu-latest, windows-latest]
steps:
- name: Check out code
uses: actions/checkout@v1
Expand Down
2 changes: 1 addition & 1 deletion tigr/ci/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ else
endif

ci : ci.c ../tigr.c
gcc $^ -o $@$(EXT) $(CFLAGS) $(LDFLAGS)
gcc -Wall -pedantic $^ -o $@$(EXT) $(CFLAGS) $(LDFLAGS)
38 changes: 19 additions & 19 deletions tigr/src/tigr_amalgamated.c
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
#include "tigr.h"
#include "tigr_internal.h"
#include "tigr_upscale_gl_vs.h"
#include "tigr_upscale_gl_fs.h"
#include "tigr_bitmaps.c"
#include "tigr_loadpng.c"
#include "tigr_savepng.c"
#include "tigr_inflate.c"
#include "tigr_print.c"
#include "tigr_win.c"
#include "tigr_osx.c"
#include "tigr_ios.c"
#include "tigr_android.h"
#include "tigr_linux.c"
#include "tigr_android.c"
#include "tigr_gl.c"

#include "tigr.h"

#include "tigr_internal.h"
#include "tigr_upscale_gl_vs.h"
#include "tigr_upscale_gl_fs.h"

#include "tigr_bitmaps.c"
#include "tigr_loadpng.c"
#include "tigr_savepng.c"
#include "tigr_inflate.c"
#include "tigr_print.c"
#include "tigr_win.c"
#include "tigr_osx.c"
#include "tigr_ios.c"
#include "tigr_android.h"
#include "tigr_linux.c"
#include "tigr_android.c"
#include "tigr_gl.c"
#include "tigr_utils.c"
34 changes: 17 additions & 17 deletions tigr/src/tigr_amalgamated_one_header.h
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/*
Like most of stb libraries, this include needs to be included in one
compilation unit with TIGR_IMPLEMENTATION defined.
*/
#include "../tigr.h"
#ifdef TIGR_IMPLEMENTATION
#ifdef __cplusplus
extern "C" {
#endif
#include "tigr_amalgamated.c"
#ifdef __cplusplus
}
#endif
/*
Like most of stb libraries, this include needs to be included in one
compilation unit with TIGR_IMPLEMENTATION defined.
*/

#include "../tigr.h"

#ifdef TIGR_IMPLEMENTATION
#ifdef __cplusplus
extern "C" {
#endif

#include "tigr_amalgamated.c"

#ifdef __cplusplus
}
#endif
#endif
9 changes: 9 additions & 0 deletions tigr/src/tigr_android.c
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,15 @@ int tigrTouch(Tigr* bmp, TigrTouchPoint* points, int maxPoints) {
return maxPoints < win->numTouchPoints ? maxPoints : win->numTouchPoints;
}

void tigrMouseWheel(Tigr* bmp, float* x, float* y) {
if (x) {
*x = 0;
}
if (y) {
*y = 0;
}
}

void* tigrReadFile(const char* fileName, int* length) {
if (length != 0) {
*length = 0;
Expand Down
Loading