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() {}
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:
78  GLint unifTexSize[2];
79 };
80 
81 } // namespace openmsx
82 
83 #endif // GLSCALER_HH
virtual void uploadBlock(unsigned srcStartY, unsigned srcEndY, unsigned lineWidth, FrameSource &paintFrame)
Definition: GLScaler.cc:33
void setup(bool superImpose)
Definition: GLScaler.cc:39
Interface for getting lines from a video frame.
Definition: FrameSource.hh:14
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
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5
GLint unifTexSize[2]
Definition: GLScaler.hh:78
virtual ~GLScaler()
Definition: GLScaler.hh:16
GLScaler(const std::string &progName)
Definition: GLScaler.cc:10
Abstract base class for OpenGL scalers.
Definition: GLScaler.hh:13
gl::ShaderProgram program[2]
Definition: GLScaler.hh:77
Wrapper around an OpenGL program: a collection of vertex and fragment shaders.
Definition: GLUtil.hh:393
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...