Simulant  21.09-46
A portable game engine for Windows, OSX, Linux, Dreamcast, and PSP
gl1x_renderer.h
1 /* * Copyright (c) 2011-2017 Luke Benstead https://simulant-engine.appspot.com
2  *
3  * This file is part of Simulant.
4  *
5  * Simulant is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Lesser General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * Simulant is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with Simulant. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #pragma once
20 
21 #include "../renderer.h"
22 #include "../gl_renderer.h"
23 
24 namespace smlt {
25 
27  public Renderer,
28  public GLRenderer {
29 
30 public:
31  friend class GL1RenderQueueVisitor;
32 
33  GL1XRenderer(Window* window);
34 
35  batcher::RenderGroupKey prepare_render_group(
36  batcher::RenderGroup* group,
37  const Renderable *renderable,
38  const MaterialPass *material_pass,
39  const uint8_t pass_number,
40  const bool is_blended,
41  const float distance_to_camera
42  ) override;
43 
44  std::shared_ptr<batcher::RenderQueueVisitor> get_render_queue_visitor(CameraPtr camera) override;
45 
46  void init_context() override;
47 
48  std::string name() const override {
49  return "gl1x";
50  }
51 
52  void prepare_to_render(const Renderable *renderable) override {
53  _S_UNUSED(renderable);
54  }
55 private:
56  void on_texture_prepare(Texture* texture) override {
57  GLRenderer::on_texture_prepare(texture);
58  }
59 
60  void on_texture_register(TextureID tex_id, Texture* texture) override {
61  GLRenderer::on_texture_register(tex_id, texture);
62  }
63 
64  void on_texture_unregister(TextureID tex_id, Texture* texture) override {
65  GLRenderer::on_texture_unregister(tex_id, texture);
66  }
67 };
68 
69 }
smlt::GLRenderer
Definition: gl_renderer.h:49
smlt
Definition: animation.cpp:25
smlt::Window
Definition: window.h:90
smlt::batcher::RenderGroupKey
Definition: render_queue.h:39
smlt::Texture
Definition: texture.h:131
smlt::GL1RenderQueueVisitor
Definition: gl1x_render_queue_visitor.h:21
smlt::UniqueID< TexturePtr >
smlt::MaterialPass
Definition: material.h:47
smlt::batcher::RenderGroup
Definition: render_queue.h:47
smlt::Renderer
Definition: renderer.h:40
smlt::default_init_ptr< Camera >
smlt::Renderable
Definition: renderable.h:66
smlt::GL1XRenderer
Definition: gl1x_renderer.h:28