mirror of
				https://github.com/ocornut/imgui.git
				synced 2025-10-26 12:27:30 +00:00 
			
		
		
		
	This commit is contained in:
		| @@ -28,6 +28,14 @@ static unsigned int g_VboHandle = 0, g_VaoHandle = 0, g_ElementsHandle = 0; | ||||
| // - in your Render function, try translating your projection matrix by (0.5f,0.5f) or (0.375f,0.375f) | ||||
| void ImGui_ImplSdlGL3_RenderDrawLists(ImDrawData* draw_data) | ||||
| { | ||||
|     // Avoid rendering when minimized, scale coordinates for retina displays (screen coordinates != framebuffer coordinates) | ||||
|     ImGuiIO& io = ImGui::GetIO(); | ||||
|     int fb_width = (int)(io.DisplaySize.x * io.DisplayFramebufferScale.x); | ||||
|     int fb_height = (int)(io.DisplaySize.y * io.DisplayFramebufferScale.y); | ||||
|     if (fb_width == 0 || fb_height == 0) | ||||
|         return; | ||||
|     draw_data->ScaleClipRects(io.DisplayFramebufferScale); | ||||
|  | ||||
|     // Backup GL state | ||||
|     GLint last_program; glGetIntegerv(GL_CURRENT_PROGRAM, &last_program); | ||||
|     GLint last_texture; glGetIntegerv(GL_TEXTURE_BINDING_2D, &last_texture); | ||||
| @@ -53,14 +61,6 @@ void ImGui_ImplSdlGL3_RenderDrawLists(ImDrawData* draw_data) | ||||
|     glEnable(GL_SCISSOR_TEST); | ||||
|     glActiveTexture(GL_TEXTURE0); | ||||
|  | ||||
|     // Handle cases of screen coordinates != from framebuffer coordinates (e.g. retina displays) | ||||
|     ImGuiIO& io = ImGui::GetIO(); | ||||
|     int fb_width = (int)(io.DisplaySize.x * io.DisplayFramebufferScale.x); | ||||
|     int fb_height = (int)(io.DisplaySize.y * io.DisplayFramebufferScale.y); | ||||
|     if (fb_width == 0 || fb_height == 0) | ||||
|         return; | ||||
|     draw_data->ScaleClipRects(io.DisplayFramebufferScale); | ||||
|  | ||||
|     // Setup orthographic projection matrix | ||||
|     glViewport(0, 0, (GLsizei)fb_width, (GLsizei)fb_height); | ||||
|     const float ortho_projection[4][4] = | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 ocornut
					ocornut