Compare commits

..

3 Commits

Author SHA1 Message Date
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
3 changed files with 10 additions and 1 deletions

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,