This file contains 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 <array> | |
class Particle | |
{ | |
public: | |
Particle() : m_frameLeft(0) {} | |
void init(double x, double y, int lifeTime) | |
{ |
This file contains 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
// create images | |
std::vector<vk::Image> images = ...; | |
// gather information | |
uint32_t memoryTypeBits = ~0; // 0b11111111... | |
vk::DeviceSize totalSize = 0; | |
std::vector<vk::DeviceSize> offsets; | |
for (auto&& image : images) { | |
offsets.push_back(totalSize); | |
This file contains 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 <chrono> | |
struct Timer | |
{ | |
void start() | |
{ | |
startTime = std::chrono::steady_clock::now(); | |
} | |
long long elapsed() |
This file contains 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
struct Array1D | |
{ | |
float vals[WIDTH]; | |
float& operator[] (int index) | |
{ | |
return vals[index]; | |
} | |
}; |
This file contains 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
import math | |
import random | |
import matplotlib.pyplot as plt | |
class UniformDistribution: | |
def __init__(self, a: float, b: float) -> None: | |
self.a = a | |
self.b = b |
This file contains 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
import math | |
import random | |
import matplotlib.pyplot as plt | |
class UniformDistribution: | |
def __init__(self, a: float, b: float) -> None: | |
self.a = a | |
self.b = b |
This file contains 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
import math | |
import random | |
import matplotlib.pyplot as plt | |
class UniformDistribution: | |
def __init__(self, a: float, b: float) -> None: | |
self.a = a | |
self.b = b |
This file contains 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 <vector> | |
#include <iostream> | |
#include <functional> | |
struct Obj | |
{ | |
float speed = 10.0; | |
float velocity = 1.0; | |
std::function<void(void)> Update = [](){ }; | |
}; |
This file contains 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
ImGui::StyleColorsDark(); | |
ImVec4 red80 = ImVec4(0.8f, 0.0f, 0.0f, 1.0f); | |
ImVec4 red60 = ImVec4(0.6f, 0.0f, 0.0f, 1.0f); | |
ImVec4 red40 = ImVec4(0.4f, 0.0f, 0.0f, 1.0f); | |
ImVec4 black100 = ImVec4(0.0f, 0.0f, 0.0f, 1.0f); | |
ImVec4 black90 = ImVec4(0.1f, 0.1f, 0.1f, 1.0f); | |
ImVec4 black80 = ImVec4(0.2f, 0.2f, 0.2f, 1.0f); | |
ImVec4 black60 = ImVec4(0.4f, 0.4f, 0.4f, 1.0f); |
This file contains 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 <chrono> | |
#include <vector> | |
#include <random> | |
#include <optional> | |
#include <iostream> | |
#include <execution> | |
#include <functional> | |
void calcTime(const std::function<void(void)>& func) | |
{ |