Compare commits

..

9 Commits

Author SHA1 Message Date
Bertrand Jung
002bdd3069
Merge 1dd96726c4 into 3eda0dd387 2024-09-01 12:22:44 -04:00
Hajime Hoshi
3eda0dd387 internal/graphicsdriver/playstation5: add extern C 2024-09-01 20:08:52 +09:00
Hajime Hoshi
ca54ce69c4 internal/graphicsdriver/playstation5: bug fix: compile error 2024-09-01 20:00:41 +09:00
Hajime Hoshi
7f1e6cb538 internal/graphicsdriver/playstation5: add ebitengine_SetVertices 2024-09-01 19:47:21 +09:00
Hajime Hoshi
2bbceec451 .github/workflows: skip wasm tests for Windows
Updates #3076
2024-09-01 16:20:35 +09:00
Hajime Hoshi
99b9cff0d0 .github/workflows: specify -test.paniconexit0=false for browsers
Closes #3075
2024-09-01 15:45:15 +09:00
Hajime Hoshi
71370a01bd internal/beforemaintest: avoid os.Exit(0) 2024-09-01 13:58:39 +09:00
Hajime Hoshi
67441c4823 internal/testing: avoid os.Exit(0)
os.Exit(0) might cause test flakiness.

https://github.com/hajimehoshi/ebiten/actions/runs/10650734256/job/29522689113

```
panic: unexpected call to os.Exit(0) during test

goroutine 1 [running]:
os.Exit(0x0)
	/opt/hostedtoolcache/go/1.23.0/x64/src/os/proc.go:67 +0x8
github.com/hajimehoshi/ebiten/v2/internal/testing.MainWithRunLoop(0x19b28c0)
	/home/runner/work/ebiten/ebiten/internal/testing/testing.go:50 +0xa
github.com/hajimehoshi/ebiten/v2/internal/graphicscommand_test.TestMain(...)
	/home/runner/work/ebiten/ebiten/internal/graphicscommand/image_test.go:42
main.main()
	_testmain.go:55 +0x5
```
2024-09-01 13:31:40 +09:00
Hajime Hoshi
faeb03373d examples: remove README 2024-09-01 12:40:34 +09:00
7 changed files with 19 additions and 28 deletions

View File

@ -168,10 +168,11 @@ jobs:
env GOARCH=386 EBITENGINE_DIRECTX=version=12 go test -shuffle=on -v ./...
- name: go test (Wasm)
if: runner.os != 'macOS'
if: runner.os == 'Linux'
run: |
# Wasm tests don't work on macOS with the headless mode enabled, but the headless mode cannot be disabled in GitHub Actions (#2972).
env GOOS=js GOARCH=wasm cleanenv -remove-prefix GITHUB_ -remove-prefix JAVA_ -remove-prefix PSModulePath -remove-prefix STATS_ -remove-prefix RUNNER_ -- go test -shuffle=on -v ./...
# Wasm tests time out on Windows (#3076).
env GOOS=js GOARCH=wasm cleanenv -remove-prefix GITHUB_ -remove-prefix JAVA_ -remove-prefix PSModulePath -remove-prefix STATS_ -remove-prefix RUNNER_ -- go test -shuffle=on -v ./... -test.paniconexit0=false
- name: Install ebitenmobile
run: |

View File

@ -1,23 +0,0 @@
# How to execute the examples
## Desktops
```sh
go run github.com/hajimehoshi/ebiten/v2/examples/rotate@latest
```
## Android
Install [gomobile](https://pkg.go.dev/golang.org/x/mobile/cmd/gomobile) first.
```sh
gomobile install github.com/hajimehoshi/ebiten/v2/examples/rotate@latest
```
## iOS
```sh
gomobile build -target=ios -work github.com/hajimehoshi/ebiten/v2/examples/rotate@latest
```
Then, open the `WORK` directory, open `main.xcodeproj`, add signing, and run the project.

View File

@ -78,7 +78,9 @@ func TestMain(m *testing.M) {
panic(err)
}
os.Exit(<-codeCh)
if code := <-codeCh; code != 0 {
os.Exit(code)
}
}
type testResult struct {

View File

@ -32,7 +32,10 @@ ebitengine_NewScreenFramebufferImage(int *image, int width, int height) {
extern "C" void ebitengine_DisposeImage(int id) {}
ebitengine_Error
extern "C" void ebitengine_SetVertices(float *vertices, int vertexCount,
uint32_t *indices, int indexCount) {}
extern "C" ebitengine_Error
ebitengine_DrawTriangles(int dst, int *srcs, int srcCount, int shader,
ebitengine_DstRegion *dstRegions, int dstRegionCount,
int indexOffset, ebitengine_Blend blend,

View File

@ -72,6 +72,9 @@ func (g *Graphics) SetTransparent(transparent bool) {
}
func (g *Graphics) SetVertices(vertices []float32, indices []uint32) error {
defer runtime.KeepAlive(vertices)
defer runtime.KeepAlive(indices)
C.ebitengine_SetVertices((*C.float)(&vertices[0]), C.int(len(vertices)), (*C.uint32_t)(&indices[0]), C.int(len(indices)))
return nil
}

View File

@ -57,6 +57,9 @@ ebitengine_Error ebitengine_NewScreenFramebufferImage(int *image, int width,
int height);
void ebitengine_DisposeImage(int id);
void ebitengine_SetVertices(float *vertices, int vertexCount, uint32_t *indices,
int indexCount);
ebitengine_Error
ebitengine_DrawTriangles(int dst, int *srcs, int srcCount, int shader,
ebitengine_DstRegion *dstRegions, int dstRegionCount,

View File

@ -47,5 +47,7 @@ func MainWithRunLoop(m *testing.M) {
if err := ebiten.RunGame(g); err != nil {
panic(err)
}
os.Exit(g.code)
if g.code != 0 {
os.Exit(g.code)
}
}