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) 2025 Le Juez Victor | |
* | |
* 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 |
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
Get a glad header (4.6 core): https://gen.glad.sh/ | |
Build with: `gcc prof.c -o prof -lSDL2` |
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
#version 330 core | |
noperspective in vec2 vTexCoord; | |
uniform sampler2D uTexColor; | |
out vec4 FragColor; | |
float GradientNoise(in vec2 fragCoord) | |
{ | |
// from: https://www.shadertoy.com/view/lfyBWK | |
return fract(52.9829189 * fract(dot(fragCoord, vec2(0.06711056, 0.00583715)))); |
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
#include <raylib.h> | |
#include <raymath.h> | |
static void SetSoundPosition(Camera listener, Sound sound, Vector3 position, float maxDist) | |
{ | |
// Calculate direction vector and distance between listener and sound source | |
Vector3 direction = Vector3Subtract(position, listener.position); | |
float distance = Vector3Length(direction); | |
// Apply logarithmic distance attenuation and clamp between 0-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
// This code is distributed under the Unlicense license. | |
// For more details, please visit https://unlicense.org/ | |
#ifndef IDMAN_HPP | |
#define IDMAN_HPP | |
#include <type_traits> | |
#include <set> | |
/** |
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
// This code is distributed under the Unlicense license. | |
// For more details, please visit https://unlicense.org/ | |
template <class T> | |
class CircularBuffer | |
{ | |
private: | |
std::unique_ptr<T[]> buffer; | |
size_t frontIndex; | |
size_t backIndex; |
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
local function formatString(inputString) | |
local outputString = "" | |
for line in inputString:gmatch("[^\r\n]+") do | |
if line:match("%S") then -- Check if row is empty | |
local formattedLine = line:gsub("^%s*", "") -- Remove spaces before the first character of the line |
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
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools"> | |
<uses-feature android:glEsVersion="0x00020000" android:required="true" /> | |
<!-- Add this for apps targeting Android 13 or higher & GMA SDK version 20.3.0 or lower --> | |
<uses-permission android:name="com.google.android.gms.permission.AD_ID"/> | |
<application> |
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
local lg = love.graphics | |
local Display = { | |
size = { | |
w = 0, | |
h = 0, | |
ox = 0, | |
oy = 0 | |
}; |
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
require("table-partition.lua") | |
do -- Dividing a table with a length of 167 into 7 tables | |
local TBL = {} | |
for i = 1, 167 do TBL[i] = i end | |
local TBLS = table.partition(TBL, 7) |
NewerOlder