| 123456789101112131415161718192021222324252627282930313233343536373839 |
- //
- // mock_renderer.h
- // engine
- //
- // Created by Sam Jaffe on 6/2/19.
- // Copyright © 2019 Sam Jaffe. All rights reserved.
- //
- #pragma once
- #include "game/graphics/manager.hpp"
- #include "game/graphics/renderer.hpp"
- #include "game/graphics/shader.hpp"
- #include "game/graphics/shader_program.hpp"
- #include "game/graphics/texture.hpp"
- #include "game/util/identity.hpp"
- template <typename T> inline identity<T> cast(unsigned int id) {
- return *reinterpret_cast<identity<T> *>(&id);
- }
- struct stub_manager_impl : graphics::manager {
- using shader = graphics::shader;
- using shader_program = graphics::shader_program;
- using texture = graphics::texture;
- shader compile(graphics::shaders::type t,
- std::string const & s) const override {
- return {0, t, s};
- }
- shader_program compile(identity<shader> f,
- identity<shader> v) const override {
- return {0, f, v};
- }
- texture compile(graphics::textures::format, math::vec2i dims,
- void const *) const override {
- return {0, dims};
- }
- };
|