1
0
mirror of https://github.com/TomHarte/CLK.git synced 2026-03-15 17:16:33 +00:00

Add .reset to clarify intent.

This commit is contained in:
Thomas Harte
2026-02-04 13:53:38 -05:00
parent 8fce1e8cb3
commit d5fa5d4dd4
3 changed files with 18 additions and 4 deletions

View File

@@ -69,6 +69,9 @@ public:
Shader &operator =(Shader &&);
Shader() = default;
Shader(const Shader&) = delete;
Shader &operator =(const Shader &) = delete;
/*!
Performs an @c glUseProgram to make this the active shader unless:
(i) it was the previous shader bound; and
@@ -149,6 +152,10 @@ public:
return shader_program_ == 0;
}
void reset() {
*this = Shader();
}
private:
void init(
const std::string &vertex_shader,

View File

@@ -41,6 +41,9 @@ public:
TextureTarget(TextureTarget &&);
TextureTarget &operator =(TextureTarget &&);
TextureTarget(const TextureTarget &) = delete;
TextureTarget &operator =(const TextureTarget &) = delete;
/*!
Binds this target as a framebuffer and sets the @c glViewport accordingly.
*/
@@ -69,6 +72,10 @@ public:
return framebuffer_ == 0;
}
void reset() {
*this = TextureTarget();
}
/*!
Draws this texture to the currently-bound framebuffer, which has the aspect ratio
@c aspect_ratio. This texture will fill the height of the frame buffer, and pick

View File

@@ -314,7 +314,7 @@ void ScanTarget::setup_pipeline() {
CompositionTextureUnit
);
} else {
separation_shader_ = OpenGL::Shader();
separation_shader_.reset();
}
if(is_composite(modals.display_type) || is_svideo(modals.display_type)) {
@@ -328,7 +328,7 @@ void ScanTarget::setup_pipeline() {
is_svideo(modals.display_type) ? CompositionTextureUnit : SeparationTextureUnit
);
} else {
demodulation_shader_ = OpenGL::Shader();
demodulation_shader_.reset();
}
}
@@ -346,7 +346,7 @@ void ScanTarget::setup_pipeline() {
false
);
} else {
separation_buffer_ = TextureTarget();
separation_buffer_.reset();
}
if(is_composite(modals.display_type) || is_svideo(modals.display_type)) {
@@ -359,7 +359,7 @@ void ScanTarget::setup_pipeline() {
false
);
} else {
demodulation_buffer_ = TextureTarget();
demodulation_buffer_.reset();
}
}