merge renderer with main

This commit is contained in:
2025-01-30 22:31:25 +01:00
14 changed files with 796 additions and 33 deletions

View File

@ -6,7 +6,7 @@
/* By: ycontre <ycontre@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/13 20:21:13 by ycontre #+# #+# */
/* Updated: 2025/01/30 17:52:32 by ycontre ### ########.fr */
/* Updated: 2025/01/30 22:29:39 by tomoron ### ########.fr */
/* */
/* ************************************************************************** */
@ -228,4 +228,14 @@ GLuint Shader::getProgram(void) const
GLuint Shader::getProgramCompute(void) const
{
return (_program_compute);
}
}
std::vector<float> Shader::getOutputImage(void)
{
std::vector<float> res(WIDTH * HEIGHT * 4);
glBindTexture(GL_TEXTURE_2D, _output_texture);
glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_FLOAT, res.data());
glBindTexture(GL_TEXTURE_2D, 0);
return (res);
}