From e2c61b28e037a7283e4c7278a30ec06f25d6e948 Mon Sep 17 00:00:00 2001 From: RSDuck Date: Sat, 2 Jan 2021 11:28:46 +0100 Subject: [PATCH] fix mac/clang build --- src/GPU_OpenGL.cpp | 3 ++- src/frontend/qt_sdl/main.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/GPU_OpenGL.cpp b/src/GPU_OpenGL.cpp index f60ca971..fb04ca01 100644 --- a/src/GPU_OpenGL.cpp +++ b/src/GPU_OpenGL.cpp @@ -170,7 +170,8 @@ void SetRenderSettings(RenderSettings& settings) glBindTexture(GL_TEXTURE_2D, CompScreenOutputTex); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, ScreenW, ScreenH, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); // fill the padding - u8 zeroPixels[ScreenW*2*scale*4] = {0}; + u8 zeroPixels[ScreenW*2*scale*4]; + memset(zeroPixels, 0, sizeof(zeroPixels)); glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 192*scale, ScreenW, 2*scale, GL_RGBA, GL_UNSIGNED_BYTE, zeroPixels); GLenum fbassign[] = {GL_COLOR_ATTACHMENT0}; diff --git a/src/frontend/qt_sdl/main.cpp b/src/frontend/qt_sdl/main.cpp index d7821fa7..dccc7f18 100644 --- a/src/frontend/qt_sdl/main.cpp +++ b/src/frontend/qt_sdl/main.cpp @@ -909,7 +909,8 @@ void ScreenPanelGL::initializeGL() glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 256, paddedHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); // fill the padding - u8 zeroData[256*4*4] = {0}; + u8 zeroData[256*4*4]; + memset(zeroData, 0, sizeof(zeroData)); glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 192, 256, 2, GL_RGBA, GL_UNSIGNED_BYTE, zeroData); OSD::Init(this);