URL: https://graphicscomputing.fr/cgp/reference/environment_generic_structure/
Description: Environment shared by all draw calls (camera, projection, light, uniforms).

# environment_generic_structure

Environment shared by all draw calls (camera, projection, light, uniforms).

Fields:

- `bool default_expected_uniform` - Static flag, true by default, used as the default value of expected in send_opengl_uniform; mesh_drawable combines it with its own flag, and false silences the warning for a uniform that the shader does not use.

Functions taking it:

- `void draw(curve_drawable const& drawable, environment_generic_structure const& environment, int N_points = -1)` - Draw a curve_drawable as a line strip or as separate segments, limited to the first N_points points if N_points is not -1.
- `void draw(curve_drawable_dynamic_extend const& drawable, environment_generic_structure const& environment)` - Draw the N_valid_points points currently stored in a curve_drawable_dynamic_extend.
- `void draw(hierarchy_mesh_drawable const& drawable, environment_generic_structure const& environment = environment_generic_structure(), int instance_count = 1, bool expected_uniforms = true, uniform_generic_structure const& additional_uniforms = uniform_generic_structure())` - Draw every node of the hierarchy with draw(mesh_drawable); call update_local_to_global_coordinates() beforehand.
- `void draw_wireframe(hierarchy_mesh_drawable const& drawable, environment_generic_structure const& environment = environment_generic_structure(), vec3 const& color = { 0,0,1 }, int instance_count = 1, bool expected_uniforms = true, uniform_generic_structure const& additional_uniforms = uniform_generic_structure())` - Draw the triangle edges of every node of the hierarchy in a flat color (no effect with Emscripten/WebGL).
- `void draw(mesh_drawable const& drawable, environment_generic_structure const& environment = environment_generic_structure(), int instance_count = 1, bool expected_uniforms = true, uniform_generic_structure const& additional_uniforms = uniform_generic_structure(), GLenum draw_mode = GL_TRIANGLES, material_mesh_drawable_phong const* material_override = nullptr)` - Draw a mesh_drawable with its shader, textures, model and material, plus the environment and optional additional uniforms, possibly instanced or with an overriding material.
- `void draw_wireframe(mesh_drawable const& drawable, environment_generic_structure const& environment = environment_generic_structure(), vec3 const& color = {0,0,1}, int instance_count = 1, bool expected_uniforms = true, uniform_generic_structure const& additional_uniforms = uniform_generic_structure())` - Draw the triangle edges of a mesh_drawable in a flat color, slightly offset toward the camera (no effect with Emscripten/WebGL).
- `void draw(skybox_drawable const& drawable, environment_generic_structure const& environment = environment_generic_structure())` - Draw the skybox; call it first with depth writing disabled (glDepthMask(GL_FALSE)).
- `void draw(trajectory_drawable const& drawable, environment_generic_structure const& environment)` - Draw the recorded positions of a trajectory_drawable as a polyline, if any.
- `void draw(triangles_drawable const& drawable, environment_generic_structure const& environment = environment_generic_structure(), uniform_generic_structure const& additional_uniforms = uniform_generic_structure(), material_mesh_drawable_phong const* material_override = nullptr)` - Draw a non-indexed triangles_drawable (triangle soup) with its shader, texture, model and material, plus the environment and optional additional uniforms.
- `void draw_wireframe(triangles_drawable const& drawable, environment_generic_structure const& environment = environment_generic_structure(), vec3 const& color = {0,0,1}, uniform_generic_structure const& additional_uniforms = uniform_generic_structure())` - Draw the triangle edges of a triangles_drawable in a flat color, slightly offset toward the camera (no effect with Emscripten/WebGL).
