Skip to content

Commit

Permalink
Make a Metal Kope sample compile
Browse files Browse the repository at this point in the history
  • Loading branch information
RobDangerous committed Feb 2, 2025
1 parent aef4037 commit 2777b8c
Show file tree
Hide file tree
Showing 13 changed files with 37 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ typedef struct kope_metal_vertex_buffer_layout {
} kope_metal_vertex_buffer_layout;

typedef struct kope_metal_shader {
int nothing;
uint8_t *data;
size_t size;
} kope_metal_shader;

#define KOPE_METAL_MAX_VERTEX_BUFFERS 16
Expand Down
3 changes: 3 additions & 0 deletions Backends/Graphics5/Metal/Sources/kope/metal/sampler.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@

#include <kope/graphics5/sampler.h>

void kope_metal_sampler_set_name(kope_g5_sampler *sampler, const char *name) {

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
extern "C" {
#endif


void kope_metal_sampler_set_name(kope_g5_sampler *sampler, const char *name);

#ifdef __cplusplus
}
Expand Down
4 changes: 4 additions & 0 deletions Backends/Graphics5/Metal/Sources/kope/metal/texture.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@
#include "metalunit.h"

#include <kope/graphics5/texture.h>

void kope_metal_texture_set_name(kope_g5_texture *texture, const char *name) {

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
extern "C" {
#endif


void kope_metal_texture_set_name(kope_g5_texture *texture, const char *name);

#ifdef __cplusplus
}
Expand Down
3 changes: 1 addition & 2 deletions Sources/kinc/audio1/sound.c.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ kinc_a1_sound_t *kinc_a1_sound_create_from_buffer(uint8_t* audio_data, const uin

kinc_a1_sound_t *kinc_a1_sound_create(const char *filename) {
size_t filenameLength = strlen(filename);
uint8_t *data = NULL;

kinc_a1_audioformat_t fileformat;
if (strncmp(&filename[filenameLength - 4], ".ogg", 4) == 0) {
Expand All @@ -213,7 +212,7 @@ kinc_a1_sound_t *kinc_a1_sound_create(const char *filename) {
kinc_file_reader_close(&file);
size_t filesize = kinc_file_reader_size(&file);

kinc_a1_sound_t* sound = kinc_a1_sound_create_from_buffer(filedata,filesize,fileformat);
kinc_a1_sound_t* sound = kinc_a1_sound_create_from_buffer(filedata, (uint32_t)filesize, fileformat);

free(filedata);

Expand Down
6 changes: 3 additions & 3 deletions Sources/kinc/graphics2/graphics.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void kinc_g2_end(void);
kinc_matrix3x3_t kinc_g2_get_transformation(void);
void kinc_g2_set_transformation(kinc_matrix3x3_t transformation);
void kinc_g2_push_transformation(kinc_matrix3x3_t trans);
kinc_matrix3x3_t kinc_g2_pop_transformation();
kinc_matrix3x3_t kinc_g2_pop_transformation(void);
void kinc_g2_scale(float x, float y);
void kinc_g2_push_scale(float x, float y);
kinc_matrix3x3_t kinc_g2_translation(float tx, float ty);
Expand All @@ -57,8 +57,8 @@ kinc_matrix3x3_t kinc_g2_rotation(float angle, float centerx, float centery);
void kinc_g2_rotate(float angle, float centerx, float centery);
void kinc_g2_push_rotation(float angle, float centerx, float centery);
void kinc_g2_push_opacity(float opacity);
float kinc_g2_pop_opacity();
float kinc_g2_get_opacity();
float kinc_g2_pop_opacity(void);
float kinc_g2_get_opacity(void);
void kinc_g2_set_opacity(float opacity);

#else
Expand Down
4 changes: 4 additions & 0 deletions Sources/kope/graphics5/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
#include <kope/direct3d12/buffer_functions.h>
#endif

#ifdef KOPE_METAL
#include <kope/metal/buffer_functions.h>
#endif

#ifdef KOPE_VULKAN
#include <kope/vulkan/buffer_functions.h>
#endif
Expand Down
4 changes: 4 additions & 0 deletions Sources/kope/graphics5/commandlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
#include <kope/direct3d12/commandlist_functions.h>
#endif

#ifdef KOPE_METAL
#include <kope/metal/commandlist_functions.h>
#endif

#ifdef KOPE_VULKAN
#include <kope/vulkan/commandlist_functions.h>
#endif
Expand Down
4 changes: 4 additions & 0 deletions Sources/kope/graphics5/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
#include <kope/direct3d12/device_functions.h>
#endif

#ifdef KOPE_METAL
#include <kope/metal/device_functions.h>
#endif

#ifdef KOPE_VULKAN
#include <kope/vulkan/device_functions.h>
#endif
Expand Down
4 changes: 4 additions & 0 deletions Sources/kope/graphics5/sampler.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
#include <kope/direct3d12/sampler_functions.h>
#endif

#ifdef KOPE_METAL
#include <kope/metal/sampler_functions.h>
#endif

#ifdef KOPE_VULKAN
#include <kope/vulkan/sampler_functions.h>
#endif
Expand Down
4 changes: 4 additions & 0 deletions Sources/kope/graphics5/texture.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
#include <kope/direct3d12/texture_functions.h>
#endif

#ifdef KOPE_METAL
#include <kope/metal/texture_functions.h>
#endif

#ifdef KOPE_VULKAN
#include <kope/vulkan/texture_functions.h>
#endif
Expand Down
2 changes: 2 additions & 0 deletions Sources/kope/graphics5/textureformat.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ bool kope_g5_texture_format_is_depth(kope_g5_texture_format format) {
case KOPE_G5_TEXTURE_FORMAT_DEPTH32FLOAT:
case KOPE_G5_TEXTURE_FORMAT_DEPTH32FLOAT_STENCIL8_NOTHING24:
return true;
default:
return false;
}
return false;
}

0 comments on commit 2777b8c

Please sign in to comment.