3 #include "../../assets/material.h"
4 #include "../batching/renderable.h"
5 #include "../gl_renderer.h"
9 class GL1RenderGroupImpl;
16 batcher::Iteration iteration;
31 void apply_lights(
const LightPtr* lights,
const uint8_t count)
override;
36 Color global_ambient_;
43 void do_visit(
const Renderable* renderable,
const MaterialPass* material_pass, batcher::Iteration iteration);
45 void enable_vertex_arrays(
bool force=
false);
46 void disable_vertex_arrays(
bool force=
false);
48 void enable_normal_arrays(
bool force=
false);
49 void disable_normal_arrays(
bool force=
false);
51 void enable_color_arrays(
bool force=
false);
52 void disable_color_arrays(
bool force=
false);
54 void enable_texcoord_array(uint8_t which,
bool force=
false);
55 void disable_texcoord_array(uint8_t which,
bool force=
false);
57 bool positions_enabled_ =
false;
58 bool colors_enabled_ =
false;
59 bool normals_enabled_ =
false;
60 bool textures_enabled_[_S_GL_MAX_TEXTURE_UNITS] = {0};
62 uint32_t default_texture_name_ = 0;
65 bool initialized =
false;
71 float constant_att = 0;
73 float quadratic_att = 0;
75 LightState() =
default;
76 LightState(
bool enabled,
Vec4 pos,
Color diffuse,
Color ambient,
Color specular,
float constant_att,
float linear_att,
float quadratic_att):
82 constant_att(constant_att),
83 linear_att(linear_att),
84 quadratic_att(quadratic_att) {}
86 bool operator!=(
const LightState& rhs)
const {
87 return !(*
this == rhs);
90 bool operator==(
const LightState& rhs)
const {
92 enabled == rhs.enabled &&
93 position == rhs.position &&
94 diffuse == rhs.diffuse &&
95 ambient == rhs.ambient &&
96 specular == rhs.specular &&
97 constant_att == rhs.constant_att &&
98 linear_att == rhs.linear_att &&
99 quadratic_att == rhs.quadratic_att
104 LightState light_states_[MAX_LIGHTS_PER_RENDERABLE];