Skip to content

Instantly share code, notes, and snippets.

View abidanBrito's full-sized avatar

Abidán Brito abidanBrito

  • UPV
  • Canary Islands
View GitHub Profile
@mmozeiko
mmozeiko / win32_webgpu.c
Last active June 30, 2024 10:27
setting up and using WebGPU in C using Dawn
// example how to set up WebGPU rendering on Windows in C
// uses Dawn implementation of WebGPU: https://dawn.googlesource.com/dawn/
// download pre-built Dawn webgpu.h/dll/lib files from https://github.com/mmozeiko/build-dawn/releases/latest
#include "webgpu.h"
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#define _USE_MATH_DEFINES
@mmozeiko
mmozeiko / upng.h
Last active February 25, 2024 08:08
uncompressed png writer & reader
#pragma once
// uncompressed png writer & reader
// supports only 8-bit and 16-bit formats
// Performance comparison for 8192x8192 BGRA8 image (256MB)
// Compiled with "clang -O2", AVX2 requires extra "-mavx2" or "/arch:AVX2" argument
//
// For libpng (compressed) uses default libpng/zlib compression settings
// For libpng (uncompressed) case following two functions are used:
@mmozeiko
mmozeiko / !README.md
Last active July 22, 2024 13:03
Download MSVC compiler/linker & Windows SDK without installing full Visual Studio

This downloads standalone MSVC compiler, linker & other tools, also headers/libraries from Windows SDK into portable folder, without installing Visual Studio. Has bare minimum components - no UWP/Store/WindowsRT stuff, just files & tools for native desktop app development.

Run py.exe portable-msvc.py and it will download output into msvc folder. By default it will download latest available MSVC & Windows SDK - currently v14.40.33807 and v10.0.26100.0.

You can list available versions with py.exe portable-msvc.py --show-versions and then pass versions you want with --msvc-version and --sdk-version arguments.

To use cl.exe/link.exe first run setup_TARGET.bat - after that PATH/INCLUDE/LIB env variables will be updated to use all the tools as usual. You can also use clang-cl.exe with these includes & libraries.

To use clang-cl.exe without running setup.bat, pass extra /winsysroot msvc argument (msvc is folder name where output is stored).

@ld100
ld100 / ArchLinuxWSL2.md
Last active July 16, 2024 10:24
Steps for setting up Arch Linux on WSL2

Migrating from Ubuntu on WSL to ArchLinux on WSL2

Obsolete notice

This document was created back in 2020 and might not be actual nowadays. It is not supported anymore, so use thise information at your own risk.

Upgrading to WSL 2

  • Download WSL2 Kernel
  • run wsl --set-default-version 2 in windows command line, so that all future WSL machine will use WSL2.
@raysan5
raysan5 / custom_game_engines_small_study.md
Last active July 21, 2024 06:51
A small state-of-the-art study on custom engines

CUSTOM GAME ENGINES: A Small Study

a_plague_tale

A couple of weeks ago I played (and finished) A Plague Tale, a game by Asobo Studio. I was really captivated by the game, not only by the beautiful graphics but also by the story and the locations in the game. I decided to investigate a bit about the game tech and I was surprised to see it was developed with a custom engine by a relatively small studio. I know there are some companies using custom engines but it's very difficult to find a detailed market study with that kind of information curated and updated. So this article.

Nowadays lots of companies choose engines like Unreal or Unity for their games (or that's what lot of people think) because d

@malustewart
malustewart / imgui_consultas_2020_1C.md
Last active September 2, 2023 19:53
Consultas de ImGui para EDA 1er cuatrimestre 2020

ImGui consultas 2020 1C

> ¿Cómo cambio el tamaño de las fonts?

En DemoWindow > Configuration > Fonts :

  • Para cambiar el tamaño de la font de una sola ventana, existe ImGui::SetWindowFontScale(window_scale), donde window_scale es un float que va desde 0.0 (tamaño casi invisible) a 2.0 (tamaño doble que el normal).
  • Para cambiar el tamaño de una font en todas las ventanas, alcanza con modificar io.FontGlobalScale. io es el contexto de ImGui que se obtiene en la inicialización. FontGlobalScale es un float que va desde 0.0 (tamaño casi invisible) a 2.0 (tamaño doble que el normal).

Ver líneas 3324 a 3327 de imgui_demo.cpp

> ¿Cómo fijo la posición de las ventanas?

This note simply gathers some info and thoughts on building Node Editor, especially in an
immediate mode setting.
Q: How does imgui render rounded rects?
Check imgui AddRectFilled
Imgui drawing api is closer to nanoVG
- Path is kept
- Contents are modified based on path
@Wumpf
Wumpf / cfd.md
Last active June 27, 2024 11:54
Notes on CFD
@danieldogeanu
danieldogeanu / MakePowerShellRememberSSHPassphrase.md
Last active July 22, 2024 22:17
How to make Powershell remember the SSH key passphrase.

You should not use the Open SSH client that comes with Git for Windows. Instead, Windows 10 has its own implementation of Open SSH that is integrated with the system. To achieve this:

  1. Start the ssh-agent from Windows Services:
  • Type Services in the Start Menu or Win+R and then type services.msc to launch the Services window;
  • Find the OpenSSH Authentication Agent in the list and double click on it;
  • In the OpenSSH Authentication Agent Properties window that appears, choose Automatic from the Startup type: dropdown and click Start from Service status:. Make sure it now says Service status: Running.
  1. Configure Git to use the Windows 10 implementation of OpenSSH by issuing the following command in Powershell:
git config --global core.sshCommand C:/Windows/System32/OpenSSH/ssh.exe
void printOpenGLDebugInfo()
{
int majorVersion, minorVersion;
glGetIntegerv(GL_MAJOR_VERSION, &majorVersion);
glGetIntegerv(GL_MINOR_VERSION, &minorVersion);
std::cout << "OpenGL Version: " << majorVersion << "." << minorVersion
<< std::endl;
int work_grp_cnt[3];