Kaydet (Commit) 418edcf0 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

fix multisample support in OpenGL

Change-Id: I7e530f5ae8d83d275df554781847b525b38bf4c7
üst 5d42bbdc
...@@ -235,6 +235,7 @@ GLfloat texCoords[] = { ...@@ -235,6 +235,7 @@ GLfloat texCoords[] = {
int OpenGLRender::InitOpenGL(GLWindow aWindow) int OpenGLRender::InitOpenGL(GLWindow aWindow)
{ {
glWin = aWindow; glWin = aWindow;
mbArbMultisampleSupported = glWin.bMultiSampleSupported;
if(!bGlewInit) if(!bGlewInit)
{ {
glewExperimental = GL_TRUE; glewExperimental = GL_TRUE;
......
...@@ -65,6 +65,7 @@ struct GLWindow ...@@ -65,6 +65,7 @@ struct GLWindow
unsigned int Width; unsigned int Width;
unsigned int Height; unsigned int Height;
const GLubyte* GLExtensions; const GLubyte* GLExtensions;
bool bMultiSampleSupported;
bool HasGLExtension( const char* name ) { return gluCheckExtension( (const GLubyte*) name, GLExtensions ); } bool HasGLExtension( const char* name ) { return gluCheckExtension( (const GLubyte*) name, GLExtensions ); }
...@@ -86,7 +87,8 @@ struct GLWindow ...@@ -86,7 +87,8 @@ struct GLWindow
bpp(0), bpp(0),
Width(0), Width(0),
Height(0), Height(0),
GLExtensions(NULL) GLExtensions(NULL),
bMultiSampleSupported(false)
{ {
} }
}; };
......
...@@ -369,6 +369,7 @@ bool OpenGLContext::init() ...@@ -369,6 +369,7 @@ bool OpenGLContext::init()
bool bMultiSampleSupport = InitMultisample(PixelFormatFront, WindowPix); bool bMultiSampleSupport = InitMultisample(PixelFormatFront, WindowPix);
if (bMultiSampleSupport) if (bMultiSampleSupport)
{ {
m_aGLWin.bMultiSampleSupported = true;
} }
else else
{ {
...@@ -568,6 +569,9 @@ bool OpenGLContext::initWindow() ...@@ -568,6 +569,9 @@ bool OpenGLContext::initWindow()
XFree( pVi ); XFree( pVi );
} }
if(best_num_samp > 0)
m_aGLWin.bMultiSampleSupported = true;
XVisualInfo* vi = glXGetVisualFromFBConfig( m_aGLWin.dpy, pFBC[best_fbc] ); XVisualInfo* vi = glXGetVisualFromFBConfig( m_aGLWin.dpy, pFBC[best_fbc] );
if( vi ) if( vi )
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment