Skip to content

Instantly share code, notes, and snippets.

View namandixit's full-sized avatar
➡️
Guided by PointeSEGMENTATION FAULT

Naman Dixit namandixit

➡️
Guided by PointeSEGMENTATION FAULT
View GitHub Profile
@namandixit
namandixit / koshroop.h
Last active January 8, 2026 07:12
Data Serialization and Archive Library for C23 (note: requires a separate code generator)
/*
* Creator: Naman Dixit
* Notice: © Copyright 2025 Naman Dixit
*/
#pragma once
#include "std.h"
#define M3D_USE_MATH_H
@namandixit
namandixit / math3d.h
Created January 8, 2026 07:08
Math library for 3D Graphics (tested with Vulkan)
/*
* Creator: Naman Dixit
* Notice: © Copyright 2025 Naman Dixit
*/
#pragma once
#include "std.h"
pragma_clang("clang diagnostic push");
@namandixit
namandixit / Embedding C in ECL.md
Last active January 8, 2026 07:13
Embeddable Common Lisp

Instructions for using Embeddable Comon Lisp

This sets up ECL to be used for compile time C code spilicing.

Windows

To compile:

  1. Download tarball from from https://ecl.common-lisp.dev/
  2. Extract
@namandixit
namandixit / objc.h
Last active October 4, 2025 12:36
Objective-C & Blocks Runtime
/*
* Creator: Naman Dixit
* Notice: © Copyright 2024 Naman Dixit
* License: BSD Zero Clause License
* SPDX: 0BSD (https://spdx.org/licenses/0BSD.html)
* Language: -*- objective-c -*-
*/
/*
* This is a minimal Objective-C runtime designed for easy embeddability and DLL-based hot-reloading.
@namandixit
namandixit / hyperc.h
Last active January 8, 2026 07:03
C23 parser
/*
* Creator: Naman Dixit
* Notice: © Copyright 2024 Naman Dixit
* License: BSD Zero Clause License
* SPDX: 0BSD (https://spdx.org/licenses/0BSD.html)
*/
/*
* This is an single-header zero-dependency easily-embeddable C23 parser and associated pretty-printer.
*
@namandixit
namandixit / build.h
Last active January 8, 2026 07:04
Build System Facilitator
/*
* Creator: Naman Dixit
* Notice: © Copyright 2024 Naman Dixit
* License: BSD Zero Clause License
* SPDX: 0BSD (https://spdx.org/licenses/0BSD.html)
*/
/* Example Commands to compile a build.c that includes this file:
* * clang --std=c23 -Iassets\code\ -Iprovisions\sources -ferror-limit=500 build.c -o build.exe -Lprovisions\binaries\win64 -lSDL3
* * cl /TC /std:clatest /Iassets\code\ /Iprovisions\sources build.c /Febuild.exe /LIBPATH:provisions\binaries\win64 SDL3.lib
@namandixit
namandixit / cmd.md
Last active December 16, 2024 05:00
Commands for getting the absolute paths from relative paths

Since SDL is not going to add the feature of converting relative paths to absolute paths, here I will document the commands for each platform to do so manually using the SDL_Process API.

If the relative path is stored in variable called relative_path, the run:

  1. Windows:
    txtfmtAppendF(&tf, "cmd /C for %%i in (\"%s\") do @echo %%~fi", relative_path)
@namandixit
namandixit / std.h
Last active January 15, 2026 21:27
Personal C Standard Library
/*
* Creator: Naman Dixit
* Notice: © Copyright 2024 Naman Dixit
* License: BSD Zero Clause License
* SPDX: 0BSD (https://spdx.org/licenses/0BSD.html)
*/
#if !defined(STD_H_INCLUDE_GUARD)
/* Compiler **************************************************************************/
@namandixit
namandixit / maths.cpp
Created October 30, 2024 04:40 — forked from nakst/maths.cpp
// NOTE Compile without fast math flags.
/*
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
@namandixit
namandixit / d3d12.cpp
Created October 8, 2024 04:01
Nimajjana's old partially-written D3D12 renderer, for future reference (programmed by following this tutorial: https://www.3dgep.com/learning-directx-12-1/
/*
* Creator: Naman Dixit
* Notice: © Copyright 2023 Naman Dixit
*/
pragma_clang("clang diagnostic push")
pragma_clang("clang diagnostic ignored \"-Wnonportable-system-include-path\"")
pragma_clang("clang diagnostic ignored \"-Wmicrosoft-enum-value\"")
pragma_clang("clang diagnostic ignored \"-Wreserved-identifier\"")
pragma_clang("clang diagnostic ignored \"-Wnon-virtual-dtor\"")