Skip to content

Commit

Permalink
Fix 00 to 05
Browse files Browse the repository at this point in the history
  • Loading branch information
RobDangerous committed Sep 27, 2024
1 parent 85c8047 commit cba81c8
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 12 deletions.
5 changes: 4 additions & 1 deletion 00_empty/Sources/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
static kope_g5_device device;
static kope_g5_command_list list;

static const int width = 800;
static const int height = 600;

static void update(void *data) {
kope_g5_texture *framebuffer = kope_g5_device_get_framebuffer(&device);

Expand Down Expand Up @@ -41,7 +44,7 @@ static void update(void *data) {
}

int kickstart(int argc, char **argv) {
kinc_init("Example", 1024, 768, NULL, NULL);
kinc_init("Example", width, height, NULL, NULL);
kinc_set_update_callback(update, NULL);

kope_g5_device_wishlist wishlist = {0};
Expand Down
Binary file added 00_empty/reference.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion 01_triangle/Sources/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ static kope_g5_command_list list;
static vertex_in_buffer vertices;
static kope_g5_buffer indices;

static const int width = 800;
static const int height = 600;

static void update(void *data) {
kope_g5_texture *framebuffer = kope_g5_device_get_framebuffer(&device);

Expand Down Expand Up @@ -51,7 +54,7 @@ static void update(void *data) {
}

int kickstart(int argc, char **argv) {
kinc_init("Example", 1024, 768, NULL, NULL);
kinc_init("Example", width, height, NULL, NULL);
kinc_set_update_callback(update, NULL);

kope_g5_device_wishlist wishlist = {0};
Expand Down
Binary file added 01_triangle/reference.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion 02_matrix/Sources/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ static kope_g5_buffer indices;
static kope_g5_buffer constants;
static everything_set everything;

static const int width = 800;
static const int height = 600;

float vec4_length(kinc_vector3_t a) {
return sqrtf(a.x * a.x + a.y * a.y + a.z * a.z);
}
Expand Down Expand Up @@ -146,7 +149,7 @@ static void update(void *data) {
}

int kickstart(int argc, char **argv) {
kinc_init("Example", 1024, 768, NULL, NULL);
kinc_init("Example", width, height, NULL, NULL);
kinc_set_update_callback(update, NULL);

kope_g5_device_wishlist wishlist = {0};
Expand Down
Binary file added 02_matrix/reference.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion 03_colored_cube/Sources/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ static everything_set everything;

static uint32_t vertex_count;

static const int width = 800;
static const int height = 600;

/* clang-format off */
static float vertices_data[] = {
-1.0,-1.0,-1.0,
Expand Down Expand Up @@ -229,7 +232,7 @@ static void update(void *data) {
}

int kickstart(int argc, char **argv) {
kinc_init("Example", 1024, 768, NULL, NULL);
kinc_init("Example", width, height, NULL, NULL);
kinc_set_update_callback(update, NULL);

kope_g5_device_wishlist wishlist = {0};
Expand Down
Binary file added 03_colored_cube/reference.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 9 additions & 4 deletions 04_textured_cube/Sources/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ static kope_g5_buffer image_buffer;

static uint32_t vertex_count;

static const int width = 800;
static const int height = 600;

/* clang-format off */
static float vertices_data[] = {
-1.0,-1.0,-1.0,
Expand Down Expand Up @@ -248,7 +251,7 @@ static void update(void *data) {
}

int kickstart(int argc, char **argv) {
kinc_init("Example", 1024, 768, NULL, NULL);
kinc_init("Example", width, height, NULL, NULL);
kinc_set_update_callback(update, NULL);

kope_g5_device_wishlist wishlist = {0};
Expand Down Expand Up @@ -323,9 +326,11 @@ int kickstart(int argc, char **argv) {
{
everything_parameters parameters;
parameters.constants = &constants;
parameters.pix_texture = &texture;
parameters.pix_texture_highest_mip_level = 0;
parameters.pix_texture_mip_count = 1;
parameters.pix_texture.texture = &texture;
parameters.pix_texture.base_mip_level = 0;
parameters.pix_texture.mip_level_count = 1;
parameters.pix_texture.base_array_layer = 0;
parameters.pix_texture.array_layer_count = 1;
parameters.pix_sampler = &sampler;
kong_create_everything_set(&device, &parameters, &everything);
}
Expand Down
Binary file added 04_textured_cube/reference.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 9 additions & 4 deletions 05_camera_controls/Sources/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ float mouse_y = 0.0;
float mouse_delta_x = 0.0;
float mouse_delta_y = 0.0;

static const int width = 800;
static const int height = 600;

/* clang-format off */
static float vertices_data[] = {
-1.0,-1.0,-1.0,
Expand Down Expand Up @@ -339,7 +342,7 @@ static void update(void *data) {
}

int kickstart(int argc, char **argv) {
kinc_init("Example", 1024, 768, NULL, NULL);
kinc_init("Example", width, height, NULL, NULL);
kinc_set_update_callback(update, NULL);
kinc_keyboard_set_key_down_callback(key_down, NULL);
kinc_keyboard_set_key_up_callback(key_up, NULL);
Expand Down Expand Up @@ -419,9 +422,11 @@ int kickstart(int argc, char **argv) {
{
everything_parameters parameters;
parameters.constants = &constants;
parameters.pix_texture = &texture;
parameters.pix_texture_highest_mip_level = 0;
parameters.pix_texture_mip_count = 1;
parameters.pix_texture.texture = &texture;
parameters.pix_texture.base_mip_level = 0;
parameters.pix_texture.mip_level_count = 1;
parameters.pix_texture.base_array_layer = 0;
parameters.pix_texture.array_layer_count = 1;
parameters.pix_sampler = &sampler;
kong_create_everything_set(&device, &parameters, &everything);
}
Expand Down
Binary file added 05_camera_controls/reference.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit cba81c8

Please sign in to comment.