Change how fbo's manage viewports since I misunderstood how glViewportIndexedf works
This commit is contained in:
parent
b514cd2e87
commit
223dbc7006
@ -32,6 +32,7 @@ namespace gfx{
|
||||
{
|
||||
private:
|
||||
GLuint m_buffer;
|
||||
math::vec4<GLfloat> m_vp_coords;
|
||||
|
||||
public:
|
||||
fbo();
|
||||
@ -56,7 +57,9 @@ namespace gfx{
|
||||
void clear_stencil_buffer(GLint value = 0);
|
||||
void clear(GLbitfield mask);
|
||||
|
||||
void set_viewport(GLfloat x, GLfloat y, GLfloat w, GLfloat h);
|
||||
void set_viewport(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2);
|
||||
void apply_viewport()const;
|
||||
const math::vec4<GLfloat>& get_viewport()const;
|
||||
|
||||
bool bind()const;
|
||||
bool bind(gl_frame_buffer_manager& b)const;
|
||||
|
||||
@ -80,9 +80,16 @@ namespace gfx{
|
||||
}
|
||||
}
|
||||
|
||||
void fbo::set_viewport(GLfloat x, GLfloat y, GLfloat w, GLfloat h){
|
||||
glViewportIndexedf(m_buffer, x, y, w, h);
|
||||
void fbo::set_viewport(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2){
|
||||
m_vp_coords = math::vec4<GLfloat>{x1, y1, x2, y2};
|
||||
}
|
||||
void fbo::apply_viewport()const{
|
||||
glViewport(m_vp_coords.x(), m_vp_coords.y(), m_vp_coords.z(), m_vp_coords.w());
|
||||
}
|
||||
const math::vec4<GLfloat>& fbo::get_viewport()const{
|
||||
return m_vp_coords;
|
||||
}
|
||||
|
||||
bool fbo::bind()const{
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, m_buffer);
|
||||
return true;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user