text stringlengths 1 24.5M |
|---|
/*
MP3 audio decoder. Choice of public domain or MIT-0. See license statements at the end of this file.
dr_mp3 - v0.6.20 - 2020-11-21
David Reid - mackron@gmail.com
GitHub: https://github.com/mackron/dr_libs
Based on minimp3 (https://github.com/lieff/minimp3) which is where the real work was done. See the bottom of ... |
#include "dr_opus.h"
#include <stdlib.h>
#include <string.h>
#ifndef DR_OPUS_NO_STDIO
#include <stdio.h>
#include <wchar.h> /* For wcslen(), wcsrtombs() */
#endif
/* CPU Architecture. */
#if defined(__x86_64__) || defined(_M_X64)
#define DROPUS_X64
#elif defined(__i386) || defined(_M_IX86)
#define DROPUS... |
/*
Opus audio decoder. Choice of public domain or MIT-0. See license statements at the end of this file.
dr_opus - v0.0.0 (Unreleased) - xxxx-xx-xx
David Reid - mackron@gmail.com
*/
/* ====== WORK-IN-PROGRESSS ====== */
#ifndef dr_opus_h
#define dr_opus_h
#include <stddef.h> /* For size_t. */
/* Sized types. Prefe... |
#include "dr_wav.h"
#ifndef dr_wav_c
#define dr_wav_c
#include <stdlib.h>
#include <string.h> /* For memcpy(), memset() */
#include <limits.h> /* For INT_MAX */
#ifndef DR_WAV_NO_STDIO
#include <stdio.h>
#include <wchar.h>
#endif
/* Standard library stuff. */
#ifndef DRWAV_ASSERT
#include <assert.h>
#define DRWAV_A... |
/*
WAV audio loader and writer. Choice of public domain or MIT-0. See license statements at the end of this file.
dr_wav - v0.12.15 - 2020-11-21
David Reid - mackron@gmail.com
GitHub: https://github.com/mackron/dr_libs
*/
/*
RELEASE NOTES - VERSION 0.12
============================
Version 0.12 includes breaking cha... |
// MIT License
//
// Copyright(c) 2020 Jordan Peck (jordan.me2@gmail.com)
// Copyright(c) 2020 Contributors
//
// 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... |
//==============================================================================================================================
//
// [A] SHADER PORTABILITY 1.20210629
//
//====================================================================================================... |
//_____________________________________________________________/\_______________________________________________________________
//==============================================================================================================================
//
//
// AMD FidelityFX SUPER RESOLUTION [F... |
// jpgd.cpp - C++ class for JPEG decompression. Written by Richard Geldreich <richgel99@gmail.com> between 1994-2020.
// Supports progressive and baseline sequential JPEG image files, and the most common chroma subsampling factors: Y, H1V1, H2V1, H1V2, and H2V2.
// Supports box and linear chroma upsampling.
//
// Relea... |
// jpgd.h - C++ class for JPEG decompression.
// Richard Geldreich <richgel99@gmail.com>
// See jpgd.cpp for license (Public Domain or Apache 2.0).
#ifndef JPEG_DECODER_H
#define JPEG_DECODER_H
#include <stdlib.h>
#include <stdio.h>
#include <setjmp.h>
#include <assert.h>
#include <stdint.h>
#ifdef _MSC_VER
#define J... |
// Copyright 2009 Intel Corporation
// All Rights Reserved
//
// Permission is granted to use, copy, distribute and prepare derivative works of this
// software for any purpose and without fee, provided, that the above copyright notice
// and this statement appear in all copies. Intel makes no representations about th... |
/* SPDX-License-Identifier: (BSD-2-Clause AND libpng-2.0) */
#define SPNG__BUILD
#include "spng.h"
#include <limits.h>
#include <string.h>
#include <stdio.h>
#include <math.h>
#define SPNG_USE_MINIZ
#define ZLIB_CONST
#ifdef __FRAMAC__
#define SPNG_DISABLE_OPT
#include "tests/framac_stubs.h"
#else
#ifd... |
/* SPDX-License-Identifier: (BSD-2-Clause AND libpng-2.0) */
#ifndef SPNG_H
#define SPNG_H
#ifdef __cplusplus
extern "C" {
#endif
#if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(SPNG_STATIC)
#if defined(SPNG__BUILD)
#define SPNG_API __declspec(dllexport)
#else
#define SPNG_API __decls... |
// __ __ _ ______ _____
// | \/ | (_) | ____| / ____|_ _
// | \ / | __ _ __ _ _ ___ | |__ _ __ _ _ _ __ ___ | | _| |_ _| |_
// | |\/| |/ _` |/ _` | |/ __| | __| | '_ \| | | | '_ ` _ \ | | |_ _|_ _|
// | | | |... |
#include "miniz.h"
/**************************************************************************
*
* Copyright 2013-2014 RAD Game Tools and Valve Software
* Copyright 2010-2014 Rich Geldreich and Tenacious Software LLC
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining ... |
#define MINIZ_EXPORT
/* miniz.c 2.1.0 - public domain deflate/inflate, zlib-subset, ZIP reading/writing/appending, PNG writing
See "unlicense" statement at the end of this file.
Rich Geldreich <richgel99@gmail.com>, last updated Oct. 13, 2013
Implements RFC 1950: http://www.ietf.org/rfc/rfc1950.txt and RFC 195... |
/***********************************************************************************
* rocket - lightweight & fast signal/slots & utility library *
* *
* v2.0 - public domain ... |
#include "stb_image.h"
#if defined(STBI_ONLY_JPEG) || defined(STBI_ONLY_PNG) || defined(STBI_ONLY_BMP) \
|| defined(STBI_ONLY_TGA) || defined(STBI_ONLY_GIF) || defined(STBI_ONLY_PSD) \
|| defined(STBI_ONLY_HDR) || defined(STBI_ONLY_PIC) || defined(STBI_ONLY_PNM) \
|| defined(STBI_ONLY_ZLIB)
#ifndef STBI_ONLY_... |
/* stb_image - v2.26 - public domain image loader - http://nothings.org/stb
no warranty implied; use at your own risk
Do this:
#define STB_IMAGE_IMPLEMENTATION
before you include this file in *one* C or C++ file to create the implementation.
// i.e. it should look like... |
#include "stb_image_write.h"
#ifdef _WIN32
#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#endif
#ifndef _CRT_NONSTDC_NO_DEPRECATE
#define _CRT_NONSTDC_NO_DEPRECATE
#endif
#endif
#ifndef STBI_WRITE_NO_STDIO
#include <stdio.h>
#endif // STBI_WRITE_NO_STDIO
#include <stdarg.h>
#inclu... |
/* stb_image_write - v1.15 - public domain - http://nothings.org/stb
writes out PNG/BMP/TGA/JPEG/HDR images to C stdio - Sean Barrett 2010-2015
no warranty implied; use at your own risk
Before #including,
#define STB_IMAGE_WRITE_IMPLEMENTATION
in the file that you... |
#include "stb_vorbis.h"
// global configuration settings (e.g. set these in the project/makefile),
// or just set them in this file at the top (although ideally the first few
// should be visible when the header file is compiled too, although it's not
// crucial)
// STB_VORBIS_NO_PUSHDATA_API
// does not compile ... |
// Ogg Vorbis audio decoder - v1.20 - public domain
// http://nothings.org/stb_vorbis/
//
// Original version written by Sean Barrett in 2007.
//
// Originally sponsored by RAD Game Tools. Seeking implementation
// sponsored by Phillip Bennefall, Marc Andersen, Aaron Baker,
// Elias Software, Aras Pranckevicius, and S... |
#include "tiny_dng.h"
#if defined(_WIN32)
#if defined(__MINGW32__)
#include <windows.h> // wchar apis
#else
#include <Windows.h>
#endif
#endif
#include <stdint.h> // for lj92
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iterator>
#include <map>
#include <sst... |
//
// TinyDNGLoader, single header only DNG/TIFF loader.
//
/*
The MIT License (MIT)
Copyright (c) 2016 - 2018 Syoyo Fujita and many contributors.
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... |
#include "tiny_exr.h"
#ifdef _WIN32
#ifndef NOMINMAX
#define NOMINMAX
#endif
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h> // for UTF-8
#endif
#include <algorithm>
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <sstream>
// #include <iostr... |
#ifndef TINYEXR_H_
#define TINYEXR_H_
/*
Copyright (c) 2014 - 2020, Syoyo Fujita and many contributors.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain th... |
/*
__ _____ _____ _____
__| | __| | | | JSON for Modern C++
| | |__ | | | | | | version 3.5.0
|_____|_____|_____|_|___| https://github.com/nlohmann/json
Licensed under the MIT License <http://opensource.org/licenses/MIT>.
SPDX-License-Identifier: MIT
Copyright (c) 2013-2018 Niels Lohmann <http:/... |
#include "tiny_gltf.h"
#include <algorithm>
//#include <cassert>
#ifndef TINYGLTF_NO_FS
#include <cstdio>
#include <fstream>
#endif
#include <sstream>
#ifdef __clang__
// Disable some warnings for external files.
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wfloat-equal"
#pragma clang diagnostic i... |
//
// Header-only tiny glTF 2.0 loader and serializer.
//
//
// The MIT License (MIT)
//
// Copyright (c) 2015 - 2020 Syoyo Fujita, Aurélien Chatelain and many
// contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the... |
#include "tiny_msdf.hpp"
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <stdexcept>
#include <ft2build.h>
#include <optional>
#include FT_FREETYPE_H
#include FT_OUTLINE_H
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
namespace tinymsdf {
class ArithmeticException : std:... |
/**
* Based on the C++ implementation by Viktor Chlumský.
* https://github.com/Chlumsky/msdfgen
*/
#pragma once
typedef struct FT_LibraryRec_ *FT_Library;
typedef struct FT_FaceRec_ *FT_Face;
namespace tinymsdf {
using unicode_t = unsigned;
/// A 2D image bitmap with N channels of type T.
template<typename T, in... |
#include "tiny_obj.h"
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstddef>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <limits>
#include <sstream>
#include <utility>
namespace tinyobj {
MaterialReader::~MaterialReader() {}
struct vertex_index_t {
int v_idx, vt_idx, vn_idx... |
/*
The MIT License (MIT)
Copyright (c) 2012-2018 Syoyo Fujita and many contributors.
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
t... |
/*
MIT License
Copyright (c) 2019 Kenneth Troldal Balslev
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 u... |
/*
MIT License
Copyright (c) 2019 Kenneth Troldal Balslev
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 u... |
/*
MIT License
Copyright (c) 2019 Kenneth Troldal Balslev
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 u... |
//
// Created by Troldal on 2019-03-13.
//
#ifndef ZIPPY_H
#define ZIPPY_H
#include "ZipArchive.hpp"
#include "ZipEntry.hpp"
#include "ZipException.hpp"
#endif //ZIPPY_H
|
//
// Created by Kenneth Balslev on 08/06/2020.
//
#ifndef ZIPPY_ZIPUTILITIES_HPP
#define ZIPPY_ZIPUTILITIES_HPP
namespace Zippy::Impl
{
/**
* @brief Generates a random filename, which is used to generate a temporary archive when modifying and saving
* archive files.
* @param length The length of ... |
#pragma once
#include "Animations/AnimatedMesh.hpp"
#include "Animations/Animation/Animation.hpp"
#include "Animations/Animation/AnimationLoader.hpp"
#include "Animations/Animation/JointTransform.hpp"
#include "Animations/Animation/Keyframe.hpp"
#include "Animations/Animator.hpp"
#include "Animations/Geometry/Geometry... |
#include "AnimatedMesh.hpp"
#include "Maths/Maths.hpp"
#include "Files/Xml/Xml.hpp"
#include "Files/File.hpp"
#include "Maths/Matrix4.hpp"
#include "Scenes/Entity.hpp"
#include "Animation/AnimationLoader.hpp"
#include "Skeleton/SkeletonLoader.hpp"
#include "Skin/SkinLoader.hpp"
#include "Geometry/GeometryLoader.hpp"
#... |
#pragma once
#include "Materials/Material.hpp"
#include "Models/Model.hpp"
#include "Scenes/Component.hpp"
#include "Graphics/Buffers/StorageHandler.hpp"
#include "Geometry/VertexAnimated.hpp"
#include "Animator.hpp"
namespace acid {
/**
* @brief Class that represents an animated armature with a skin mesh.
*/
class... |
#include "Animator.hpp"
#include "Engine/Engine.hpp"
#include "Utils/Enumerate.hpp"
namespace acid {
void Animator::Update(const Joint &rootJoint, std::vector<Matrix4> &jointMatrices) {
if (!currentAnimation) return;
IncreaseAnimationTime();
auto currentPose = CalculateCurrentAnimationPose();
CalculateJointPose(... |
#pragma once
#include "Maths/Time.hpp"
#include "Animation/Animation.hpp"
#include "Skeleton/Joint.hpp"
namespace acid {
/**
* @brief Class that contains all the functionality to apply an animation to an animated entity.
* An Animator instance is associated with just one animated entity.
* It also keeps track of t... |
#include "Animation.hpp"
namespace acid {
Animation::Animation(const Time &length, std::vector<Keyframe> keyframes) :
length(length),
keyframes(std::move(keyframes)) {
}
const Node &operator>>(const Node &node, Animation &animation) {
node["length"].Get(animation.length);
node["keyframes"].Get(animation.keyframes... |
#pragma once
#include "Maths/Time.hpp"
#include "Keyframe.hpp"
namespace acid {
/**
* @brief Class that represents an animation that can be carried out by an animated entity.
* It contains the length of the animation in seconds, and a list of {@link Keyframe}s.
*/
class ACID_EXPORT Animation {
public:
/**
* Cre... |
#include "AnimationLoader.hpp"
#include "Animations/AnimatedMesh.hpp"
#include "Utils/Enumerate.hpp"
namespace acid {
AnimationLoader::AnimationLoader(NodeConstView &&libraryAnimations, NodeConstView &&libraryVisualScenes, const Matrix4 &correction) :
libraryAnimations(std::move(libraryAnimations)),
libraryVisualSc... |
#pragma once
#include "Maths/Matrix4.hpp"
#include "Files/Node.hpp"
#include "Animation.hpp"
namespace acid {
class ACID_EXPORT AnimationLoader {
public:
AnimationLoader(NodeConstView &&libraryAnimations, NodeConstView &&libraryVisualScenes, const Matrix4 &correction);
const Time &GetLengthSeconds() const { return... |
#include "JointTransform.hpp"
namespace acid {
JointTransform::JointTransform(const Vector3f &position, const Quaternion &rotation) :
position(position),
rotation(rotation) {
}
JointTransform::JointTransform(const Matrix4 &localTransform) :
position(localTransform[3]),
rotation(localTransform) {
}
Matrix4 JointT... |
#pragma once
#include "Maths/Quaternion.hpp"
namespace acid {
/**
* @brief Class that represents the local bone-space transform of a joint at a certain keyframe during an animation.
* This includes the position and rotation of the joint, relative to the parent joint (or relative to the model's origin if it's the ro... |
#include "Keyframe.hpp"
namespace acid {
Keyframe::Keyframe(const Time &timeStamp, std::map<std::string, JointTransform> pose) :
timeStamp(timeStamp),
pose(std::move(pose)) {
}
void Keyframe::AddJointTransform(const std::string &jointNameId, const Matrix4 &jointLocalTransform) {
pose.emplace(jointNameId, jointLoca... |
#pragma once
#include "Maths/Time.hpp"
#include "JointTransform.hpp"
namespace acid {
/**
* @brief Class that represents one keyframe of an animation. This contains the timestamp of the keyframe,
* which is the time (in seconds) from the start of the animation when this keyframe occurs.
*
* It also contains the d... |
#include "GeometryLoader.hpp"
#include "Animations/AnimatedMesh.hpp"
namespace acid {
GeometryLoader::GeometryLoader(NodeConstView &&libraryGeometries, std::vector<VertexWeights> vertexWeights, const Matrix4 &correction) :
meshData(libraryGeometries["geometry"]["mesh"]),
vertexWeights(std::move(vertexWeights)),
co... |
#pragma once
#include "Maths/Matrix4.hpp"
#include "Maths/Vector3.hpp"
#include "Utils/NonCopyable.hpp"
#include "Animations/Skin/VertexWeights.hpp"
#include "VertexAnimated.hpp"
namespace acid {
class ACID_EXPORT GeometryLoader : NonCopyable {
public:
GeometryLoader(NodeConstView &&libraryGeometries, std::vector<Ve... |
#pragma once
#include "Maths/Vector2.hpp"
#include "Maths/Vector3.hpp"
#include "Graphics/Pipelines/Shader.hpp"
namespace acid {
class ACID_EXPORT VertexAnimated {
public:
VertexAnimated() = default;
VertexAnimated(const Vector3f &position, const Vector2f &uv, const Vector3f &normal, const Vector3ui &jointId, cons... |
#include "Joint.hpp"
namespace acid {
Joint::Joint(uint32_t index, std::string name, const Matrix4 &bindLocalTransform) :
index(index),
name(std::move(name)),
localBindTransform(bindLocalTransform) {
}
void Joint::CalculateInverseBindTransform(const Matrix4 &parentBindTransform) {
auto bindTransform = parentBindT... |
#pragma once
#include "Maths/Matrix4.hpp"
namespace acid {
/**
* @brief Class that represents a joint in a "skeleton". It contains the index of the joint which determines where in the vertex shader uniform array the joint matrix for this joint is loaded up to.
* It also contains the name of the bone, and a list of ... |
#include "SkeletonLoader.hpp"
#include "Animations/AnimatedMesh.hpp"
#include "Utils/Enumerate.hpp"
namespace acid {
SkeletonLoader::SkeletonLoader(NodeConstView &&libraryControllers, std::vector<std::string> boneOrder, const Matrix4 &correction) :
armatureData(libraryControllers["visual_scene"]["node"].GetPropertyW... |
#pragma once
#include "Files/Node.hpp"
#include "Joint.hpp"
namespace acid {
class ACID_EXPORT SkeletonLoader {
public:
SkeletonLoader(NodeConstView &&libraryControllers, std::vector<std::string> boneOrder, const Matrix4 &correction);
uint32_t GetJointCount() const { return jointCount; }
const Joint &GetHeadJoint... |
#include "SkinLoader.hpp"
#include "Utils/Enumerate.hpp"
namespace acid {
SkinLoader::SkinLoader(NodeConstView &&libraryControllers, uint32_t maxWeights) :
skinData(libraryControllers["controller"]["skin"]),
maxWeights(maxWeights) {
LoadJointsList();
auto weights = LoadWeights();
auto weightsDataNode = skinData[... |
#pragma once
#include "Files/Node.hpp"
#include "VertexWeights.hpp"
namespace acid {
class ACID_EXPORT SkinLoader {
public:
SkinLoader(NodeConstView &&libraryControllers, uint32_t maxWeights);
const std::vector<std::string> &GetJointOrder() const { return jointOrder; }
const std::vector<VertexWeights> &GetVertexW... |
#include "VertexWeights.hpp"
#include "Utils/Enumerate.hpp"
namespace acid {
void VertexWeights::AddJointEffect(uint32_t jointId, float jointWeight) {
for (auto &&[i, weight] : Enumerate(weights)) {
if (jointWeight > weight) {
jointIds[i] = jointId;
weight = jointWeight;
return;
}
}
jointIds.emplace_... |
#pragma once
#include <cstdint>
#include <vector>
#include "Export.hpp"
namespace acid {
class ACID_EXPORT VertexWeights {
public:
void AddJointEffect(uint32_t jointId, float jointWeight);
void LimitJointNumber(uint32_t max);
void FillEmptyWeights(uint32_t max);
float SaveTopWeights(std::vector<float> &topWeight... |
#include "Audio.hpp"
#include <iomanip>
#ifdef ACID_BUILD_MACOS
#include <OpenAL/al.h>
#include <OpenAL/alc.h>
#else
#include <al.h>
#include <alc.h>
#endif
#include "Scenes/Scenes.hpp"
namespace acid {
struct Audio::_intern {
ALCdevice *device = nullptr;
ALCcontext *context = nullptr;
};
Audio::Audio() :
impl(s... |
#pragma once
#include <rocket.hpp>
#include "Engine/Engine.hpp"
namespace acid {
/**
* @brief Module used for loading, managing and playing a variety of different sound types.
*/
class ACID_EXPORT Audio : public Module::Registrar<Audio> {
inline static const bool Registered = Register(Stage::Pre);
public:
enum c... |
#include "Sound.hpp"
#ifdef ACID_BUILD_MACOS
#include <OpenAL/al.h>
#else
#include <al.h>
#endif
#include "Maths/Transform.hpp"
#include "Scenes/Entity.hpp"
namespace acid {
Sound::Sound(const std::string &filename, const Audio::Type &type, bool begin, bool loop, float gain, float pitch) :
buffer(SoundBuffer::Create... |
#pragma once
#include "Maths/Vector3.hpp"
#include "Scenes/Component.hpp"
#include "SoundBuffer.hpp"
#include "Audio.hpp"
namespace acid {
/**
* @brief Class that represents a playable sound.
*/
class ACID_EXPORT Sound : public Component::Registrar<Sound> {
inline static const bool Registered = Register("sound"... |
#include "SoundBuffer.hpp"
#ifdef ACID_BUILD_MACOS
#include <OpenAL/al.h>
#else
#include <al.h>
#endif
#include "Files/Files.hpp"
#include "Resources/Resources.hpp"
namespace acid {
std::shared_ptr<SoundBuffer> SoundBuffer::Create(const Node &node) {
if (auto resource = Resources::Get()->Find<SoundBuffer>(node))
r... |
#pragma once
#include <unordered_map>
#include "Maths/Vector3.hpp"
#include "Resources/Resource.hpp"
#include "Audio.hpp"
namespace acid {
template<typename Base>
class SoundBufferFactory {
public:
using TLoadMethod = std::function<void(Base &, const std::filesystem::path &)>;
using TWriteMethod = std::function<vo... |
#include "FlacSoundBuffer.hpp"
#ifdef ACID_BUILD_MACOS
#include <OpenAL/al.h>
#else
#include <al.h>
#endif
#include <dr_flac.h>
#include "Files/Files.hpp"
#include "Maths/Time.hpp"
namespace acid {
void FlacSoundBuffer::Load(SoundBuffer &soundBuffer, const std::filesystem::path &filename) {
#ifdef ACID_DEBUG
auto d... |
#pragma once
#include "Audio/SoundBuffer.hpp"
namespace acid {
class ACID_EXPORT FlacSoundBuffer : public SoundBuffer::Registrar<FlacSoundBuffer> {
inline static const bool Registered = Register(".flac");
public:
static void Load(SoundBuffer &soundBuffer, const std::filesystem::path &filename);
static void Write(c... |
#include "Mp3SoundBuffer.hpp"
#ifdef ACID_BUILD_MACOS
#include <OpenAL/al.h>
#else
#include <al.h>
#endif
#include <dr_mp3.h>
#include "Files/Files.hpp"
#include "Maths/Time.hpp"
namespace acid {
void Mp3SoundBuffer::Load(SoundBuffer &soundBuffer, const std::filesystem::path &filename) {
#ifdef ACID_DEBUG
auto debu... |
#pragma once
#include "Audio/SoundBuffer.hpp"
namespace acid {
class ACID_EXPORT Mp3SoundBuffer : public SoundBuffer::Registrar<Mp3SoundBuffer> {
inline static const bool Registered = Register(".mp3");
public:
static void Load(SoundBuffer &soundBuffer, const std::filesystem::path &filename);
static void Write(cons... |
#include "OggSoundBuffer.hpp"
#ifdef ACID_BUILD_MACOS
#include <OpenAL/al.h>
#else
#include <al.h>
#endif
#include <stb_vorbis.h>
#include "Files/Files.hpp"
#include "Maths/Time.hpp"
namespace acid {
void OggSoundBuffer::Load(SoundBuffer &soundBuffer, const std::filesystem::path &filename) {
#ifdef ACID_DEBUG
auto ... |
#pragma once
#include "Audio/SoundBuffer.hpp"
namespace acid {
class ACID_EXPORT OggSoundBuffer : public SoundBuffer::Registrar<OggSoundBuffer> {
inline static const bool Registered = Register(".ogg");
public:
static void Load(SoundBuffer &soundBuffer, const std::filesystem::path &filename);
static void Write(cons... |
#include "OpusSoundBuffer.hpp"
#ifdef ACID_BUILD_MACOS
#include <OpenAL/al.h>
#else
#include <al.h>
#endif
#include <dr_opus.h>
#include "Files/Files.hpp"
#include "Maths/Time.hpp"
namespace acid {
void OpusSoundBuffer::Load(SoundBuffer &soundBuffer, const std::filesystem::path &filename) {
#ifdef ACID_DEBUG
auto d... |
#pragma once
#include "Audio/SoundBuffer.hpp"
namespace acid {
class ACID_EXPORT OpusSoundBuffer : public SoundBuffer::Registrar<OpusSoundBuffer> {
inline static const bool Registered = Register(".opus");
public:
static void Load(SoundBuffer &soundBuffer, const std::filesystem::path &filename);
static void Write(c... |
#include "WaveSoundBuffer.hpp"
#ifdef ACID_BUILD_MACOS
#include <OpenAL/al.h>
#else
#include <al.h>
#endif
#include <dr_wav.h>
#include "Files/Files.hpp"
#include "Maths/Time.hpp"
namespace acid {
void WaveSoundBuffer::Load(SoundBuffer &soundBuffer, const std::filesystem::path &filename) {
#ifdef ACID_DEBUG
auto de... |
#pragma once
#include "Audio/SoundBuffer.hpp"
namespace acid {
class ACID_EXPORT WaveSoundBuffer : public SoundBuffer::Registrar<WaveSoundBuffer> {
inline static const bool Registered = Register(".wav", ".wave");
public:
static void Load(SoundBuffer &soundBuffer, const std::filesystem::path &filename);
static void... |
#include "Bitmap.hpp"
#include <stb_image.h>
#include <stb_image_write.h>
#include "Engine/Log.hpp"
#include "Files/Files.hpp"
namespace acid {
Bitmap::Bitmap(std::filesystem::path filename) :
filename(std::move(filename)) {
Load(this->filename);
}
Bitmap::Bitmap(const Vector2ui &size, uint32_t bytesPerPixel) :
... |
#pragma once
#include <unordered_map>
#include <functional>
#include "Maths/Vector2.hpp"
namespace acid {
template<typename Base>
class BitmapFactory {
public:
using TLoadMethod = std::function<void(Base &, const std::filesystem::path &)>;
using TWriteMethod = std::function<void(const Base &, const std::filesystem... |
#include "DngBitmap.hpp"
#include <cstring>
#include <tiny_dng.h>
#include "Files/Files.hpp"
#include "Maths/Time.hpp"
namespace acid {
void DngBitmap::Load(Bitmap &bitmap, const std::filesystem::path &filename) {
#ifdef ACID_DEBUG
auto debugStart = Time::Now();
#endif
auto fileLoaded = Files::Read(filename);
... |
#pragma once
#include "Bitmaps/Bitmap.hpp"
namespace acid {
class ACID_EXPORT DngBitmap : public Bitmap::Registrar<DngBitmap> {
inline static const bool Registered = Register(".dng", ".tiff");
public:
static void Load(Bitmap &bitmap, const std::filesystem::path &filename);
static void Write(const Bitmap &bitmap, c... |
#include "ExrBitmap.hpp"
#include <cstring>
#include <tiny_exr.h>
#include "Files/Files.hpp"
#include "Maths/Time.hpp"
namespace acid {
void ExrBitmap::Load(Bitmap &bitmap, const std::filesystem::path &filename) {
#ifdef ACID_DEBUG
auto debugStart = Time::Now();
#endif
auto fileLoaded = Files::Read(filename);
... |
#pragma once
#include "Bitmaps/Bitmap.hpp"
namespace acid {
class ACID_EXPORT ExrBitmap : public Bitmap::Registrar<ExrBitmap> {
inline static const bool Registered = Register(".exr");
public:
static void Load(Bitmap &bitmap, const std::filesystem::path &filename);
static void Write(const Bitmap &bitmap, const std:... |
#include "JpgBitmap.hpp"
#include <cstring>
#include <jpgd.h>
#include "Files/Files.hpp"
#include "Maths/Time.hpp"
namespace acid {
void JpgBitmap::Load(Bitmap &bitmap, const std::filesystem::path &filename) {
#ifdef ACID_DEBUG
auto debugStart = Time::Now();
#endif
auto fileLoaded = Files::Read(filename);
if (... |
#pragma once
#include "Bitmaps/Bitmap.hpp"
namespace acid {
class ACID_EXPORT JpgBitmap : public Bitmap::Registrar<JpgBitmap> {
inline static const bool Registered = Register(".jpg", ".jpeg");
public:
static void Load(Bitmap &bitmap, const std::filesystem::path &filename);
static void Write(const Bitmap &bitmap, c... |
#include "PngBitmap.hpp"
#include <cstring>
#include <spng.h>
#include "Files/Files.hpp"
#include "Maths/Time.hpp"
namespace acid {
void PngBitmap::Load(Bitmap &bitmap, const std::filesystem::path &filename) {
#ifdef ACID_DEBUG
auto debugStart = Time::Now();
#endif
auto fileLoaded = Files::Read(filename);
if (... |
#pragma once
#include "Bitmaps/Bitmap.hpp"
namespace acid {
class ACID_EXPORT PngBitmap : public Bitmap::Registrar<PngBitmap> {
inline static const bool Registered = Register(".png");
public:
static void Load(Bitmap &bitmap, const std::filesystem::path &filename);
static void Write(const Bitmap &bitmap, const std:... |
#pragma once
#include "Engine/Engine.hpp"
namespace acid {
class ACID_EXPORT Context {
public:
};
}
|
#include "Cursor.hpp"
#include <GLFW/glfw3.h>
#include "Bitmaps/Bitmap.hpp"
namespace acid {
Cursor::Cursor(const std::filesystem::path &filename, CursorHotspot hotspot) {
Bitmap bitmap(filename);
if (!bitmap) return;
GLFWimage image[1];
image[0].width = bitmap.GetSize().x;
image[0].height = bitmap.GetSize().y;... |
#pragma once
#include <filesystem>
#include "Export.hpp"
#include "Utils/NonCopyable.hpp"
struct GLFWcursor;
namespace acid {
enum class CursorHotspot : uint8_t {
UpperLeft,
UpperRight,
BottomLeft,
BottomRight,
Centered
};
enum class CursorStandard : uint32_t {
Arrow = 0x00036001,
IBeam = 0x00036002,
Cross... |
#include "Joysticks.hpp"
#include <GLFW/glfw3.h>
namespace acid {
static_assert(GLFW_JOYSTICK_LAST == static_cast<int16_t>(JoystickPort::_16), "GLFW joystick port count does not match our joystick port enum count.");
void CallbackJoystick(int32_t id, int32_t event) {
auto joystick = Joysticks::Get()->GetJoystick(st... |
#pragma once
#include "Devices/Windows.hpp"
#include "Engine/Engine.hpp"
namespace acid {
enum class JoystickHatValue : uint8_t {
Centered = 0,
Up = 1,
Right = 2,
Down = 4,
Left = 8
};
ENABLE_BITMASK_OPERATORS(JoystickHatValue)
enum class JoystickPort : uint8_t {
_1 = 0,
_2 = 1,
_3 = 2,
_4 = 3,
_5 = 4,
_6... |
#include "Monitor.hpp"
#include <GLFW/glfw3.h>
#include "Windows.hpp"
namespace acid {
Monitor::Monitor(GLFWmonitor *monitor) :
monitor(monitor) {
}
bool Monitor::IsPrimary() const {
return monitor == glfwGetPrimaryMonitor();
}
Vector2ui Monitor::GetWorkareaSize() const {
int32_t width;
int32_t height;
glfwGet... |
#pragma once
#include "Maths/Vector2.hpp"
struct GLFWmonitor;
namespace acid {
/**
* @brief Class used to describe the video mode for a monitor.
*/
class ACID_EXPORT VideoMode {
public:
/// The width, in screen coordinates, of the video mode.
int32_t width;
/// The height, in screen coordinates, of the video mo... |
#include "Windows.hpp"
#include <algorithm>
#include <GLFW/glfw3.h>
#include "Graphics/Graphics.hpp"
namespace acid {
static_assert(GLFW_KEY_LAST == static_cast<int16_t>(Key::Menu), "GLFW keys count does not match our keys enum count.");
static_assert(GLFW_MOUSE_BUTTON_LAST == static_cast<int16_t>(MouseButton::_8), ... |
#pragma once
#include <volk.h>
#include <bitmask.hpp>
#include <rocket.hpp>
#include "Maths/Vector2.hpp"
#include "Cursor.hpp"
#include "Monitor.hpp"
struct GLFWwindow;
namespace acid {
enum class Key : int16_t {
Unknown = -1,
Space = 32,
Apostrophe = 39,
Comma = 44,
Minus = 45,
Period = 46,
Slash = 47,
_0 ... |
#include "Windows.hpp"
#include <algorithm>
#include <GLFW/glfw3.h>
namespace acid {
void CallbackError(int32_t error, const char *description) {
Windows::CheckGlfw(error);
Log::Error("GLFW error: ", description, ", ", error, '\n');
}
void CallbackMonitor(GLFWmonitor *glfwMonitor, int32_t event) {
auto &monitors ... |
#pragma once
#include "Engine/Engine.hpp"
#include "Window.hpp"
namespace acid {
/**
* @brief Module used for managing a window.
*/
class ACID_EXPORT Windows : public Module::Registrar<Windows> {
inline static const bool Registered = Register(Stage::Pre);
public:
Windows();
~Windows();
void Update() override;
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.