Skip to content

Commit

Permalink
glwidgets: Fix the 3D viewport model appearing white and buggy on sta…
Browse files Browse the repository at this point in the history
…rtup. This was caused by overflowing the uint8_t on the class structure and setting the following fields that contain the render modes to zero. Don't cast the write and stop trying to be smart by using smaller types to my own detriment. Bug introduced in 3813f1e.
  • Loading branch information
Swyter committed May 9, 2024
1 parent 52f9690 commit 004371e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion glwidgets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1692,7 +1692,7 @@ void GLWidget::initOpenGL2(){

if (supportedExtensionsList.contains("GL_EXT_texture_filter_anisotropic"))
{
glGetIntegerv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, (GLint *) &maxSupportedTexAnisoTaps);
glGetIntegerv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &maxSupportedTexAnisoTaps);
qDebug("swy: GL_EXT_texture_filter_anisotropic is supported, with x%u taps...", maxSupportedTexAnisoTaps);
}

Expand Down
2 changes: 1 addition & 1 deletion glwidgets.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class GLWidget : public QGLWidget, protected QOpenGLFunctions_2_0
void setMaterialError(int newErr);

QSet<QString> supportedExtensionsList;
uint8_t maxSupportedTexAnisoTaps = 0;
int32_t maxSupportedTexAnisoTaps = 0;

void keyPressEvent( QKeyEvent * event );
void keyReleaseEvent( QKeyEvent * event );
Expand Down

0 comments on commit 004371e

Please sign in to comment.