text
stringlengths
1
24.5M
#include "SepiaFilter.hpp" namespace acid { SepiaFilter::SepiaFilter(const Pipeline::Stage &pipelineStage) : PostFilter(pipelineStage, {"Shaders/Post/Default.vert", "Shaders/Post/Sepia.frag"}) { } void SepiaFilter::Render(const CommandBuffer &commandBuffer) { // Updates descriptors. PushConditional("writeColour", ...
#pragma once #include "Post/PostFilter.hpp" namespace acid { class ACID_EXPORT SepiaFilter : public PostFilter { public: explicit SepiaFilter(const Pipeline::Stage &pipelineStage); void Render(const CommandBuffer &commandBuffer) override; }; }
#include "SsaoFilter.hpp" #include "Maths/Vector4.hpp" #include "Maths/Maths.hpp" #include "Scenes/Scenes.hpp" #include "Resources/Resources.hpp" namespace acid { static const uint32_t SSAO_NOISE_DIM = 4; static const uint32_t SSAO_KERNEL_SIZE = 64; static const float SSAO_RADIUS = 0.5f; SsaoFilter::SsaoFilter(const...
#pragma once #include "Utils/Future.hpp" #include "Post/PostFilter.hpp" #include "Maths/Vector3.hpp" namespace acid { class ACID_EXPORT SsaoFilter : public PostFilter { public: explicit SsaoFilter(const Pipeline::Stage &pipelineStage); void Render(const CommandBuffer &commandBuffer) override; private: std::vecto...
#include "TiltshiftFilter.hpp" namespace acid { TiltshiftFilter::TiltshiftFilter(const Pipeline::Stage &pipelineStage, float blurAmount, float centre, float stepSize, float steps) : PostFilter(pipelineStage, {"Shaders/Post/Default.vert", "Shaders/Post/Tiltshift.frag"}), blurAmount(blurAmount), centre(centre), step...
#pragma once #include "Post/PostFilter.hpp" namespace acid { class ACID_EXPORT TiltshiftFilter : public PostFilter { public: explicit TiltshiftFilter(const Pipeline::Stage &pipelineStage, float blurAmount = 1.0f, float centre = 1.1f, float stepSize = 0.004f, float steps = 3.0f); void Render(const CommandBuffer &...
#include "ToneFilter.hpp" namespace acid { ToneFilter::ToneFilter(const Pipeline::Stage &pipelineStage) : PostFilter(pipelineStage, {"Shaders/Post/Default.vert", "Shaders/Post/Tone.frag"}) { } void ToneFilter::Render(const CommandBuffer &commandBuffer) { // Updates descriptors. PushConditional("writeColour", "samp...
#pragma once #include "Post/PostFilter.hpp" namespace acid { class ACID_EXPORT ToneFilter : public PostFilter { public: explicit ToneFilter(const Pipeline::Stage &pipelineStage); void Render(const CommandBuffer &commandBuffer) override; }; }
#include "VignetteFilter.hpp" namespace acid { VignetteFilter::VignetteFilter(const Pipeline::Stage &pipelineStage, float innerRadius, float outerRadius, float opacity) : PostFilter(pipelineStage, {"Shaders/Post/Default.vert", "Shaders/Post/Vignette.frag"}), innerRadius(innerRadius), outerRadius(outerRadius), opac...
#pragma once #include "Post/PostFilter.hpp" namespace acid { class ACID_EXPORT VignetteFilter : public PostFilter { public: explicit VignetteFilter(const Pipeline::Stage &pipelineStage, float innerRadius = 0.15f, float outerRadius = 1.35f, float opacity = 0.85f); void Render(const CommandBuffer &commandBuffer) ove...
#include "WobbleFilter.hpp" namespace acid { WobbleFilter::WobbleFilter(const Pipeline::Stage &pipelineStage, float wobbleSpeed) : PostFilter(pipelineStage, {"Shaders/Post/Default.vert", "Shaders/Post/Wobble.frag"}), wobbleSpeed(wobbleSpeed), wobbleAmount(0.0f) { } void WobbleFilter::Render(const CommandBuffer &co...
#pragma once #include "Post/PostFilter.hpp" namespace acid { class ACID_EXPORT WobbleFilter : public PostFilter { public: explicit WobbleFilter(const Pipeline::Stage &pipelineStage, float wobbleSpeed = 2.0f); void Render(const CommandBuffer &commandBuffer) override; float GetWobbleSpeed() const { return wobbleSp...
#include "BlurPipeline.hpp" #include "Devices/Windows.hpp" #include "Graphics/Graphics.hpp" namespace acid { BlurPipeline::BlurPipeline(const Pipeline::Stage &pipelineStage, float blur, const BlurFilter::Type &blurType, bool toScreen, float inputScale, float outputScale) : PostPipeline(pipelineStage), filterBlurVe...
#pragma once #include "Post/Filters/BlurFilter.hpp" #include "Post/PostPipeline.hpp" namespace acid { class ACID_EXPORT BlurPipeline : public PostPipeline { public: explicit BlurPipeline(const Pipeline::Stage &pipelineStage, float blur = 2.0f, const BlurFilter::Type &blurType = BlurFilter::Type::_9, bool toScreen = ...
#pragma once #include <typeindex> #include "Utils/NonCopyable.hpp" #include "Export.hpp" namespace acid { /** * @brief A managed resource object. Implementations contain Create functions that can take a node object or pass parameters to the constructor. */ class ACID_EXPORT Resource : NonCopyable { public: Resour...
#include "Resources.hpp" namespace acid { Resources::Resources() : elapsedPurge(5s) { } void Resources::Update() { if (elapsedPurge.GetElapsed() != 0) { for (auto it = resources.begin(); it != resources.end();) { for (auto it1 = it->second.begin(); it1 != it->second.end();) { if ((*it1).second.use_count() ...
#pragma once #include <unordered_map> #include "Engine/Engine.hpp" #include "Utils/ThreadPool.hpp" #include "Files/Files.hpp" #include "Files/Node.hpp" #include "Resource.hpp" namespace acid { /** * @brief Module used for managing resources. Resources are held alive as long as they are in use, * a existing resourc...
#pragma once #include "Maths/Matrix4.hpp" #include "Maths/Vector3.hpp" #include "Physics/Frustum.hpp" #include "Physics/Ray.hpp" namespace acid { /** * @brief Component that represents a scene camera, this object should be overridden with new behaviour. */ class ACID_EXPORT Camera { public: Camera() : nearPlane(...
#pragma once #include "Utils/StreamFactory.hpp" namespace acid { class Entity; /** * @brief Class that represents a functional component attached to entity. */ class ACID_EXPORT Component : public StreamFactory<Component> { friend class Entity; public: virtual ~Component() = default; /** * Run when starting ...
#include "Entity.hpp" namespace acid { void Entity::Update() { for (auto it = components.begin(); it != components.end();) { if ((*it)->IsRemoved()) { it = components.erase(it); continue; } if ((*it)->GetEntity() != this) (*it)->SetEntity(this); if ((*it)->IsEnabled()) { if (!(*it)->started) { ...
#pragma once #include "Utils/NonCopyable.hpp" #include "Component.hpp" namespace acid { /** * @brief Class that represents a objects that acts as a component container. */ class ACID_EXPORT Entity final : NonCopyable { public: Entity() = default; void Update(); const std::string &GetName() const { return name;...
#include "EntityHolder.hpp" #include "Physics/Rigidbody.hpp" #include "EntityPrefab.hpp" namespace acid { EntityHolder::EntityHolder() { } void EntityHolder::Update() { for (auto it = objects.begin(); it != objects.end();) { if ((*it)->IsRemoved()) { it = objects.erase(it); continue; } (*it)->Update();...
#pragma once #include "Physics/Rigidbody.hpp" #include "Entity.hpp" namespace acid { /** * @brief Class that represents a structure of spatial objects. */ class ACID_EXPORT EntityHolder : NonCopyable { public: EntityHolder(); void Update(); /** * Gets a Entity by name. * @param name The Entity name. * @...
#include "EntityPrefab.hpp" #include "Files/Json/Json.hpp" #include "Files/File.hpp" #include "Resources/Resources.hpp" #include "Entity.hpp" #include "Scenes.hpp" namespace acid { std::shared_ptr<EntityPrefab> EntityPrefab::Create(const Node &node) { if (auto resource = Resources::Get()->Find<EntityPrefab>(node)) ...
#pragma once #include "Files/File.hpp" #include "Files/Node.hpp" #include "Resources/Resource.hpp" namespace acid { class Entity; /** * @brief Resource that represents a entity prefab. */ class ACID_EXPORT EntityPrefab : public Resource { public: /** * Creates a new entity prefab, or finds one with the same val...
#include "Scene.hpp" namespace acid { Scene::Scene(std::unique_ptr<Camera> &&camera) : camera(std::move(camera)) { } void Scene::Update() { systems.ForEach([](auto typeId, auto system) { if (system->IsEnabled()) system->Update(); }); entities.Update(); camera->Update(); } void Scene::ClearSystems() { sys...
#pragma once #include "Camera.hpp" #include "EntityHolder.hpp" #include "SystemHolder.hpp" namespace acid { /** * @brief Class that is used to represent a scene. */ class ACID_EXPORT Scene : public virtual rocket::trackable { friend class Scenes; public: /** * Creates a new scene. * @param camera The scenes c...
#include "Scenes.hpp" namespace acid { Scenes::Scenes() { } void Scenes::Update() { if (!scene) return; if (!scene->started) { scene->Start(); scene->started = true; } scene->Update(); } }
#pragma once #include "Engine/Engine.hpp" #include "Graphics/Graphics.hpp" #include "Scene.hpp" namespace acid { /** * @brief Module used for managing game scenes. */ class ACID_EXPORT Scenes : public Module::Registrar<Scenes> { // TODO: Scenes should not require Graphics, this is because of Material and Mesh comp...
#pragma once #include "Utils/NonCopyable.hpp" #include "Utils/TypeInfo.hpp" namespace acid { class ACID_EXPORT System : NonCopyable { public: virtual ~System() = default; virtual void Update() = 0; bool IsEnabled() const { return enabled; } void SetEnabled(bool enable) { this->enabled = enable; } private: boo...
#include "SystemHolder.hpp" namespace acid { void SystemHolder::Clear() { systems.clear(); } }
#pragma once #include <memory> #include "Engine/Log.hpp" #include "Utils/NonCopyable.hpp" #include "System.hpp" namespace acid { class ACID_EXPORT SystemHolder : NonCopyable { public: /** * Checks whether a System exists or not. * @tparam T The System type. * @return If the System exists. */ template<typen...
#include "ShadowBox.hpp" #include "Devices/Windows.hpp" #include "Graphics/Graphics.hpp" #include "Maths/Maths.hpp" namespace acid { ShadowBox::ShadowBox() { // Creates the offset for part of the conversion to shadow map space. offset = offset.Translate(Vector3f(0.5f)); offset = offset.Scale(Vector3f(0.5f)); } vo...
#pragma once #include "Maths/Matrix4.hpp" #include "Maths/Vector4.hpp" #include "Scenes/Camera.hpp" namespace acid { /** * @brief Represents the 3D area of the world in which engine.shadows will be cast (basically represents the orthographic projection area for the shadow render pass). * It can be updated each f...
#include "ShadowRender.hpp" #include "Maths/Transform.hpp" #include "Meshes/Mesh.hpp" #include "Scenes/Entity.hpp" #include "Scenes/Scenes.hpp" #include "Shadows.hpp" namespace acid { ShadowRender::ShadowRender() { } void ShadowRender::Start() { } void ShadowRender::Update() { } bool ShadowRender::CmdRender(const ...
#pragma once #include "Scenes/Component.hpp" #include "Graphics/Descriptors/DescriptorsHandler.hpp" #include "Graphics/Buffers/PushHandler.hpp" #include "Graphics/Pipelines/PipelineGraphics.hpp" namespace acid { /** * @brief Component that is used to render a entity as a shadow. */ class ACID_EXPORT ShadowRender : ...
#include "Shadows.hpp" #include "Scenes/Scenes.hpp" namespace acid { Shadows::Shadows() : lightDirection(0.5f, 0.0f, 0.5f), shadowSize(4096), shadowPcf(1), shadowBias(0.001f), shadowDarkness(0.6f), shadowTransition(11.0f), shadowBoxOffset(9.0f), shadowBoxDistance(70.0f) { } void Shadows::Update() { if (auto...
#pragma once #include "Maths/Vector3.hpp" #include "Scenes/System.hpp" #include "ShadowBox.hpp" namespace acid { /** * @brief Module used for managing a shadow map. */ class ACID_EXPORT Shadows : public System { public: Shadows(); void Update() override; const Vector3f &GetLightDirection() const { return light...
#include "ShadowsSubrender.hpp" #include "Models/Vertex3d.hpp" #include "Scenes/Scenes.hpp" #include "ShadowRender.hpp" #include "Shadows.hpp" namespace acid { ShadowsSubrender::ShadowsSubrender(const Pipeline::Stage &pipelineStage) : Subrender(pipelineStage), pipeline(pipelineStage, {"Shaders/Shadows/Shadow.vert",...
#pragma once #include "Graphics/Subrender.hpp" #include "Graphics/Pipelines/PipelineGraphics.hpp" namespace acid { class ACID_EXPORT ShadowsSubrender : public Subrender { public: explicit ShadowsSubrender(const Pipeline::Stage &pipelineStage); void Render(const CommandBuffer &commandBuffer) override; private: Pi...
#include "SkyboxMaterial.hpp" #include "Scenes/Scenes.hpp" namespace acid { SkyboxMaterial::SkyboxMaterial(std::shared_ptr<ImageCube> image, const Colour &baseColour) : image(std::move(image)), baseColour(baseColour), blend(1.0f), fogLimits(-10000.0f) { } void SkyboxMaterial::CreatePipeline(const Shader::VertexI...
#pragma once #include "Materials/Material.hpp" #include "Maths/Colour.hpp" #include "Maths/Vector2.hpp" #include "Graphics/Images/ImageCube.hpp" namespace acid { /** * @brief Class that represents a skybox material shader. */ class ACID_EXPORT SkyboxMaterial : public Material::Registrar<SkyboxMaterial> { inline st...
#include "Timers.hpp" namespace acid { Timers::Timers() { std::unique_lock<std::mutex> lock(mutex); worker = std::thread(std::bind(&Timers::ThreadRun, this)); } Timers::~Timers() { stop = true; condition.notify_all(); worker.join(); } void Timers::Update() { } void Timers::ThreadRun() { std::unique_lock<std:...
#pragma once #include <atomic> #include <condition_variable> #include <mutex> #include <thread> #include <rocket.hpp> #include "Engine/Engine.hpp" #include "Maths/Time.hpp" namespace acid { class ACID_EXPORT Timer { friend class Timers; public: Timer(const Time &interval, const std::optional<uint32_t> &repeat) : ...
#include "UiObject.hpp" #include "Graphics/Graphics.hpp" #include "Uis/Drivers/ConstantDriver.hpp" #include "Uis.hpp" namespace acid { UiObject::UiObject() : alphaDriver(std::make_unique<ConstantDriver<float>>(1.0f)), scaleDriver(std::make_unique<ConstantDriver<Vector2f>>(Vector3f(1.0f))), screenDepth(0.0f), scre...
#pragma once #include "Devices/Windows.hpp" #include "Maths/Vector2.hpp" #include "Maths/Vector4.hpp" #include "Maths/Transform.hpp" #include "Constraints/UiConstraints.hpp" #include "Drivers/UiDriver.hpp" namespace acid { /** * @brief A representation of a object this is rendered to a screen. This object is contain...
#include "UiPanel.hpp" #include "Inputs/UiButtonInput.hpp" #include "Drivers/ConstantDriver.hpp" namespace acid { constexpr static Vector2i RESIZE_SIZE(16, 16); constexpr static Vector2i PADDING(16, 16); UiPanel::UiPanel() { //background.SetTransform({UiMargins::All}); background.SetImage(Image2d::Create("Guis/Whi...
#pragma once #include "Guis/Gui.hpp" #include "Inputs/UiButtonInput.hpp" #include "UiObject.hpp" #include "UiScrollBar.hpp" namespace acid { enum class UiManipulate { None = 0, Resize = 1, Move = 2, All = Resize | Move }; ENABLE_BITMASK_OPERATORS(UiManipulate) class ACID_EXPORT UiPanel : public UiObject { public...
#include "Uis.hpp" #include "Constraints/PixelConstraint.hpp" namespace acid { Uis::Uis() { canvas.GetConstraints().SetWidth<PixelConstraint>(0) .SetHeight<PixelConstraint>(0); for (auto button : magic_enum::enum_values<MouseButton>()) selectors.emplace(button, SelectorMouse()); } void Uis::Update() { for (au...
#pragma once #include "Engine/Engine.hpp" #include "Devices/Windows.hpp" #include "UiObject.hpp" namespace acid { /** * @brief Module used for managing gui textures in a container. */ class ACID_EXPORT Uis : public Module::Registrar<Uis> { inline static const bool Registered = Register(Stage::Normal); public: Uis...
#include "UiScrollBar.hpp" #include "Inputs/UiButtonInput.hpp" #include "Drivers/ConstantDriver.hpp" #include "Drivers/SlideDriver.hpp" #include "Uis.hpp" namespace acid { UiScrollBar::UiScrollBar() { //background.SetTransform({UiMargins::All}); background.SetImage(Image2d::Create("Guis/White.png")); background.Se...
#pragma once #include "Guis/Gui.hpp" #include "Uis/UiObject.hpp" namespace acid { enum class ScrollBar { None = 0, Vertical = 1, Horizontal = 2, Both = Vertical | Horizontal }; ENABLE_BITMASK_OPERATORS(ScrollBar) class ACID_EXPORT UiScrollBar : public UiObject { public: UiScrollBar(); void UpdateObject() over...
#include "UiSection.hpp" #include "Uis/Uis.hpp" namespace acid { UiSection::UiSection() { icon.SetImage(Image2d::Create("Guis/Triangle_Down.png")); UiObject::AddChild(&icon); title.SetFontType(FontType::Create("Fonts/ProximaNova-Regular.ttf")); title.SetTextColour(Colour::White); UiObject::AddChild(&title); ...
#pragma once #include "Fonts/Text.hpp" #include "Guis/Gui.hpp" #include "Uis/UiObject.hpp" namespace acid { class ACID_EXPORT UiSection : public UiObject { public: UiSection(); void UpdateObject() override; void AddChild(UiObject *child) override; const std::string &GetTitle() const { return title.GetString();...
#include "UiStartLogo.hpp" #include "Constraints/PixelConstraint.hpp" #include "Constraints/RatioConstraint.hpp" #include "Drivers/SlideDriver.hpp" #include "Timers/Timers.hpp" namespace acid { UiStartLogo::UiStartLogo() { //background.SetTransform({UiMargins::All}); background.SetImage(Image2d::Create("Guis/Black....
#pragma once #include "Fonts/Text.hpp" #include "Guis/Gui.hpp" namespace acid { class ACID_EXPORT UiStartLogo : public UiObject { public: explicit UiStartLogo(); void UpdateObject() override; bool IsFinished() const { return finished; } rocket::signal<void()> &OnFinished() { return onFinished; } #ifdef ACID_DE...
#pragma once #include "UiConstraints.hpp" namespace acid { /** * @brief Sets the width or height of a rectangle to best fit inside of the parents constraints. * @tparam Type The constraint enum type. */ template<UiConstraintType Type, typename = std::enable_if_t<Type == UiConstraintType::Width || Type == UiConstr...
#pragma once #include "UiAnchor.hpp" #include "UiConstraints.hpp" namespace acid { /** * @brief Applied away from a vertex of the parent constraint (default: left top). * @tparam Type The constraint enum type. */ template<UiConstraintType Type, typename = void> class PixelConstraint final : public UiConstraint<Typ...
#pragma once #include <cassert> #include "UiConstraints.hpp" namespace acid { /** * @brief Sets the width or height of a rectangle to a ratio of the opposite sides value. * @tparam Type The constraint enum type. */ template<UiConstraintType Type, typename = std::enable_if_t<Type == UiConstraintType::Width || Typ...
#pragma once #include <algorithm> #include "UiAnchor.hpp" #include "UiConstraints.hpp" namespace acid { /** * @brief Position relative to a vertex of the parent (default: left top), or size as percentage of the parent. * @tparam Type The constraint enum type. */ template<UiConstraintType Type, typename = void> cl...
#include "UiAnchor.hpp" namespace acid { const UiAnchor UiAnchor::Zero(0.0f); const UiAnchor UiAnchor::Left(0.0f); const UiAnchor UiAnchor::Top(0.0f); const UiAnchor UiAnchor::Centre(0.5f); const UiAnchor UiAnchor::Right(1.0f); const UiAnchor UiAnchor::Bottom(1.0f); }
#pragma once #include "Export.hpp" namespace acid { class ACID_EXPORT UiAnchor { public: explicit constexpr UiAnchor(float value) : value(value) {} constexpr float Get() const { return value; } bool operator==(const UiAnchor &rhs) const { return value == rhs.value; } bool operator!=(const UiAnchor &rhs) con...
#pragma once #include <cstdint> namespace acid { class UiConstraints; enum class UiConstraintType { X, Y, Width, Height }; template<UiConstraintType Type> class UiConstraint { public: virtual ~UiConstraint() = default; bool Update(const UiConstraints *object, const UiConstraints *parent) { auto last = current...
#include "UiConstraints.hpp" #include "PixelConstraint.hpp" #include "RelativeConstraint.hpp" namespace acid { UiConstraints::UiConstraints() { SetX<PixelConstraint>(0); SetY<PixelConstraint>(0); SetWidth<RelativeConstraint>(1.0f); SetHeight<RelativeConstraint>(1.0f); } bool UiConstraints::Update(const UiConstra...
#pragma once #include <memory> #include "Utils/NonCopyable.hpp" #include "UiConstraint.hpp" namespace acid { class ACID_EXPORT UiConstraints final : NonCopyable{ public: UiConstraints(); bool Update(const UiConstraints *parent); UiConstraint<UiConstraintType::X> *GetX() const { return x.get(); } UiConstraint<U...
#pragma once #include "Maths/Maths.hpp" #include "UiDriver.hpp" namespace acid { /** * @brief A bounce driver that uses a sine wave. * @tparam T The type to be driven. */ template<typename T> class BounceDriver : public UiDriver<T> { public: /** * Creates a new sine wave driver. * @param start The start value...
#pragma once #include "UiDriver.hpp" namespace acid { /** * @brief A driver that has a constant value. * @tparam T The type to be driven. */ template<typename T> class ConstantDriver : public UiDriver<T> { public: /** * Creates a new constant driver. * @param constant The constant value. */ explicit Const...
#pragma once #include "UiDriver.hpp" namespace acid { /** * @brief A driver that fades from start to end. * @tparam T The type to be driven. */ template<typename T> class FadeDriver : public UiDriver<T> { public: /** * Creates a new fade driver. * @param start The fade start interval (0.0-1.0). * @param end...
#pragma once #include "UiDriver.hpp" namespace acid { /** * @brief A driver that linearly increases its value. * @tparam T The type to be driven. */ template<typename T> class LinearDriver : public UiDriver<T> { public: /** * Creates a new linear driver. * @param start The start value. * @param end The end ...
#pragma once #include "Maths/Maths.hpp" #include "UiDriver.hpp" namespace acid { /** * @brief A driver that uses a sine wave. * @tparam T The type to be driven. */ template<typename T> class SinewaveDriver : public UiDriver<T> { public: /** * Creates a new sine wave driver. * @param min The min value. * @pa...
#pragma once #include "UiDriver.hpp" namespace acid { /** * @brief A driver that slides to its destination using cosine interpolation. * @tparam T The type to be driven. */ template<typename T> class SlideDriver : public UiDriver<T> { public: /** * Creates a new slide driver. * @param start The start value. ...
#pragma once #include <cmath> #include "Maths/Time.hpp" namespace acid { /** * @brief Represents a driver that changes over time. * @tparam T The type to be driven. */ template<typename T> class UiDriver { public: /** * Creates a new driver with a length. * @param length The drivers length. */ explicit Ui...
#include "UiBooleanInput.hpp" #include "Uis/Drivers/ConstantDriver.hpp" #include "Uis/Drivers/SlideDriver.hpp" #include "Uis/Uis.hpp" namespace acid { UiBooleanInput::UiBooleanInput() { //slider.SetTransform({UiMargins::All}); slider.SetImage(Image2d::Create("Guis/Button_Filled.png")); slider.SetNinePatches({0.125...
#pragma once #include "Fonts/Text.hpp" #include "Guis/Gui.hpp" #include "Uis/UiObject.hpp" #include "UiButtonInput.hpp" namespace acid { class ACID_EXPORT UiBooleanInput : public UiObject { public: UiBooleanInput(); void UpdateObject() override; const std::string &GetTitle() const { return textTitle.GetString();...
#include "UiButtonInput.hpp" #include "Uis/Drivers/ConstantDriver.hpp" #include "Uis/Drivers/SlideDriver.hpp" #include "Uis/Uis.hpp" namespace acid { UiButtonInput::UiButtonInput() { //background.SetTransform({UiMargins::All}); background.SetImage(Image2d::Create("Guis/Button_Filled.png")); background.SetNinePatch...
#pragma once #include "Fonts/Text.hpp" #include "Guis/Gui.hpp" #include "Uis/UiObject.hpp" namespace acid { class ACID_EXPORT UiButtonInput : public UiObject { public: UiButtonInput(); void UpdateObject() override; const std::string &GetTitle() const { return title.GetString(); } void SetTitle(const std::str...
#include "UiDropdownInput.hpp" #include "Uis/Drivers/ConstantDriver.hpp" #include "Uis/Drivers/SlideDriver.hpp" #include "Uis/Uis.hpp" namespace acid { UiDropdownInput::UiDropdownInput() { //slider.SetTransform({{0.5f, 0.0f}, UiAnchor::TopCentre, UiAspect::Position | UiAspect::Scale}); //slider.SetImage(Image2d::Cr...
#pragma once #include "Fonts/Text.hpp" #include "Guis/Gui.hpp" #include "Uis/UiObject.hpp" #include "UiButtonInput.hpp" namespace acid { class ACID_EXPORT UiDropdownInput : public UiObject { public: UiDropdownInput(); void UpdateObject() override; const std::string &GetTitle() const { return textTitle.GetString(...
#include "UiGrabberInput.hpp" #include "Uis/Drivers/ConstantDriver.hpp" #include "Uis/Drivers/SlideDriver.hpp" #include "Uis/Uis.hpp" namespace acid { UiGrabberInput::UiGrabberInput() { //background.SetTransform({UiMargins::All}); background.SetImage(Image2d::Create("Guis/Button.png")); background.SetNinePatches(V...
#pragma once #include "Devices/Joysticks.hpp" #include "Devices/Windows.hpp" #include "Fonts/Text.hpp" #include "Guis/Gui.hpp" #include "Uis/UiObject.hpp" #include "UiButtonInput.hpp" namespace acid { class ACID_EXPORT UiGrabberInput : public UiObject { public: UiGrabberInput(); void UpdateObject() override; con...
#include "UiRadioInput.hpp" #include "Uis/Drivers/ConstantDriver.hpp" #include "Uis/Drivers/SlideDriver.hpp" #include "Uis/Uis.hpp" namespace acid { UiRadioInput::UiRadioInput() { //background.SetTransform({{24, 24}, UiAnchor::LeftCentre}); background.SetImage(Image2d::Create("Guis/Radio.png")); background.SetNine...
#pragma once #include "Fonts/Text.hpp" #include "Guis/Gui.hpp" #include "Uis/UiObject.hpp" #include "UiButtonInput.hpp" namespace acid { class ACID_EXPORT UiRadioInput : public UiObject { public: enum class Type { Filled, X, Dot, Check }; UiRadioInput(); void UpdateObject() override; const std::string &GetT...
#include "UiSliderInput.hpp" #include "Uis/Drivers/SlideDriver.hpp" #include "Uis/Drivers/ConstantDriver.hpp" #include "Uis/Uis.hpp" namespace acid { UiSliderInput::UiSliderInput() { //slider.SetTransform( {UiMargins::All}); slider.SetImage(Image2d::Create("Guis/Button_Filled.png")); slider.SetNinePatches({0.125f,...
#pragma once #include "Fonts/Text.hpp" #include "Guis/Gui.hpp" #include "Uis/UiObject.hpp" #include "UiButtonInput.hpp" namespace acid { class ACID_EXPORT UiSliderInput : public UiObject { public: UiSliderInput(); void UpdateObject() override; float GetValueMin() const { return valueMin; } void SetValueMin(floa...
#include "UiTextInput.hpp" #include "Uis/Drivers/ConstantDriver.hpp" #include "Uis/Drivers/SlideDriver.hpp" #include "Uis/Uis.hpp" namespace acid { UiTextInput::UiTextInput() { //background.SetTransform({UiMargins::All}); background.SetImage(Image2d::Create("Guis/Button.png")); background.SetNinePatches({0.125f, 0...
#pragma once #include "Fonts/Text.hpp" #include "Guis/Gui.hpp" #include "Uis/UiObject.hpp" #include "Inputs/InputDelay.hpp" #include "UiButtonInput.hpp" namespace acid { class ACID_EXPORT UiTextInput : public UiObject { public: UiTextInput(); void UpdateObject() override; const std::string &GetTitle() const { re...
#pragma once #include <optional> #include <utility> #include <vector> #include <map> #include <memory> namespace acid { template<typename T> struct is_optional : std::false_type { }; template<typename T> struct is_optional<std::optional<T>> : std::true_type { }; template<typename T> inline constexpr bool is_optiona...
#pragma once #include <iterator> #include <tuple> namespace acid { /** * http://reedbeta.com/blog/python-like-enumerate-in-cpp17/ */ template<typename T, typename TIter = decltype(std::begin(std::declval<T>())), typename = decltype(std::end(std::declval<T>()))> constexpr auto Enumerate(T &&iterable) { struct it...
#pragma once #include <bitmask/bitmask.hpp> #include "Filesystem/Serial/Node.hpp" namespace acid { template<typename E, typename = std::enable_if_t<std::is_enum_v<std::remove_reference_t<E>>>> class EnumValue { public: constexpr EnumValue(const E &value = {}) : value(value) {} template<typename E1 = E, typename = ...
#pragma once #include <functional> #include <iomanip> #include <unordered_map> #include "Engine/Log.hpp" namespace acid { template<typename Base, class... Args> class Factory { public: using TCreateReturn = std::unique_ptr<Base>; using TCreateMethod = std::function<TCreateReturn(Args...)>; using TRegistryMap = s...
#pragma once #include <future> #include <optional> namespace acid { /** * @brief Class that holds a future and it's value that will update as future gets new valid values. * @tparam T The type to hold. */ template<typename T> class Future { public: Future() noexcept = default; Future(std::future<T> &&future) no...
#pragma once #include "Export.hpp" namespace acid { /** * @brief Class that removes the copy constructor and operator from derived classes, while leaving move. */ class ACID_EXPORT NonCopyable { protected: NonCopyable() = default; virtual ~NonCopyable() = default; public: NonCopyable(const NonCopyable &) = dele...
#pragma once #include <stdexcept> #include <vector> #include "NonCopyable.hpp" namespace acid { /** * @brief A constant-sized non-overwriting circular queue. * @tparam T The type to hold. */ template<typename T> class RingBuffer : NonCopyable { public: explicit RingBuffer(std::size_t capacity) : data(capacity)...
#pragma once #include <functional> #include <iomanip> #include "Engine/Log.hpp" #include "Files/Node.hpp" #include "TypeInfo.hpp" namespace acid { template<typename Base, class... Args> class StreamFactory { public: using TCreateReturn = std::unique_ptr<Base>; using TCreateMethod = std::function<TCreateReturn(Arg...
#include "String.hpp" #include <codecvt> #include <locale> #include <algorithm> namespace acid { std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>, wchar_t> UTF8_TO_UTF16_CONVERTER; std::string String::ConvertUtf8(const std::wstring_view &string) { return UTF8_TO_UTF16_CONVERTER.to_bytes(string.data(), string.d...
#pragma once #include <string> #include <vector> #include <optional> #include <sstream> #include "Export.hpp" #include "ConstExpr.hpp" namespace acid { /** * @brief Helper class for C++ strings. */ class ACID_EXPORT String { public: String() = delete; /** * Converts a CTF16 (wide) string to a UTF8 string. ...
#include "ThreadPool.hpp" namespace acid { ThreadPool::ThreadPool(uint32_t threadCount) { workers.reserve(threadCount); for (std::size_t i = 0; i < threadCount; ++i) { workers.emplace_back([this] { while (true) { std::function<void()> task; { std::unique_lock<std::mutex> lock(queueMutex); co...
#pragma once #include <thread> #include <vector> #include <functional> #include <mutex> #include <queue> #include <future> #include "Export.hpp" namespace acid { /** * @brief A fixed size pool of threads. */ class ACID_EXPORT ThreadPool { public: explicit ThreadPool(uint32_t threadCount = std::thread::hardware_co...
#pragma once #include <typeindex> #include <unordered_map> namespace acid { using TypeId = std::size_t; template<typename T> class TypeInfo { public: TypeInfo() = delete; /** * Get the type ID of K which is a base of T. * @tparam K The type ID K. * @return The type ID. */ template<typename K, typename ...
#include "EditorRenderer.hpp" #include <Fonts/FontsSubrender.hpp> #include <Gizmos/GizmosSubrender.hpp> #include <Guis/GuisSubrender.hpp> #include <Meshes/MeshesSubrender.hpp> #include <Models/Shapes/SphereModel.hpp> #include <Particles/ParticlesSubrender.hpp> #include <Post/Deferred/DeferredSubrender.hpp> #include <P...