Skip to content

Instantly share code, notes, and snippets.

@btipling
btipling / build.zig
Last active October 30, 2023 21:30
opengl triangle with zig-gamedev
const std = @import("std");
const zsdl = @import("libs/zig-gamedev/libs/zsdl/build.zig");
const zopengl = @import("libs/zig-gamedev/libs/zopengl/build.zig");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const exe = b.addExecutable(.{
.name = "hellotriangle",

During the past days, this great article by Sam Pruden has been making the rounds around the gamedev community. While the article provides an in-depth analysis, its a bit easy to miss the point and exert the wrong conclusions from it. As such, and in many cases, users unfamiliar with Godot internals have used it points such as following:

  • Godot C# support is inefficient
  • Godot API and binding system is designed around GDScript
  • Godot is not production ready

In this brief article, I will shed a bit more light about how the Godot binding system works and some detail on the Godot

Wonder Boy: The Dragon's Trap
-----------------------------
Quick Guide for programmers
Last updated October 2018
Contact: Omar Cornut <XXXXXX
===============================================
INDEX
===============================================
//! A zig builder step that runs "libtool" against a list of libraries
//! in order to create a single combined static library.
const LibtoolStep = @This();
const std = @import("std");
const Step = std.build.Step;
const RunStep = std.build.RunStep;
const FileSource = std.build.FileSource;
pub const Options = struct {
@seyhajin
seyhajin / msvc_version.md
Created March 17, 2023 15:52
List of _MSC_VER and _MSC_FULL_VER

Visual Studio version and discrimination macros

Abbreviation Product name [Visual Studio version] VC++ version _MSC_VER _MSC_FULL_VER
2022 Visual Studio 2022 version 17.3.4 14.30 1933 193331630
2022 Visual Studio 2022 version 17.2.2 14.30 1932 193231329
2022 Visual Studio 2022 version 17.0.2 14.30 1930 193030706
2022 Visual Studio 2022 version 17.0.1 14.30 1930 193030705
2019 Update 11 Visual Studio 2019 version 16.11.2 14.28 1929 192930133
2019 Update 9 Visual Studio 2019 version
@sammonius
sammonius / DEBUG.h
Last active January 23, 2023 18:15
#ifndef DEBUG_H
#define DEBUG_H
#define PROG_NAME "my_app"
/* USAGE: puts(ERROR "Could not find wallet"); */
/* No licence cuz i don't care */
#define IHATETHECPREPROCESSORSOMUCHRIGHTNOW(X) #X
import openai
openai.api_key = "YOUR API KEY HERE"
model_engine = "text-davinci-003"
chatbot_prompt = """
As an advanced chatbot, your primary goal is to assist users to the best of your ability. This may involve answering questions, providing helpful information, or completing tasks based on user input. In order to effectively assist users, it is important to be detailed and thorough in your responses. Use examples and evidence to support your points and justify your recommendations or solutions.
<conversation_history>
User: <user input>
@seyhajin
seyhajin / readme.md
Last active February 22, 2023 11:21
Minimal sprite rendering example written in C with `SDL2` for windowing, `sokol_gfx` for graphics API using WebGL2/GLES3, `stb_image` for loading image, compiled in WebAssembly with Emscripten

webgl2-wasm-sdl-sokol-sprite

Minimal sprite rendering example written in C with SDL2 for windowing, sokol_gfx for graphics API using WebGL2/GLES3, stb_image for loading image, compiled in WebAssembly with Emscripten.

Step by step

  1. Clone the repositories sokol and stb in the deps folder
  2. Add an image (sky.png) in assets directory
  3. Compile and build with the following command (need Emscripten installed):
@raysan5
raysan5 / raylib_vs_sdl.md
Last active June 12, 2024 16:55
raylib vs SDL - A libraries comparison

raylib_vs_sdl

In the last years I've been asked multiple times about the comparison between raylib and SDL libraries. Unfortunately, my experience with SDL was quite limited so I couldn't provide a good comparison. In the last two years I've learned about SDL and used it to teach at University so I feel that now I can provide a good comparison between both.

Hope it helps future users to better understand this two libraries internals and functionality.

Table of Content

@Lucrecious
Lucrecious / scale2x.gdshader
Created July 19, 2022 23:51
A Fast Rot-Sprite shader based on Scale3x
shader_type canvas_item;
const vec4 background = vec4(1., 1., 1., 0.);
float dist(vec4 c1, vec4 c2) {
return (c1 == c2) ? 0.0 : abs(c1.r - c2.r) + abs(c1.g - c2.g) + abs(c1.b - c2.b);
}
bool similar(vec4 c1, vec4 c2, vec4 input) {
return (c1 == c2 || (dist(c1, c2) <= dist(input, c2) && dist(c1, c2) <= dist(input, c1)));