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
package shaderc | |
import "core:c" | |
when ODIN_OS == .Windows { | |
@(export) foreign import lib { "shaderc_shared.lib" } | |
} else { | |
@(export) foreign import lib { "system:libshaderc_shared.so" } | |
} | |
source_language :: enum { |
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
#define OLC_PGE_APPLICATION | |
#include "olcPixelGameEngine.h" | |
#include <functional> | |
#include <string_view> | |
#ifdef __EMSCRIPTEN__ | |
EM_JS(const char*, WebNavigate, (const char* str), { | |
window.location.href = UTF8ToString(str); | |
}); |
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
//https://en.wikipedia.org/wiki/Black-body_radiation | |
//Converts color temperature (kelvins, K) into RGB | |
vec3 colorTemp(float temp) { | |
temp *= .01; | |
vec3 c; | |
c.r = mix(1., clamp(1.2929361861 * pow(temp - 60., -0.1332047592), 0., 1.), step(66., temp)); | |
c.g = mix(clamp(0.39008157877 * log(temp) - 0.6318414437886275, 0., 1.), clamp(1.1298908609 * pow(temp - 60., -0.0755148492), 0., 1.), step(66., temp)); |
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 "olcPixelGameEngine.h" | |
#include <vector> | |
#include <list> | |
#include <string> | |
#include <unordered_map> | |
#include <new> | |
#include <algorithm> | |
#include <random> | |
#include <memory> |
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
#define OLC_PGE_APPLICATION | |
#include "olcPixelGameEngine.h" | |
#include <list> | |
#include <random> | |
//By MaGetzUb | |
//Some helper functions | |
//Clamps the value between a range ow [Low, High] |
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 <fstream> | |
#include <vector> | |
#include <iostream> | |
#include <string> | |
//TODO: More types & features, more error handling and stuff. | |
std::vector<float> OpenWAV(const std::string& path, int& sampleRate, int& numChannels) { | |
auto result = std::vector<float>(); |
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
void TilemapEditor::paintEvent(QPaintEvent* e) { | |
QPainter p(this); | |
//p.scale(mZoom, mZoom); | |
p.fillRect(e->rect(), QBrush(Qt::black)); | |
if(!mTilemap->tilesetCount()) return; | |
int camX = mCameraPosition.x(); | |
int camY = mCameraPosition.y(); |
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
Const TileW = 32 | |
Const TileH = 32 | |
Const ScrW = 1280 | |
Const ScrH = 720 | |
FrameLimit 60 | |
Dim Grid(ScrW/TileW, ScrH/TileH) As Integer |