fix conditional jump problems, add functions to use ffmpeg for the render and add ffmpeg to compile the project

This commit is contained in:
2025-01-25 03:27:55 +01:00
parent 7b1be7c2d9
commit 25187d60ce
10 changed files with 186 additions and 43 deletions

View File

@ -6,7 +6,7 @@
/* By: tomoron <tomoron@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/01/22 16:29:26 by tomoron #+# #+# */
/* Updated: 2025/01/23 19:41:40 by tomoron ### ########.fr */
/* Updated: 2025/01/25 03:12:38 by tomoron ### ########.fr */
/* */
/* ************************************************************************** */
@ -14,9 +14,16 @@
# define RENDERER_HPP
# include "RT.hpp"
extern "C" {
#include <libavformat/avformat.h>
#include <libavcodec/avcodec.h>
#include <libavutil/avutil.h>
#include <libavutil/imgutils.h>
}
class Scene;
class Window;
class Shader;
typedef struct s_pathPoint
{
@ -30,15 +37,20 @@ class Renderer
public:
Renderer(Scene *scene, Window *win);
void renderImgui(void);
void update(void);
void update(Shader &shader);
private:
void addPoint(void);
void makeMovement(float timeFromStart, float curSplitTimeReset);
void initFfmpeg(std::string filename);
void addImageToRender(Shader &shader);
void endRender(void);
int _min;
float _sec;
int _sec;
int _samples;
int _testSamples;
int _fps;
std::vector<t_pathPoint> _path;
Scene *_scene;
Window *_win;
@ -47,6 +59,13 @@ class Renderer
int _destPathIndex;
double _curSplitStart;
int _curSamples;
int _testMode;
long int _frameCount;
AVFrame *_frame;
AVFormatContext *_format;
AVCodecContext *_codec_context;
};
#endif

View File

@ -6,7 +6,7 @@
/* By: ycontre <ycontre@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/13 18:10:10 by TheRed #+# #+# */
/* Updated: 2024/10/14 19:51:46 by ycontre ### ########.fr */
/* Updated: 2025/01/25 02:40:13 by tomoron ### ########.fr */
/* */
/* ************************************************************************** */
@ -35,6 +35,8 @@ class Shader
GLuint getProgram(void) const;
GLuint getProgramCompute(void) const;
std::vector<float> getOutputImage(void);
private:
@ -53,4 +55,4 @@ class Shader
void checkCompileErrors(unsigned int shader);
};
#endif
#endif

View File

@ -6,7 +6,7 @@
/* By: ycontre <ycontre@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/13 16:15:41 by TheRed #+# #+# */
/* Updated: 2025/01/23 15:31:28 by tomoron ### ########.fr */
/* Updated: 2025/01/25 03:09:23 by tomoron ### ########.fr */
/* */
/* ************************************************************************** */
@ -46,7 +46,7 @@ class Window
void setFrameCount(int nb);
void rendererUpdate(void);
void rendererUpdate(Shader &shader);
private:
GLFWwindow *_window;
Scene *_scene;