mirror of
				https://github.com/gnif/LookingGlass.git
				synced 2025-11-03 22:22:08 +00:00 
			
		
		
		
	[client] egl: query maximum multisample support for MSAA context
Based on @rLink234's work in 4ac781b4516678b6c59d9ecf4a61df64a01ec8c1 Fixes #128
This commit is contained in:
		@@ -21,6 +21,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#include "common/debug.h"
 | 
					#include "common/debug.h"
 | 
				
			||||||
#include "common/option.h"
 | 
					#include "common/option.h"
 | 
				
			||||||
 | 
					#include "common/sysinfo.h"
 | 
				
			||||||
#include "utils.h"
 | 
					#include "utils.h"
 | 
				
			||||||
#include "dynamic/fonts.h"
 | 
					#include "dynamic/fonts.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -168,10 +169,18 @@ bool egl_initialize(void * opaque, Uint32 * sdlFlags)
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  *sdlFlags = SDL_WINDOW_OPENGL;
 | 
					  *sdlFlags = SDL_WINDOW_OPENGL;
 | 
				
			||||||
  SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER        , 1);
 | 
					  SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER        , 1);
 | 
				
			||||||
  SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS  , 1);
 | 
					 | 
				
			||||||
  SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES  , 4);
 | 
					 | 
				
			||||||
  SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
 | 
					  SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  int maxSamples = sysinfo_gfx_max_multisample();
 | 
				
			||||||
 | 
					  if (maxSamples > 1)
 | 
				
			||||||
 | 
					  {
 | 
				
			||||||
 | 
					    if (maxSamples > 4)
 | 
				
			||||||
 | 
					      maxSamples = 4;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1);
 | 
				
			||||||
 | 
					    SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, maxSamples);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return true;
 | 
					  return true;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user