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
| Declaration | |
| ____________ | |
| // variable | |
| a: int; // <var-id>: <type-id>; | |
| b: int = 15; // <var-id>: <type-id> = <expr>; | |
| // constant variable (must be initialized first) | |
| let ca: int = 15; // let <var-id>: <type-id> = <expr>; |
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
| #ifndef LAZY_DELETE_H | |
| #define LAZY_DELETE_H | |
| template <class Delete> | |
| void deleteAll(Delete del) | |
| { | |
| delete del; | |
| } | |
| template <class Delete, class... Deletes> |
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") |
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
| # 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
| 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
| 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
| #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
| #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 <thread> | |
| #include <vector> | |
| #include <functional> | |
| #include <condition_variable> | |
| #include <queue> | |
| #include <utility> | |
| class ThreadPool | |
| { | |
| public: |