This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Public Domain under http://unlicense.org, see link for details. | |
| // Self-reference: https://gist.github.com/fp64/55b778b310f00aa4ca1304d8fd99a377 | |
| // Self-contained Wavefront OBJ viewer for Windows and Linux | |
| // (or anything that has SDL2), using softrender. Fairly limited: | |
| // no materials/textures, no points/lines/curves/NURBS, no | |
| // smoothing groups. Not fast, but should be usable up to | |
| // about 500k triangles. | |
| // Usage: viewobj [--fullscreen] [--size=WIDTHxHEIGHT] FILE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Dear ImGui: standalone example application for SDL2 + Softrender | |
| // (SDL is a cross-platform general purpose library for handling windows, inputs, OpenGL/Vulkan/Metal graphics context creation, etc.) | |
| // Learn about Dear ImGui: | |
| // - FAQ https://dearimgui.com/faq | |
| // - Getting Started https://dearimgui.com/getting-started | |
| // - Documentation https://dearimgui.com/docs (same as your local docs/ folder). | |
| // - Introduction, links and more at the top of imgui.cpp | |
| // See imgui_impl_sdl2.cpp for details. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Public Domain under http://unlicense.org, see link for details. */ | |
| /* Self-reference: https://gist.github.com/fp64/d54bfa1070bfd8f3e845018de7b0bf7d */ | |
| /* | |
| In-place (de)interleave array of size 2*n, in O(n) time and O(1) extra space. | |
| The "interleave" operation on an array produces an array of | |
| alternating elements from its lower and higher halves: | |
| a[0],...,a[2*n-1] -> a[0],a[n],a[1],a[n+1],...,a[n-1],a[2*n-1] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Public Domain under http://unlicense.org, see link for details. */ | |
| /* | |
| mb3d.h - a simple single-file library for 3D metaballs. | |
| USAGE | |
| This file acts as its own header. To instantiate | |
| an implementation do | |
| #define MB3D_IMPLEMENTATION | |
| in ONE translation unit that includes this file. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Public Domain under http://unlicense.org, see link for details. | |
| // Short, ugly and slow UTF-8 parsing routune. | |
| // Exhaustively verified on all 0..4 byte strings | |
| // against https://bjoern.hoehrmann.de/utf-8/decoder/dfa/ | |
| // (which is what you may want to actually use). | |
| #include <stdint.h> | |
| // Returns the initial codepoint in UTF-8 string [b;e), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Public Domain under http://unlicense.org, see link for details. | |
| // Portable scalar functions for blending RGBA pixels | |
| // represented as uint32, in both "lerp" and | |
| // "premultiplied alpha" modes, extracted from | |
| // https://github.com/fp64/dbc_blit | |
| // (see dbcB_bla_1_c and dbcB_blp_1_c). For | |
| // discussion about premultiplied alpha, see e.g. | |
| // https://tomforsyth1000.github.io/blog.wiki.html#[[Premultiplied%20alpha]] | |
| // https://tomforsyth1000.github.io/blog.wiki.html#[[Premultiplied%20alpha%20part%202]] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python3 | |
| # Public Domain under http://unlicense.org, see link for details. | |
| # A simple utility to convert .bdf font files to C code. | |
| # Doesn't do much any validation, and expects "sensible" .bdf input. | |
| import sys | |
| import optparse |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Copyright (c) 2012- PPSSPP Project. | |
| // This program is free software: you can redistribute it and/or modify | |
| // it under the terms of the GNU General Public License as published by | |
| // the Free Software Foundation, version 2.0 or later versions. | |
| // This program is distributed in the hope that it will be useful, | |
| // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| // GNU General Public License 2.0 for more details. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Public Domain under http://unlicense.org, see link for details. | |
| // Quick-and-dirty conversion between VK_* and SDLK_* keycodes. | |
| // Rudimentary, and generally assumes US ANSI keyboard. | |
| static long vk2sdlk(long key) | |
| { | |
| static const long S=1L<<30,lut[256]={ | |
| 0, 0, 0,S|155, 0, 0, 0, 0, 8, 9, 0, 0,S|156, 13, 0, 0, | |
| 0, 0, 0,S| 72,S| 57, 0, 0, 0, 0, 0, 0, 27, 0, 0, 0,S| 1, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Move-optimal solutions to "auto-generated" sokoban level set | |
| (Yoshio Murase, https://www.ne.jp/asahi/ai/yoshio/sokoban/auto52/index.html) | |
| soko001.txt luuluRurrrddlLrruullldlddrdrrUdlluluururrrddLddlluUddrruuLUdrddlluluuRuRDllddrUddrruuL | |
| soko002.txt lllddddrUluuurrddLdlUrruurrddLdLUlldRurrruullllDDrrUdlluurRddlddlUUrrrdLullddrUruuullDDRdrUrruuL | |
| soko003.txt lDLddddlUruuurrdLulDlluRRdDDlUruulldRurDrruL | |
| soko004.txt ldLruulDLDRRdrUUUlldldlddrUUlUUdRRRdrU | |
| soko005.txt ldDurrdLdLLdlluurDDrurruulDrdLLddrUUldlluurDldRurrruulDrdLLLdlUrrrdLL | |
| soko006.txt uluurDrrrrddLLUdrruulLLulldRlddrUUluRdddRRuuLrddlluUrrrrddL | |
| soko007.txt dlluluuRDDlddrruruuLrruullDlDRllddRUluurrdRdrUUdlddLdlU |
NewerOlder