Raise exception on too big textures
This commit is contained in:
		
							parent
							
								
									31c007b541
								
							
						
					
					
						commit
						f81e20cc68
					
				
					 7 changed files with 41 additions and 43 deletions
				
			
		| 
						 | 
				
			
			@ -20,6 +20,9 @@
 | 
			
		|||
*/
 | 
			
		||||
 | 
			
		||||
#include "texpool.h"
 | 
			
		||||
#include "exception.h"
 | 
			
		||||
#include "globalstate.h"
 | 
			
		||||
#include "glstate.h"
 | 
			
		||||
 | 
			
		||||
#include <QHash>
 | 
			
		||||
#include <QQueue>
 | 
			
		||||
| 
						 | 
				
			
			@ -121,7 +124,11 @@ TexFBO TexPool::request(int width, int height)
 | 
			
		|||
		return cobj.obj;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	// FIXME check here that requested dimensions don't exceed OpenGL limits
 | 
			
		||||
	int maxSize = glState.caps.maxTexSize;
 | 
			
		||||
	if (width > maxSize || height > maxSize)
 | 
			
		||||
		throw Exception(Exception::MKXPError,
 | 
			
		||||
	                    "Texture dimensions [%s, %s] exceed hardware capabilities",
 | 
			
		||||
	                    QByteArray::number(width), QByteArray::number(height));
 | 
			
		||||
 | 
			
		||||
	/* Nope, create it instead */
 | 
			
		||||
	TexFBO::init(cobj.obj);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue