Remove: [Video] no longer draw in a thread
Drawing in a thread is a bit odd, and often leads to surprising issues. For example, OpenGL would only allow it if you move the full context to the thread. Which is not always easily done on all OSes. In general, the advise is to handle system events and drawing from the main thread, and do everything else in other threads. So, let's be more like other games. Additionally, putting the drawing routine in a thread was only done for a few targets. Upcoming commit will move the GameLoop in a thread, which will work for all targets.
This commit is contained in:
		
				
					committed by
					
						
						Patric Stout
					
				
			
			
				
	
			
			
			
						parent
						
							56911a86ea
						
					
				
				
					commit
					4610aa7ae3
				
			@@ -29,30 +29,19 @@ public:
 | 
			
		||||
 | 
			
		||||
	bool AfterBlitterChange() override;
 | 
			
		||||
 | 
			
		||||
	void AcquireBlitterLock() override;
 | 
			
		||||
 | 
			
		||||
	void ReleaseBlitterLock() override;
 | 
			
		||||
 | 
			
		||||
	bool ClaimMousePointer() override;
 | 
			
		||||
 | 
			
		||||
	const char *GetName() const override { return "sdl"; }
 | 
			
		||||
 | 
			
		||||
protected:
 | 
			
		||||
	void InputLoop() override;
 | 
			
		||||
	bool LockVideoBuffer() override;
 | 
			
		||||
	void UnlockVideoBuffer() override;
 | 
			
		||||
	void Paint() override;
 | 
			
		||||
	void PaintThread() override;
 | 
			
		||||
	void CheckPaletteAnim() override;
 | 
			
		||||
	bool PollEvent() override;
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
	std::unique_lock<std::recursive_mutex> draw_lock;
 | 
			
		||||
 | 
			
		||||
	bool CreateMainSurface(uint w, uint h);
 | 
			
		||||
	void SetupKeyboard();
 | 
			
		||||
 | 
			
		||||
	static void PaintThreadThunk(VideoDriver_SDL *drv);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/** Factory for the SDL video driver. */
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user