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