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
| /* Sample range-based clamp implementation */ | |
| #include <iostream> | |
| #include <vector> | |
| #include <limits> | |
| #include <cmath> | |
| #include <map> | |
| class PrimeNumbers { | |
| std::map<size_t, bool> primeMap = {{2, true}}; | |
| std::vector<size_t> prime = {2}; |
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 <algorithm> | |
| #include <iostream> | |
| #include <vector> | |
| #include <string> | |
| template<typename T, typename U> | |
| std::pair<const std::vector<T>&, const U&> printable_vector(const std::vector<T>& vec, const U& separator) { | |
| return std::pair<const std::vector<T>&, const U&>({vec, separator}); | |
| } |
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 <string> | |
| #include <vector> | |
| #include <random> | |
| class randomMachine { | |
| private: | |
| std::random_device rd; | |
| std::mt19937 mt; |
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
| /* Sample range-based clamp implementation */ | |
| #include <iostream> | |
| #include <vector> | |
| template<typename T> | |
| struct Range { | |
| T lowest; | |
| T highest; | |
| }; |
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
| net = require('net'); | |
| String.prototype.hashCode = function() { | |
| var hash = 0, i, chr, len; | |
| if (this.length === 0) return hash; | |
| for (i = 0, len = this.length; i < len; i++) { | |
| chr = this.charCodeAt(i); | |
| hash = ((hash << 5) - hash) + chr; | |
| hash |= 0; // Convert to 32bit integer | |
| } |
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 <SFML/Graphics.hpp> | |
| #include <iostream> | |
| #include <cassert> | |
| #include <vector> | |
| #include <memory> | |
| class GameObject: | |
| public sf::Drawable { | |
| private: | |
| static size_t m_count; |
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_safe_shared_ptr.h" | |
| #include <chrono> | |
| #include <thread> | |
| /* data_type has to provide operators "int" and "=" */ | |
| typedef int data_type; | |
| typedef ts_mem::thread_safe_shared_ptr<data_type> ts_data_type_ptr; | |
| /* Update time every "second" */ | |
| void f(ts_data_type_ptr p) |
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
| /* =============================================================* | |
| * Trengine (c) Dmitro bjornus Szewczuk | dmitro.szewczuk@wp.pl * | |
| * zlib License https://opensource.org/licenses/Zlib * | |
| * =========================================================== */ | |
| #include "../../headers/Device.hpp" | |
| #include "../../headers/Shader.hpp" | |
| #include "../../headers/Scene.hpp" | |
| using namespace trengine; |
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
| #pragma once | |
| #include <ostream> | |
| namespace trengine | |
| { | |
| struct vec3 | |
| { | |
| float x, y, z; |
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
| TEMPLATE = app | |
| TARGET = MinimalPlusPlus | |
| INCLUDEPATH += . | |
| QT += core gui | |
| greaterThan(QT_MAJOR_VERSION, 4): QT += widgets | |
| # Input | |
| HEADERS += includes.hpp \ | |
| window.hpp \ |