openMSX
GLScaler.hh
Go to the documentation of this file.
1 #ifndef GLSCALER_HH
2 #define GLSCALER_HH
3 
4 #include "GLUtil.hh"
5 
6 namespace openmsx {
7 
8 class FrameSource;
9 
13 class GLScaler
14 {
15 public:
16  virtual ~GLScaler() = default;
17 
34  virtual void scaleImage(
35  gl::ColorTexture& src, gl::ColorTexture* superImpose,
36  unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
37  unsigned dstStartY, unsigned dstEndY, unsigned dstWidth,
38  unsigned logSrcHeight) = 0;
39 
40  virtual void uploadBlock(
41  unsigned srcStartY, unsigned srcEndY,
42  unsigned lineWidth, FrameSource& paintFrame);
43 
44 protected:
45  explicit GLScaler(const std::string& progName);
46  void setup(bool superImpose);
47 
70  void execute(gl::ColorTexture& src, gl::ColorTexture* superImpose,
71  unsigned srcStartY, unsigned srcEndY, unsigned srcWidth,
72  unsigned dstStartY, unsigned dstEndY, unsigned dstWidth,
73  unsigned logSrcHeight,
74  bool textureFromZero = false);
75 
76 protected:
80  GLint unifTexSize[2];
81 };
82 
83 } // namespace openmsx
84 
85 #endif // GLSCALER_HH
openmsx::GLScaler::scaleImage
virtual void scaleImage(gl::ColorTexture &src, gl::ColorTexture *superImpose, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, unsigned dstStartY, unsigned dstEndY, unsigned dstWidth, unsigned logSrcHeight)=0
Scales the image in the given area, which must consist of lines which are all equally wide.
openmsx::GLScaler::program
gl::ShaderProgram program[2]
Definition: GLScaler.hh:79
gl::BufferObject
Definition: GLUtil.hh:431
openmsx::GLScaler::uploadBlock
virtual void uploadBlock(unsigned srcStartY, unsigned srcEndY, unsigned lineWidth, FrameSource &paintFrame)
Definition: GLScaler.cc:33
gl::ColorTexture
Definition: GLUtil.hh:94
openmsx::GLScaler::execute
void execute(gl::ColorTexture &src, gl::ColorTexture *superImpose, unsigned srcStartY, unsigned srcEndY, unsigned srcWidth, unsigned dstStartY, unsigned dstEndY, unsigned dstWidth, unsigned logSrcHeight, bool textureFromZero=false)
Helper method to draw a rectangle with multiple texture coordinates.
Definition: GLScaler.cc:45
openmsx::GLScaler::vao
gl::VertexArray vao
Definition: GLScaler.hh:77
openmsx::GLScaler::unifTexSize
GLint unifTexSize[2]
Definition: GLScaler.hh:80
openmsx::GLScaler::setup
void setup(bool superImpose)
Definition: GLScaler.cc:39
openmsx::GLScaler::vbo
gl::BufferObject vbo[2]
Definition: GLScaler.hh:78
openmsx::FrameSource
Interface for getting lines from a video frame.
Definition: FrameSource.hh:13
openmsx::GLScaler
Abstract base class for OpenGL scalers.
Definition: GLScaler.hh:13
openmsx::GLScaler::~GLScaler
virtual ~GLScaler()=default
gl::ShaderProgram
Wrapper around an OpenGL program: a collection of vertex and fragment shaders.
Definition: GLUtil.hh:369
GLUtil.hh
gl::VertexArray
Definition: GLUtil.hh:452
openmsx
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
openmsx::GLScaler::GLScaler
GLScaler(const std::string &progName)
Definition: GLScaler.cc:11