Skip to content

Instantly share code, notes, and snippets.

View nclettiere's full-sized avatar
🐦
RedEngine

Nicolas C. Lettiere nclettiere

🐦
RedEngine
View GitHub Profile
@nclettiere
nclettiere / order_vs_folders.cmake
Last active December 6, 2025 05:59
Preserve source code folder structure using CMake and Visual Studio
# Order Visual Studio folder structure
# Put this at the end of your CMake target
# Replace this 'TARGET_SOURCES' with the list of sources (including headers files) of your target.
file(GLOB_RECURSE TARGET_SOURCES CONFIGURE_DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/**.cpp
${CMAKE_CURRENT_SOURCE_DIR}/**/**.cpp
${CMAKE_CURRENT_SOURCE_DIR}/**.h
${CMAKE_CURRENT_SOURCE_DIR}/**/**.h
@nclettiere
nclettiere / variant.cpp
Last active April 2, 2025 12:38
Tiny portable C++ Variant class based on the Godot Engine Variant class
#include <string>
#include <cassert>
#include <cmath>
#include <iostream>
using String = std::string;
class Variant
{
public:
@nclettiere
nclettiere / img2buff.ps1
Created March 13, 2022 08:28
Converts images to a C style buffer header file
#######################################################################
#
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# Version 2, December 2004
#
# Copyright (C) 2004 Sam Hocevar
# 14 rue de Plaisance, 75014 Paris, France
# Everyone is permitted to copy and distribute verbatim or modified
# copies of this license document, and changing it is allowed as long
# as the name is changed.