Skip to content

Instantly share code, notes, and snippets.

View eugeneko's full-sized avatar

Eugene Kozlov eugeneko

  • CQG Inc.
  • Yerevan, Armenia (ex. Moscow, Russia)
View GitHub Profile
@eugeneko
eugeneko / DrawableProcessor.h
Created May 15, 2018 20:34
Tried to make DOD octree. Dropped this idea.
struct FlatOctant
{
static const unsigned NUM_OCTANTS = 8;
IntVector3 index_;
BoundingBox boundingBox_;
SceneProcessorDrawableSoA data_;
Vector<FlatOctant> children_;
unsigned numActiveChildren_ = 0;
bool HasChildren() const { return data_.size_ == 0; }
bool IsSubdivided() const { return !children_.Empty(); }
@eugeneko
eugeneko / RenderToTexture.cpp
Created May 26, 2018 11:55
10_RenderToTexture self-view
//
// Copyright (c) 2008-2018 the Urho3D project.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
@eugeneko
eugeneko / FlagSet.h
Created June 6, 2018 08:41
Flag set template
/// @file ls/common/FlagSet.h
/// @brief Flag set wrapper
#pragma once
#include "ls/common/import.h"
namespace ls
{
/// @addtogroup LsCommon
/// @{
@eugeneko
eugeneko / EnTTSummary.md
Last active August 30, 2018 20:40
EnTT API Summary

EnTT API Summary

Registry

Entities

Function Description
create Create an entity
destroy(e) Destroy the entity by ID
@eugeneko
eugeneko / CompactFlatVariantMap.h
Created March 20, 2019 19:46
Prototype of container
template <class T, unsigned NBoolsValue = 4, unsigned NIntsValue = 4, unsigned NVariantsValue = 1>
class CompactFlatVariantMap
{
public:
enum class PoolType { Bool, Int, Variant };
using ElementIndex = unsigned;
static const unsigned PoolTypeBits = 2;
static const unsigned PoolTypeMask = (1 << (PoolTypeBits + 1)) - 1;
static const unsigned NBools = NBoolsValue;
@eugeneko
eugeneko / Archive.h
Last active May 19, 2019 13:07
Archive interface
class Archive
{
/// Binary: [value]
/// XML: <name type="T">value</name>
/// JSON: "name": value (begin block or begin map)
/// value (begin array)
virtual bool Serialize(const char* name, T& value) = 0;
/// Binary: [key][value]
/// XML: <name key="key" type="T">value</name>
/// JSON: "key": value (begin block or begin map)
@eugeneko
eugeneko / main.cpp
Last active May 19, 2019 23:13
Universal serealization prototype
#include <Urho3D/Resource/JSONFile.h>
#include <Urho3D/Resource/JSONValue.h>
#include <Urho3D/Resource/XMLElement.h>
#include <Urho3D/Resource/XMLFile.h>
#include <EASTL/optional.h>
/// Type of archive block.
enum class ArchiveBlockType
{
@eugeneko
eugeneko / NodeHelper.h
Created August 10, 2019 21:39
Urho3D Node and Component helper
class WeakNodePtr : public WeakPtr<Node>
{
public:
bool LazyFind(Node* parentNode, const char* name, bool recursive = false)
{
return Initialize(parentNode, name, false, recursive);
}
void LazyFindOrCreate(Node* parentNode, const char* name, bool recursive = false)
{
const bool success = Initialize(parentNode, name, true, recursive);
@eugeneko
eugeneko / Main.cpp
Created September 17, 2019 22:38
Tests for Urho3D-to-EASTL container migration
void TestContainers()
{
{
Vector<int> v{};
assert(v.Size() == 0);
Vector<int>::Iterator i1 = v.Begin();
Vector<int>::ConstIterator i2 = v.End();
RandomAccessIterator<int> i3 = v.Begin();
@eugeneko
eugeneko / CppCodingStandard.md
Last active September 23, 2019 09:36
C++ CS

C++ Coding Standard

Файлы

Имена файлов

Имена

  • Используются следующие расширения файлов:
  • .h - для заголовочных файлов