@@ -59,7 +59,7 @@ namespace gbemuGUI
5959 m_Window = SDL_CreateWindow (m_Title, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 1280 , 720 , window_flags);
6060 m_GLContext = SDL_GL_CreateContext (m_Window);
6161 SDL_GL_MakeCurrent (m_Window, m_GLContext);
62- SDL_GL_SetSwapInterval (1 ); // Enable vsync
62+ // SDL_GL_SetSwapInterval(1); // Enable vsync
6363
6464
6565 IMGUI_CHECKVERSION ();
@@ -71,6 +71,7 @@ namespace gbemuGUI
7171 ImGui::GetIO ().ConfigFlags |= ImGuiConfigFlags_DockingEnable;
7272
7373 gbemuGUI::ImGuiThemeSetup ();
74+ m_Texture = SDL_CreateTexture (m_Renderer, SDL_PIXELFORMAT_RGBA32, SDL_TEXTUREACCESS_STREAMING, 160 , 144 );
7475
7576 }
7677
@@ -99,7 +100,11 @@ namespace gbemuGUI
99100 gbemuGUI::InitUI ();
100101
101102 // Update the texture
102- // SDL_UpdateTexture(m_Texture, NULL, renderArray, 160 * 4);
103+ // for (int i = 0; i < 160 * 144; i++)
104+ // {
105+ // renderArray[i] = 0x00FF00FF;
106+ // }
107+ SDL_UpdateTexture (m_Texture, NULL , renderArray, 160 * 4 );
103108
104109 bool show_demo_window = true ;
105110 // 2. Show a simple gui that we create ourselves. We use a Begin/End pair to create a named gui.
@@ -119,6 +124,7 @@ namespace gbemuGUI
119124// ImGui::Image((ImTextureID)(intptr_t)m_Texture, ImVec2(512, 512));
120125
121126 ImGui::Text (" Application average %.3f ms/frame (%.1f FPS)" , 1000 .0f / ImGui::GetIO ().Framerate , ImGui::GetIO ().Framerate );
127+ printf (" Application average %.3f ms/frame (%.1f FPS)\n " , 1000 .0f / ImGui::GetIO ().Framerate , ImGui::GetIO ().Framerate );
122128 ImGui::End ();
123129 }
124130
@@ -142,8 +148,7 @@ namespace gbemuGUI
142148 SDL_GL_MakeCurrent (backup_current_window, backup_current_context);
143149 }
144150
145-
146- // SDL_GL_SwapWindow(m_Window);
151+ SDL_GL_SwapWindow (m_Window);
147152 }
148153
149154 void Window::Exit ()
0 commit comments