| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- //
- // helper.hpp
- // graphics
- //
- // Created by Sam Jaffe on 5/18/19.
- // Copyright © 2019 Sam Jaffe. All rights reserved.
- //
- #pragma once
- #include <string>
- #include <utility>
- #include "game/graphics/graphics_fwd.h"
- #include "game/math/math_fwd.hpp"
- #include "vector/vector.hpp"
- namespace graphics {
- namespace textures {
- enum class format : unsigned int { RGB, RGBA };
- struct external_data {
- external_data(std::string const & abs_path);
- ~external_data();
- format color;
- math::vec2i size;
- void * buffer;
- };
- }
- namespace shaders {
- enum class type : unsigned int { FRAGMENT, VERTEX };
- }
- namespace materials {
- enum class uniform : unsigned int { NORMAL, DIFFUSE, SPECULAR };
- }
- }
- namespace std {
- template <> struct hash<graphics::shaders::type> {
- std::size_t operator()(graphics::shaders::type tp) const {
- return std::hash<unsigned int>()(static_cast<unsigned int>(tp));
- }
- };
- template <> struct hash<graphics::materials::uniform> {
- std::size_t operator()(graphics::materials::uniform uf) const {
- return std::hash<unsigned int>()(static_cast<unsigned int>(uf));
- }
- };
- }
|