From 8d3d531eaf87a20e730d1e9a4797f63f040d0f51 Mon Sep 17 00:00:00 2001 From: pryazha Date: Sun, 19 Jan 2025 21:55:36 +0500 Subject: remove binaries --- .gitignore | 10 ++ README | 7 ++ blending/blending | Bin 1287944 -> 0 bytes depth/depth | Bin 1282536 -> 0 bytes face_culling/face_culling | Bin 1283016 -> 0 bytes framebuffers/framebuffers | Bin 1288760 -> 0 bytes geometry_shader/geometry_shader | Bin 1282768 -> 0 bytes instancing/instancing | Bin 1284152 -> 0 bytes libs/pwyazh/build.sh | 8 -- libs/pwyazh/example | Bin 43488 -> 0 bytes libs/pwyazh/example.c | 187 ------------------------------------ libs/pwyazha | 0 mesh_loading_test/mesh_loading_test | Bin 1277312 -> 0 bytes skybox/skybox | Bin 1288152 -> 0 bytes stencil/stencil | Bin 1282928 -> 0 bytes uniform_buffer/uniform_buffer | Bin 1288448 -> 0 bytes 16 files changed, 17 insertions(+), 195 deletions(-) create mode 100644 .gitignore create mode 100644 README delete mode 100755 blending/blending delete mode 100755 depth/depth delete mode 100755 face_culling/face_culling delete mode 100755 framebuffers/framebuffers delete mode 100755 geometry_shader/geometry_shader delete mode 100755 instancing/instancing delete mode 100755 libs/pwyazh/build.sh delete mode 100755 libs/pwyazh/example delete mode 100644 libs/pwyazh/example.c delete mode 100644 libs/pwyazha delete mode 100755 mesh_loading_test/mesh_loading_test delete mode 100755 skybox/skybox delete mode 100755 stencil/stencil delete mode 100755 uniform_buffer/uniform_buffer diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..62d9579 --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +blending/blending +depth/depth +face_culling/face_culling +framebuffers/framebuffers +geometry_shader/geometry_shader +instancing/instancing +mesh_loading_test/mesh_loading_test +skybox/skybox +stencil/stencil +uniform_buffer/uniform_buffer diff --git a/README b/README new file mode 100644 index 0000000..3ac319d --- /dev/null +++ b/README @@ -0,0 +1,7 @@ +My implementation of chapters from https://learnopengl.com + +- Building +There is glfw, glew, stb_image and tinyobjloader-c in libs directory, +but better would be download them. + +You need to change to each directory and compile examples separetely. diff --git a/blending/blending b/blending/blending deleted file mode 100755 index 7fb3209..0000000 Binary files a/blending/blending and /dev/null differ diff --git a/depth/depth b/depth/depth deleted file mode 100755 index 957eade..0000000 Binary files a/depth/depth and /dev/null differ diff --git a/face_culling/face_culling b/face_culling/face_culling deleted file mode 100755 index 7a816d4..0000000 Binary files a/face_culling/face_culling and /dev/null differ diff --git a/framebuffers/framebuffers b/framebuffers/framebuffers deleted file mode 100755 index 80cba75..0000000 Binary files a/framebuffers/framebuffers and /dev/null differ diff --git a/geometry_shader/geometry_shader b/geometry_shader/geometry_shader deleted file mode 100755 index 53de7d2..0000000 Binary files a/geometry_shader/geometry_shader and /dev/null differ diff --git a/instancing/instancing b/instancing/instancing deleted file mode 100755 index fa01eed..0000000 Binary files a/instancing/instancing and /dev/null differ diff --git a/libs/pwyazh/build.sh b/libs/pwyazh/build.sh deleted file mode 100755 index b8ab961..0000000 --- a/libs/pwyazh/build.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -OPTS='-DENABLE_ASSERT=1' -CFLAGS='-g -Wall -Wextra' -LIBS='-lm' - -set -x - -clang -o example $CFLAGS $OPTS example.c $LIBS diff --git a/libs/pwyazh/example b/libs/pwyazh/example deleted file mode 100755 index f574d46..0000000 Binary files a/libs/pwyazh/example and /dev/null differ diff --git a/libs/pwyazh/example.c b/libs/pwyazh/example.c deleted file mode 100644 index c8939c3..0000000 --- a/libs/pwyazh/example.c +++ /dev/null @@ -1,187 +0,0 @@ -#include - -#include "pwyazh.h" - -typedef struct Node { - struct Node *next; - struct Node *prev; - F32 value; -} Node; - -void -print_dll(Node *f) -{ - for (Node *c = f; - c; - c = c->next) - { - printf("%f%c", c->value, (c->next) ? ' ' : '\n'); - } -} - -void -clear_dll(Node **f, Node **l) -{ - for (Node *c = (*f)->next; - c; - c = c->next) - { - MemoryZeroStruct(c->prev); - } - MemoryZeroStruct(*f); - MemoryZeroStruct(*l); - *f = *l = 0; -} - -int -main(void) -{ - V3F pos = v3f(1.0f, 2.0f, 1.0f); - pos = v3f_add(pos, v3f(-1.0f, 2.0f, 0.23f)); - pos = v3f_scalef(pos, 10.0f); - printf("scaled: %f %f %f\n", pos.x, pos.y, pos.z); - - F32 length = v3f_length(pos); - Assert(length > 0.0f); - printf("length: %f\n", length); - - V3F positions[] = { - { -1.0f, 0.0f, 0.0f }, - { 1.0f, 0.0f, 0.0f }, - { 0.0f, 1.0f, 0.0f }, - { 0.0f, 0.0f, -1.0f }, - }; - for (U32 pos_index = 0; - pos_index < ArrayCount(positions); - ++pos_index) - { - V3F *pos = positions+pos_index; - printf("%d: %f %f %f\n", pos_index, - pos->x, pos->y, pos->z); - U64 ptr_as_int = IntFromPtr(pos); - printf("ptr: %lx\n", ptr_as_int); - void *ptr = PtrFromInt(ptr_as_int); - V3F *as_pos = (V3F *)ptr; - printf("decode: %f %f %f\n", - as_pos->x, as_pos->y, as_pos->z); - } - - printf("Offset of y: %lld\n", OffsetOfMember(V3F, y)); - - S32 min = Min(10, 2); - S32 max = Max(10, 2); - printf("min: %d\n", min); - printf("max: %d\n", max); - - S32 source[100]; - for (S32 index = 0; - index < 100; - ++index) - { - source[index] = index; - printf("%d%c", source[index], (index < 99) ? ' ' : '\n'); - } - - S32 dest[100]; - MemoryCopyArray(dest, source); - printf("dest: "); - for (S32 index = 0; - index < 100; - ++index) - { - printf("%d%c", dest[index], (index < 99) ? ' ' : '\n'); - } - printf("compare: %d\n", MemoryMatch(source, dest, sizeof(source))); - - MemoryZeroArray(dest); - printf("dest: "); - for (S32 index = 0; - index < 100; - ++index) - { - printf("%d%c", dest[index], (index < 99) ? ' ' : '\n'); - } - printf("compare: %d\n", MemoryMatch(source, dest, sizeof(source))); - - V3F first = v3f_zero(); - V3F second; - printf("struct compare: %d\n", MemoryMatch(&first, &second, sizeof(V3F))); - MemoryCopyStruct(&second, &first); - printf("struct compare: %d\n", MemoryMatch(&first, &second, sizeof(V3F))); - - MAT4 mat = mat4_identity(); - printf("det: %f\n", mat4_det(mat)); - - { - U32 node_count = 10; - Arena *arena = arena_alloc(Megabytes(64)); - Node *nodes = arena_push_size(arena, node_count*sizeof(Node)); - MemoryZero(nodes, node_count*sizeof(Node)); - Node *f = 0; - Node *l = 0; - for (U32 node_index = 0; - node_index < node_count; - ++node_index) - { - nodes[node_index].value = node_index; - DLLPushBack(f, l, &nodes[node_index]); - } - print_dll(f); - - for (Node *c = f; - c; - c = c->next) - { - if (c->value == 5.0f) { - DLLRemove(f, l, c); - } - } - - DLLPushBack(f, l, &nodes[5]); - - for (U32 node_index = 0; - node_index < node_count; - ++node_index) - { - Node *node = nodes+node_index; - printf("%u: prev: %llx ptr: %llx next: %llx %f\n", - node_index, IntFromPtr(node->prev), - IntFromPtr(node), IntFromPtr(node->next), node->value); - } - - clear_dll(&f, &l); - for (U32 node_index = 0; - node_index < node_count; - ++node_index) - { - Node *node = nodes+node_index; - printf("%u: prev: %llx ptr: %llx next: %llx %f\n", - node_index, IntFromPtr(node->prev), - IntFromPtr(node), IntFromPtr(node->next), node->value); - } - print_dll(f); - arena_release(arena); - } - - U64 temp_size = Kilobytes(1); - Arena *temp = arena_alloc(temp_size); - S32 test_count = temp_size/sizeof(S32); - S32 *test = arena_push_size(temp, test_count*sizeof(S32)); - MemoryZero(test, test_count*sizeof(S32)); - S32 i; - for (i = 0; - i < test_count; - ++i) - { - S32 *item = test+i; - *item = i; - printf("%d%c", *item, (i == test_count-1) ? '\n' : ' '); - } - arena_release(temp); - - temp = arena_alloc(temp_size); - String8 str = str8_cstring((U8 *)"This is a c string"); - printf("%s", str.str); - arena_release(temp); - return(0); -} diff --git a/libs/pwyazha b/libs/pwyazha deleted file mode 100644 index e69de29..0000000 diff --git a/mesh_loading_test/mesh_loading_test b/mesh_loading_test/mesh_loading_test deleted file mode 100755 index ebb96a5..0000000 Binary files a/mesh_loading_test/mesh_loading_test and /dev/null differ diff --git a/skybox/skybox b/skybox/skybox deleted file mode 100755 index 966290c..0000000 Binary files a/skybox/skybox and /dev/null differ diff --git a/stencil/stencil b/stencil/stencil deleted file mode 100755 index 00f577f..0000000 Binary files a/stencil/stencil and /dev/null differ diff --git a/uniform_buffer/uniform_buffer b/uniform_buffer/uniform_buffer deleted file mode 100755 index 343f839..0000000 Binary files a/uniform_buffer/uniform_buffer and /dev/null differ -- cgit v1.2.3