forked from eden-emu/eden
		
	video_core: vk_blit_screen: Rotate viewport for Android landscape.
This commit is contained in:
		
							parent
							
								
									cdbab60bbb
								
							
						
					
					
						commit
						18527a8c42
					
				
					 1 changed files with 8 additions and 0 deletions
				
			
		|  | @ -76,10 +76,18 @@ struct ScreenRectVertex { | ||||||
| 
 | 
 | ||||||
| constexpr std::array<f32, 4 * 4> MakeOrthographicMatrix(f32 width, f32 height) { | constexpr std::array<f32, 4 * 4> MakeOrthographicMatrix(f32 width, f32 height) { | ||||||
|     // clang-format off
 |     // clang-format off
 | ||||||
|  | #ifdef ANDROID | ||||||
|  |     // Android renders in portrait, so rotate the matrix.
 | ||||||
|  |     return { 0.f,          2.f / width, 0.f, 0.f, | ||||||
|  |             -2.f / height, 0.f,         0.f, 0.f, | ||||||
|  |              0.f,          0.f,         1.f, 0.f, | ||||||
|  |              1.f,         -1.f,         0.f, 1.f}; | ||||||
|  | #else | ||||||
|     return { 2.f / width, 0.f,          0.f, 0.f, |     return { 2.f / width, 0.f,          0.f, 0.f, | ||||||
|              0.f,         2.f / height, 0.f, 0.f, |              0.f,         2.f / height, 0.f, 0.f, | ||||||
|              0.f,         0.f,          1.f, 0.f, |              0.f,         0.f,          1.f, 0.f, | ||||||
|             -1.f,        -1.f,          0.f, 1.f}; |             -1.f,        -1.f,          0.f, 1.f}; | ||||||
|  | #endif // ANDROID
 | ||||||
|     // clang-format on
 |     // clang-format on
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 bunnei
						bunnei