Skip to content

Instantly share code, notes, and snippets.

View danielytics's full-sized avatar
🚰

Dan Kersten danielytics

🚰
  • Dublin, Ireland
View GitHub Profile
using storage_type = typename entt::storage_traits<entt::entity, MyComponent::storage_type;
storage_type::const_iterable g_iterable;
storage_type::const_iterable::const_iterator g_iterator;
extern "C" void setup ()
{
const auto& storage = registry.storage<MyComponent>();
g_iterable = storage.each();
g_iterator = g_iterable.begin();
void mergeEntity (entt::registry& source_registry, entt::registry& destination_registry, entt::entity source_entity, entt::entity destination_entity, bool overwrite_components)
{
for(auto [id, source_storage]: source_registry.storage()) {
auto destination_storage = destination_registry.storage(id);
if (destination_storage != nullptr && source_storage.contains(source_entity)) {
if (! destination_storage->contains(destination_entity)) {
destination_storage->emplace(destination_entity, source_storage.get(source_entity));
// If destination already contains the component, then either skip or "overwrite"
} else if (overwrite_components) {
destination_storage->erase(destination_entity);
#ifndef __STBTTF_HPP__
#define __STBTTF_HPP__
#include <SDL.h>
#include "stb_rect_pack.h"
#include "stb_truetype.h"
/* STBTTF: A quick and dirty SDL2 text renderer based on stb_truetype and stdb_rect_pack.
* Benoit Favre 2019
@danielytics
danielytics / Metaverse.md
Created July 22, 2023 12:53
GPT-4’s evaluation of the Metaverse concept

Pros of Metaverse:

  1. Enhanced Social Connectivity: Opportunities to interact and form communities on a global scale.
  2. Shared Ownership: Potential for users to own digital assets and control their virtual environments.
  3. Integration & Interoperability: Potential for experiences and assets to seamlessly exist across different platforms.
  4. Immersive Experiences: More engaging and interactive digital experiences.
  5. Decentralization: Aims to democratize power and control over virtual spaces.

Cons of Metaverse:

  1. Implementation Challenges: Significant technical hurdles to achieve interoperability and scalability.
  2. Unclear Economic Incentives: Financial benefits for users and platform providers are not fully clarified or realized.