@@ -553,6 +553,8 @@ void PCSX::GUI::init(std::function<void()> applyArguments) {
553553 glfwSetInputMode (m_window, GLFW_CURSOR, GLFW_CURSOR_NORMAL);
554554 });
555555 m_listener.listen <Events::ExecutionFlow::Run>([this ](const auto & event) {
556+ m_enableSplashScreen = false ;
557+
556558 glfwSwapInterval (0 );
557559 setRawMouseMotion ();
558560 });
@@ -951,16 +953,19 @@ void PCSX::GUI::startFrame() {
951953 glBindTexture (GL_TEXTURE_2D, m_offscreenTextures[1 ]);
952954 glTexImage2D (GL_TEXTURE_2D, 0 , GL_RGBA, m_renderSize.x , m_renderSize.y , 0 , GL_RGBA, GL_UNSIGNED_BYTE, 0 );
953955
954- if (m_clearTextures) {
955- const auto allocSize = static_cast <size_t >(std::ceil (m_renderSize.x * m_renderSize.y * sizeof (uint32_t )));
956- GLubyte* data = new GLubyte[allocSize]();
956+ if (m_clearTextures || m_enableSplashScreen) {
957+ m_clearTextures = false ;
958+ std::unique_ptr<uint32_t []> splashImageData = getSplashScreen (m_renderSize.x , m_renderSize.y );
959+
960+ // Upload to both textures
957961 for (int i = 0 ; i < 2 ; i++) {
958962 glBindTexture (GL_TEXTURE_2D, m_offscreenTextures[i]);
963+ glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
964+ glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
965+
959966 glTexSubImage2D (GL_TEXTURE_2D, 0 , 0 , 0 , m_renderSize.x , m_renderSize.y , GL_RGBA, GL_UNSIGNED_BYTE,
960- data );
967+ splashImageData. get () );
961968 }
962- m_clearTextures = false ;
963- delete[] data;
964969 }
965970
966971 glBindRenderbuffer (GL_RENDERBUFFER, m_offscreenDepthBuffer);
@@ -1067,9 +1072,6 @@ void PCSX::GUI::flip() {
10671072 glBindFramebuffer (GL_FRAMEBUFFER, m_offscreenFrameBuffer);
10681073 glBindTexture (GL_TEXTURE_2D, m_offscreenTextures[m_currentTexture]);
10691074
1070- glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
1071- glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
1072-
10731075 glBindRenderbuffer (GL_RENDERBUFFER, m_offscreenDepthBuffer);
10741076 glFramebufferRenderbuffer (GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, m_offscreenDepthBuffer);
10751077 GLuint texture = m_offscreenTextures[m_currentTexture];
@@ -2890,4 +2892,4 @@ void PCSX::GUI::changeScale(float scale) {
28902892 m_currentScale = scale;
28912893 m_allScales.emplace (scale);
28922894 ImGui::SetCurrentFont (getMainFont ());
2893- }
2895+ }
0 commit comments