internal/graphicsdriver/playstation5: change the name convention

This commit is contained in:
Hajime Hoshi 2024-09-23 23:22:22 +09:00
parent 508922250a
commit a499a976f7
3 changed files with 39 additions and 39 deletions

View File

@ -36,16 +36,16 @@ extern "C" void ebitengine_Begin() {}
extern "C" void ebitengine_End(int present) {} extern "C" void ebitengine_End(int present) {}
extern "C" void ebitengine_SetVertices(const float *vertices, int vertexCount, extern "C" void ebitengine_SetVertices(const float *vertices, int vertex_count,
const uint32_t *indices, const uint32_t *indices,
int indexCount) {} int index_count) {}
extern "C" ebitengine_Error extern "C" ebitengine_Error
ebitengine_DrawTriangles(int dst, const int *srcs, int srcCount, int shader, ebitengine_DrawTriangles(int dst, const int *srcs, int src_count, int shader,
const ebitengine_DstRegion *dstRegions, const ebitengine_DstRegion *dst_regions,
int dstRegionCount, int indexOffset, int dst_region_count, int index_offset,
ebitengine_Blend blend, const uint32_t *uniforms, ebitengine_Blend blend, const uint32_t *uniforms,
int uniformCount, int fillRule) { int uniform_count, int fill_rule) {
return {}; return {};
} }

View File

@ -37,8 +37,8 @@ type playstation5Error struct {
func newPlaystation5Error(name string, err C.ebitengine_Error) *playstation5Error { func newPlaystation5Error(name string, err C.ebitengine_Error) *playstation5Error {
return &playstation5Error{ return &playstation5Error{
name: name, name: name,
code: int(err.Code), code: int(err.code),
message: C.GoString(err.Message), message: C.GoString(err.message),
} }
} }
@ -137,21 +137,21 @@ func (g *Graphics) DrawTriangles(dst graphicsdriver.ImageID, srcs [graphics.Shad
defer runtime.KeepAlive(cDstRegions) defer runtime.KeepAlive(cDstRegions)
for i, r := range dstRegions { for i, r := range dstRegions {
cDstRegions[i] = C.ebitengine_DstRegion{ cDstRegions[i] = C.ebitengine_DstRegion{
MinX: C.int(r.Region.Min.X), min_x: C.int(r.Region.Min.X),
MinY: C.int(r.Region.Min.Y), min_y: C.int(r.Region.Min.Y),
MaxX: C.int(r.Region.Max.X), max_x: C.int(r.Region.Max.X),
MaxY: C.int(r.Region.Max.Y), max_y: C.int(r.Region.Max.Y),
IndexCount: C.int(r.IndexCount), index_count: C.int(r.IndexCount),
} }
} }
cBlend := C.ebitengine_Blend{ cBlend := C.ebitengine_Blend{
BlendFactorSourceRGB: C.uint8_t(blend.BlendFactorSourceRGB), factor_src_rgb: C.uint8_t(blend.BlendFactorSourceRGB),
BlendFactorSourceAlpha: C.uint8_t(blend.BlendFactorSourceAlpha), factor_src_alpha: C.uint8_t(blend.BlendFactorSourceAlpha),
BlendFactorDestinationRGB: C.uint8_t(blend.BlendFactorDestinationRGB), factor_dst_rgb: C.uint8_t(blend.BlendFactorDestinationRGB),
BlendFactorDestinationAlpha: C.uint8_t(blend.BlendFactorDestinationAlpha), factor_dst_alpha: C.uint8_t(blend.BlendFactorDestinationAlpha),
BlendOperationRGB: C.uint8_t(blend.BlendOperationRGB), operation_rgb: C.uint8_t(blend.BlendOperationRGB),
BlendOperationAlpha: C.uint8_t(blend.BlendOperationAlpha), operation_alpha: C.uint8_t(blend.BlendOperationAlpha),
} }
cUniforms := make([]C.uint32_t, len(uniforms)) cUniforms := make([]C.uint32_t, len(uniforms))

View File

@ -26,29 +26,29 @@ extern "C" {
#endif #endif
typedef struct ebitengine_Error { typedef struct ebitengine_Error {
const char *Message; const char *message;
int Code; int code;
} ebitengine_Error; } ebitengine_Error;
static bool ebitengine_IsErrorNil(ebitengine_Error *err) { static bool ebitengine_IsErrorNil(ebitengine_Error *err) {
return err->Message == NULL && err->Code == 0; return err->message == NULL && err->code == 0;
} }
typedef struct ebitengine_DstRegion { typedef struct ebitengine_DstRegion {
int MinX; int min_x;
int MinY; int min_y;
int MaxX; int max_x;
int MaxY; int max_y;
int IndexCount; int index_count;
} ebitengine_DstRegion; } ebitengine_DstRegion;
typedef struct ebitengine_Blend { typedef struct ebitengine_Blend {
uint8_t BlendFactorSourceRGB; uint8_t factor_src_rgb;
uint8_t BlendFactorSourceAlpha; uint8_t factor_src_alpha;
uint8_t BlendFactorDestinationRGB; uint8_t factor_dst_rgb;
uint8_t BlendFactorDestinationAlpha; uint8_t factor_dst_alpha;
uint8_t BlendOperationRGB; uint8_t operation_rgb;
uint8_t BlendOperationAlpha; uint8_t operation_alpha;
} ebitengine_Blend; } ebitengine_Blend;
ebitengine_Error ebitengine_InitializeGraphics(void); ebitengine_Error ebitengine_InitializeGraphics(void);
@ -59,15 +59,15 @@ void ebitengine_DisposeImage(int id);
void ebitengine_Begin(); void ebitengine_Begin();
void ebitengine_End(int present); void ebitengine_End(int present);
void ebitengine_SetVertices(const float *vertices, int vertexCount, void ebitengine_SetVertices(const float *vertices, int vertex_count,
const uint32_t *indices, int indexCount); const uint32_t *indices, int index_count);
ebitengine_Error ebitengine_Error
ebitengine_DrawTriangles(int dst, const int *srcs, int srcCount, int shader, ebitengine_DrawTriangles(int dst, const int *srcs, int src_count, int shader,
const ebitengine_DstRegion *dstRegions, const ebitengine_DstRegion *dst_regions,
int dstRegionCount, int indexOffset, int dst_region_count, int indexOffset,
ebitengine_Blend blend, const uint32_t *uniforms, ebitengine_Blend blend, const uint32_t *uniforms,
int uniformCount, int fillRule); int uniform_count, int fill_rule);
ebitengine_Error ebitengine_NewShader(int *shader, const char *source); ebitengine_Error ebitengine_NewShader(int *shader, const char *source);
void ebitengine_DisposeShader(int id); void ebitengine_DisposeShader(int id);