Files
video-shader-toys/apps/RenderCadenceCompositor/render/SimpleMotionRenderer.h
Aiden 2c5e925b97
All checks were successful
CI / React UI Build (push) Successful in 11s
CI / Native Windows Build And Tests (push) Successful in 3m7s
CI / Windows Release Package (push) Has been skipped
Video input fallback
2026-05-12 18:53:46 +10:00

38 lines
901 B
C++

#pragma once
#include "GLExtensions.h"
#include <cstdint>
class SimpleMotionRenderer
{
public:
SimpleMotionRenderer() = default;
bool InitializeGl(unsigned width, unsigned height);
void RenderFrame(uint64_t frameIndex);
void RenderTexture(GLuint texture);
void ShutdownGl();
unsigned Width() const { return mWidth; }
unsigned Height() const { return mHeight; }
private:
bool EnsureTextureProgram();
bool EnsurePatternProgram();
void DestroyTextureProgram();
void DestroyPatternProgram();
static bool CompileShader(GLenum shaderType, const char* source, GLuint& shader);
unsigned mWidth = 0;
unsigned mHeight = 0;
GLuint mPatternProgram = 0;
GLuint mPatternVertexShader = 0;
GLuint mPatternFragmentShader = 0;
GLuint mPatternVertexArray = 0;
GLuint mTextureProgram = 0;
GLuint mTextureVertexShader = 0;
GLuint mTextureFragmentShader = 0;
GLuint mTextureVertexArray = 0;
};