cleaner approach to handling the viewport bug
This commit is contained in:
		
							parent
							
								
									f42539e02b
								
							
						
					
					
						commit
						e87bdb8a95
					
				
					 2 changed files with 6 additions and 1 deletions
				
			
		| 
						 | 
					@ -52,6 +52,10 @@ struct GLProperty
 | 
				
			||||||
		set(value);
 | 
							set(value);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						void refresh()
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							apply(current);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
private:
 | 
					private:
 | 
				
			||||||
	virtual void apply(const T &value) = 0;
 | 
						virtual void apply(const T &value) = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -469,7 +469,8 @@ struct GraphicsPrivate
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		if (threadData->windowSizeMsg.pollChange(&winSize.x, &winSize.y))
 | 
							if (threadData->windowSizeMsg.pollChange(&winSize.x, &winSize.y))
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			glState.viewport.init(IntRect(0, 0, winSize.x, winSize.y));
 | 
								// some GL drivers change the viewport on window resize
 | 
				
			||||||
 | 
								glState.viewport.refresh();
 | 
				
			||||||
			recalculateScreenSize();
 | 
								recalculateScreenSize();
 | 
				
			||||||
			screen.setScreenSize(winSize.x, winSize.y);
 | 
								screen.setScreenSize(winSize.x, winSize.y);
 | 
				
			||||||
			updateScreenResoRatio();
 | 
								updateScreenResoRatio();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue