mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
Compare commits
9 Commits
50ff8dc1d1
...
002bdd3069
Author | SHA1 | Date | |
---|---|---|---|
|
002bdd3069 | ||
|
3eda0dd387 | ||
|
ca54ce69c4 | ||
|
7f1e6cb538 | ||
|
2bbceec451 | ||
|
99b9cff0d0 | ||
|
71370a01bd | ||
|
67441c4823 | ||
|
faeb03373d |
5
.github/workflows/test.yml
vendored
5
.github/workflows/test.yml
vendored
@ -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: |
|
||||
|
@ -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.
|
@ -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 {
|
||||
|
@ -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,
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user