Skip to content

Instantly share code, notes, and snippets.

@Flix01
Flix01 / imgui_virtual_keyboard.cpp
Last active March 1, 2024 14:15
Complete keyboard prototype for Dear ImGui version 1.87.
/* This code is an extension of the 'keyboard section' present in 'imgui_demo.cpp'.
License is the same (MIT License AFAIK)
*/
#include <imgui_virtual_keyboard.h>
namespace ImGui {
// VirtualKeyboard Implementation
const char** GetKeyboardLogicalLayoutNames() {
@Flix01
Flix01 / imguifontloader.cpp
Last active March 1, 2024 10:12
imguifontloader: imgui extension that loads txt-based .fnt and .ttf files
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
@Flix01
Flix01 / totp.c
Last active February 26, 2024 11:27 — forked from syzdek/totp.c
totp.c
// Original code: https://gist.github.com/syzdek/eba233ca33e1b5a45a99
// Original code license:
/*
* TOTP: Time-Based One-Time Password Algorithm
* Copyright (c) 2015, David M. Syzdek <david@syzdek.net>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
@Flix01
Flix01 / imguilistview.h
Last active October 13, 2023 23:19
Minimal ListView implementation for ImGui version v1.31
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
@Flix01
Flix01 / edtaa3func.h
Last active September 11, 2023 08:47
A Signed Distance Font Builder for Dear ImGui
/*
* edtaa3()
*
* Sweep-and-update Euclidean distance transform of an
* image. Positive pixels are treated as object pixels,
* zero or negative pixels are treated as background.
* An attempt is made to treat antialiased edges correctly.
* The input image must have pixels in the range [0,1],
* and the antialiased image should be a box-filter
* sampling of the ideal, crisp edge.
@Flix01
Flix01 / README.txt
Last active August 19, 2023 08:36
imguifilesystem dialogs for imgui v.1.17 wip (https://github.com/ocornut/imgui/issues/88)
imguifilesystem dialogs for imgui v.1.17 wip (https://github.com/ocornut/imgui).
See also: https://github.com/ocornut/imgui/issues/88
It's composed by three files:
- imguifilesystem.h (usage instructions are here)
- imguifilesystem.cpp
- dirent_portable.h
It needs testing and feedback (expecially for Windows/VisualC++ and MacOS).
@Flix01
Flix01 / imguitabwindow.cpp
Last active August 19, 2023 08:35
ImGui::TabWindow: a self-partitioning ImGui::Window with TabLabels that can be dragged around.
#include "imguitabwindow.h"
#include <imgui_internal.h>
#include <imgui.h> // intellisense
// TODO: Clean this code, it's a mess!
namespace ImGui {
@Flix01
Flix01 / mini_mp3_radio_decoder.c
Last active July 9, 2023 06:55
Very basic single-file, plain C, openAL mp3 radio decoder
// gist made after this issue: https://github.com/mackron/dr_libs/issues/142
/*
The license refers to this single file.
Every included or linked library comes with its own license
===============================================================================
Public Domain (www.unlicense.org)
===============================================================================
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,
@Flix01
Flix01 / imguistyleserializer.cpp
Last active June 15, 2023 08:15
imguistyleserializer
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
@Flix01
Flix01 / imguiverticaltext.h
Created June 23, 2016 17:23
ImDrawList methods to display vertical text in ImGui
#pragma once
#include <imgui.h>
#include <imgui_internal.h>
// ImDrawList methods to display vertical text
/*
// TEST: inside a window:
ImGuiWindow* window = ImGui::GetCurrentWindow();
ImDrawList* dl = window->DrawList;