+ | Renderer working

This commit is contained in:
TheRedShip
2025-02-14 18:11:33 +01:00
parent 583e15685a
commit a704a1fd76
7 changed files with 57 additions and 40 deletions

View File

@ -300,15 +300,17 @@ void Renderer::initRender(void)
SWS_BILINEAR, nullptr, nullptr, nullptr);
}
void Renderer::addImageToRender(Shader &shader)
void Renderer::addImageToRender(GLuint &texture)
{
std::vector<float> image;
std::vector<float> image(WIDTH * HEIGHT * 4);
AVPacket *pkt;
long int videoFrameOffset;
long int outputImageOffset;
(void) shader;
// image = shader.getOutputImage();
glBindTexture(GL_TEXTURE_2D, texture);
glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_FLOAT, image.data());
glBindTexture(GL_TEXTURE_2D, 0);
for (int x = 0; x < WIDTH; x++)
{
@ -401,7 +403,7 @@ void Renderer::addPoint(float time)
_path.insert(pos, newPoint);
}
void Renderer::update(Shader &shader)
void Renderer::update(GLuint &texture)
{
double curTime;
@ -422,7 +424,7 @@ void Renderer::update(Shader &shader)
if(!_testMode)
{
addImageToRender(shader);
addImageToRender(texture);
_frameCount++;
}
makeMovement(curTime - _curSplitStart, curTime);