Category : namespaces

Dotnet dev with embedded C experience here moving into cpp land to give you an idea of my experience/knowledge. I’ve got a base class Window in src/Core/Window/: namespace Pyrite::Core::Window { class PYR_API Window { public: using EventCallbackFn = std::function<void(Pyrite::Event&)>; virtual ~Window(); virtual void OnUpdate(); virtual uint32_t GetWidth() const = 0; virtual uint32_t GetHeight() const = ..

Read more

I define an inline function object in a header file, like this: // fmap.hpp namespace util { inline auto constexpr fmap = boost::hana::curry<2>(boost::hana::flip(boost::hana::transform)); } Client code can simply #include "fmap.hpp" and start using util::fmap as they like. So far so good. But sometimes the definition of such objects can be cumbersome to read, if they ..

Read more

I’m trying to learn OpenGL in C++. To clean up my code I was trying to create an header file with all variables, which decribe objects, in it. This header looks something like this: #pragma once #include <iostream> #include <glad/glad.h> #include <GLFW/glfw.h> #include <glm/glm.hpp> #include <glm/gtc/matrix_transform.hpp> #include <stb/stb_image.h> namespace data { … float fragments[] = ..

Read more