mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 10:50:04 +00:00 
			
		
		
		
	Add texture atlas build timing
This commit is contained in:
		
							parent
							
								
									bbaae5d1ba
								
							
						
					
					
						commit
						2c0991cebc
					
				
					 1 changed files with 7 additions and 0 deletions
				
			
		|  | @ -15,6 +15,7 @@ | |||
| 
 | ||||
| #include <boost/gil/extension/io/png.hpp> | ||||
| #include <boost/iostreams/stream.hpp> | ||||
| #include <boost/timer/timer.hpp> | ||||
| #include <cpr/cpr.h> | ||||
| #include <stb_image.h> | ||||
| #include <stb_rect_pack.h> | ||||
|  | @ -108,6 +109,9 @@ void TextureAtlas::BuildAtlas(std::size_t width, std::size_t height) | |||
| { | ||||
|    logger_->debug("Building {}x{} texture atlas", width, height); | ||||
| 
 | ||||
|    boost::timer::cpu_timer timer {}; | ||||
|    timer.start(); | ||||
| 
 | ||||
|    if (width > INT_MAX || height > INT_MAX) | ||||
|    { | ||||
|       logger_->error("Cannot build texture atlas of size {}x{}", width, height); | ||||
|  | @ -297,6 +301,9 @@ void TextureAtlas::BuildAtlas(std::size_t width, std::size_t height) | |||
| 
 | ||||
|    // Mark the need to buffer the atlas
 | ||||
|    ++p->buildCount_; | ||||
| 
 | ||||
|    timer.stop(); | ||||
|    logger_->debug("Texture atlas built in {}", timer.format(6, "%ws")); | ||||
| } | ||||
| 
 | ||||
| void TextureAtlas::BufferAtlas(gl::OpenGLFunctions& gl, GLuint texture) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat