implement graph node mouse collisions (unoptimized iterating over all masses for now)
This commit is contained in:
@ -14,16 +14,14 @@ class renderer
|
||||
{
|
||||
private:
|
||||
const state_manager& state;
|
||||
const input_handler& input;
|
||||
input_handler& input;
|
||||
user_interface& gui;
|
||||
|
||||
const orbit_camera& camera;
|
||||
RenderTexture graph_target =
|
||||
LoadRenderTexture(GetScreenWidth() / 2, GetScreenHeight() - MENU_HEIGHT);
|
||||
RenderTexture graph_target = LoadRenderTexture(GetScreenWidth() / 2, GetScreenHeight() - MENU_HEIGHT);
|
||||
|
||||
// TODO: Those should be moved to the user_interface.h
|
||||
RenderTexture klotski_target =
|
||||
LoadRenderTexture(GetScreenWidth() / 2, GetScreenHeight() - MENU_HEIGHT);
|
||||
RenderTexture klotski_target = LoadRenderTexture(GetScreenWidth() / 2, GetScreenHeight() - MENU_HEIGHT);
|
||||
RenderTexture menu_target = LoadRenderTexture(GetScreenWidth(), MENU_HEIGHT);
|
||||
|
||||
// Batching
|
||||
@ -35,21 +33,21 @@ private:
|
||||
std::vector<Color> colors;
|
||||
Material vertex_mat = LoadMaterialDefault();
|
||||
Mesh cube_instance = GenMeshCube(VERTEX_SIZE, VERTEX_SIZE, VERTEX_SIZE);
|
||||
Shader instancing_shader =
|
||||
LoadShader("shader/instancing_vertex.glsl", "shader/instancing_fragment.glsl");
|
||||
|
||||
Shader instancing_shader = LoadShader("shader/instancing_vertex.glsl", "shader/instancing_fragment.glsl");
|
||||
unsigned int color_vbo_id = 0;
|
||||
|
||||
public:
|
||||
renderer(const orbit_camera& _camera, const state_manager& _state, const input_handler& _input,
|
||||
renderer(const orbit_camera& _camera,
|
||||
const state_manager& _state,
|
||||
input_handler& _input,
|
||||
user_interface& _gui)
|
||||
: state(_state), input(_input), gui(_gui), camera(_camera)
|
||||
{
|
||||
instancing_shader.locs[SHADER_LOC_MATRIX_MVP] = GetShaderLocation(instancing_shader, "mvp");
|
||||
instancing_shader.locs[SHADER_LOC_MATRIX_MODEL] =
|
||||
GetShaderLocationAttrib(instancing_shader, "instanceTransform");
|
||||
instancing_shader.locs[SHADER_LOC_VECTOR_VIEW] =
|
||||
GetShaderLocation(instancing_shader, "viewPos");
|
||||
instancing_shader.locs[SHADER_LOC_MATRIX_MODEL] = GetShaderLocationAttrib(
|
||||
instancing_shader,
|
||||
"instanceTransform");
|
||||
instancing_shader.locs[SHADER_LOC_VECTOR_VIEW] = GetShaderLocation(instancing_shader, "viewPos");
|
||||
|
||||
// infoln("LOC vertexPosition: {}",
|
||||
// rlGetLocationAttrib(instancing_shader.id, "vertexPosition"));
|
||||
@ -102,8 +100,7 @@ private:
|
||||
auto draw_textures(int fps, int ups, size_t mass_count, size_t spring_count) const -> void;
|
||||
|
||||
public:
|
||||
auto render(const std::vector<Vector3>& masses, int fps, int ups, size_t mass_count,
|
||||
size_t spring_count) -> void;
|
||||
auto render(const std::vector<Vector3>& masses, int fps, int ups, size_t mass_count, size_t spring_count) -> void;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user