gl-util.h: Add GL ID != operator and TEXFBO::clear
TEXFBO::clear resets the struct into its state right after creation, nulling all IDs inside so they're invaid.
This commit is contained in:
		
							parent
							
								
									1767b200c7
								
							
						
					
					
						commit
						0af5e9d66c
					
				
					 1 changed files with 11 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -42,6 +42,10 @@ struct ID \
 | 
			
		|||
	{  \
 | 
			
		||||
		return gl == o.gl;  \
 | 
			
		||||
	}  \
 | 
			
		||||
	bool operator!=(const ID &o) const \
 | 
			
		||||
	{ \
 | 
			
		||||
		return !(*this == o); \
 | 
			
		||||
	} \
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/* 2D Texture */
 | 
			
		||||
| 
						 | 
				
			
			@ -236,6 +240,13 @@ struct TEXFBO
 | 
			
		|||
		FBO::del(obj.fbo);
 | 
			
		||||
		TEX::del(obj.tex);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	static inline void clear(TEXFBO &obj)
 | 
			
		||||
	{
 | 
			
		||||
		obj.tex = TEX::ID(0);
 | 
			
		||||
		obj.fbo = FBO::ID(0);
 | 
			
		||||
		obj.width = obj.height = 0;
 | 
			
		||||
	}
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#endif // GLUTIL_H
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue