19 #ifndef GENERIC_RENDERER_H
20 #define GENERIC_RENDERER_H
25 #include "../renderer.h"
26 #include "../gl_renderer.h"
27 #include "../../assets/material.h"
28 #include "../batching/render_queue.h"
32 struct GL2RenderGroupImpl;
33 class GenericRenderer;
41 batcher::Iteration iteration;
55 void apply_lights(
const LightPtr* lights,
const uint8_t count)
override;
60 Color global_ambient_;
64 const Light* light_ =
nullptr;
68 void do_visit(
const Renderable* renderable,
const MaterialPass* material_pass, batcher::Iteration iteration);
83 const MaterialPass* material_pass,
const RenderPriority priority,
84 const uint8_t pass_number,
const bool is_blended,
85 const float distance_to_camera, uint16_t texture_id)
override;
87 void init_context()
override;
89 std::shared_ptr<batcher::RenderQueueVisitor> get_render_queue_visitor(
CameraPtr camera)
override;
91 GPUProgramPtr new_or_existing_gpu_program(
const std::string& vertex_shader_source,
const std::string& fragment_shader_source)
override;
93 GPUProgramPtr gpu_program(
const GPUProgramID& program_id)
const override;
94 GPUProgramPtr current_gpu_program()
const override;
95 bool supports_gpu_programs()
const override {
return true; }
96 GPUProgramPtr default_gpu_program()
const override;
98 std::string name()
const override {
99 return (use_es_) ?
"gles2x" :
"gl2x";
102 void prepare_to_render(
const Renderable* renderable)
override;
104 bool is_gles()
const {
return use_es_; }
107 GPUProgramPtr default_gpu_program_ = 0;
108 bool use_es_ =
false;
109 std::shared_ptr<VBOManager> buffer_manager_;
117 void set_blending_mode(BlendType type);
121 std::shared_ptr<GPUBuffer> buffer_stash_;
128 #endif // GENERIC_RENDERER_H