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 <iostream> | |
#include <stack> | |
#include <array> | |
#include <algorithm> | |
#include <random> | |
#include <memory> | |
#include <SDL.h> | |
#undef main |
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 <functional> | |
template<typename T> | |
class Property | |
{ | |
public: | |
using GetterFn = T&(); | |
using SetterFn = void(const T&); | |
template<typename Getter, typename Setter> |
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 <thread> | |
#include <vector> | |
#include <functional> | |
#include <condition_variable> | |
#include <queue> | |
#include <utility> | |
class ThreadPool | |
{ | |
public: |
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 <iostream> | |
using Hx::ECS::ECSContext; | |
using Hx::ECS::EntityManager; | |
using Hx::ECS::Entity; | |
using Hx::ECS::World; | |
using Hx::ECS::System; | |
using Hx::Components::Position2D; | |
using Hx::Components::Direction2D; | |
using Hx::Components::Sprite2D; |
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 <Hx.hpp> | |
#include <iostream> | |
using Hx::App::Application; | |
using Hx::App::Game; | |
using Hx::Entity::Entity; | |
using Hx::Entity::EntityManager; | |
using Hx::Entity::PlayerSystem; | |
using Hx::Math::Vec2; |
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 | |
UpdateShadowMatrix() | |
{ | |
DirectX::XMMATRIX camInv; | |
DirectX::XMMATRIX shadowView; | |
RwCamera* rwcam = Scene.camera; | |
float minDist = RwCameraGetNearClipPlane(rwcam); | |
float maxDist = RwCameraGetFarClipPlane(rwcam); | |
CVector sunPos; | |
CVector camPos; |
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
float rand(vec2 p) | |
{ | |
float t = floor(iTime * 20.) / 10.; // limit glitch FPS | |
//t = exp(t); | |
return fract(sin(dot(p, vec2(t * 12.9898, t * 78.233))) * 43758.5453); | |
} | |
float noise(vec2 uv, float blockiness) | |
{ | |
vec2 lv = fract(uv); |
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
# JPEG Emulator | |
# licensed under GPLv2 license | |
# | |
# What this thing does? | |
# It emulates jpeg DCT algorithm | |
# | |
# Python 3 is required to run this code | |
# | |
# HOW TO USE: | |
# 1. install numpy, scipy, and Pillow package |
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
union IEEEFloat | |
{ | |
struct | |
{ | |
int m : 23; | |
int e : 8; | |
int s : 1; | |
}; | |
int i; |
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 <Windows.h> | |
#include <d3d11.h> | |
#include <iostream> | |
#include <vector> | |
#include <thread> | |
#include <mutex> | |
#include <d3dcompiler.h> | |
#pragma comment(lib, "dxgi.lib") | |
#pragma comment(lib, "d3d11.lib") |
NewerOlder