Whitespace fixes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34994 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -159,7 +159,8 @@ void wxGLContext::SetCurrent()
|
|||||||
|
|
||||||
if (wxGLCanvas::GetGLXVersion() >= 13)
|
if (wxGLCanvas::GetGLXVersion() >= 13)
|
||||||
// GLX >= 1.3
|
// GLX >= 1.3
|
||||||
glXMakeContextCurrent( GDK_DISPLAY(), GDK_WINDOW_XWINDOW(window), GDK_WINDOW_XWINDOW(window), m_glContext );
|
glXMakeContextCurrent( GDK_DISPLAY(), GDK_WINDOW_XWINDOW(window),
|
||||||
|
GDK_WINDOW_XWINDOW(window), m_glContext );
|
||||||
else
|
else
|
||||||
// GLX <= 1.2
|
// GLX <= 1.2
|
||||||
glXMakeCurrent( GDK_DISPLAY(), GDK_WINDOW_XWINDOW(window), m_glContext );
|
glXMakeCurrent( GDK_DISPLAY(), GDK_WINDOW_XWINDOW(window), m_glContext );
|
||||||
@@ -389,8 +390,10 @@ bool wxGLCanvas::Create( wxWindow *parent,
|
|||||||
else
|
else
|
||||||
// GLX <= 1.2
|
// GLX <= 1.2
|
||||||
vi = (XVisualInfo *) ChooseGLVisual(attribList);
|
vi = (XVisualInfo *) ChooseGLVisual(attribList);
|
||||||
|
|
||||||
m_canFreeVi = TRUE;
|
m_canFreeVi = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_vi = vi; // save for later use
|
m_vi = vi; // save for later use
|
||||||
|
|
||||||
wxCHECK_MSG( m_vi, FALSE, _T("required visual couldn't be found") );
|
wxCHECK_MSG( m_vi, FALSE, _T("required visual couldn't be found") );
|
||||||
@@ -445,10 +448,12 @@ bool wxGLCanvas::Create( wxWindow *parent,
|
|||||||
wxGLCanvas::~wxGLCanvas()
|
wxGLCanvas::~wxGLCanvas()
|
||||||
{
|
{
|
||||||
GLXFBConfig * fbc = (GLXFBConfig *) m_fbc;
|
GLXFBConfig * fbc = (GLXFBConfig *) m_fbc;
|
||||||
if (fbc && m_canFreeFBC) XFree( fbc );
|
if (fbc && m_canFreeFBC)
|
||||||
|
XFree( fbc );
|
||||||
|
|
||||||
XVisualInfo *vi = (XVisualInfo *) m_vi;
|
XVisualInfo *vi = (XVisualInfo *) m_vi;
|
||||||
if (vi && m_canFreeVi) XFree( vi );
|
if (vi && m_canFreeVi)
|
||||||
|
XFree( vi );
|
||||||
|
|
||||||
delete m_glContext;
|
delete m_glContext;
|
||||||
}
|
}
|
||||||
@@ -510,9 +515,13 @@ void wxGLCanvas::GetGLAttribListFromWX(int *wx_attribList, int *gl_attribList )
|
|||||||
gl_attribList[p++] = GLX_RGBA;
|
gl_attribList[p++] = GLX_RGBA;
|
||||||
break;
|
break;
|
||||||
case WX_GL_BUFFER_SIZE:
|
case WX_GL_BUFFER_SIZE:
|
||||||
gl_attribList[p++]=GLX_BUFFER_SIZE; gl_attribList[p++]=wx_attribList[arg++]; break;
|
gl_attribList[p++] = GLX_BUFFER_SIZE;
|
||||||
|
gl_attribList[p++] = wx_attribList[arg++];
|
||||||
|
break;
|
||||||
case WX_GL_LEVEL:
|
case WX_GL_LEVEL:
|
||||||
gl_attribList[p++]=GLX_LEVEL; gl_attribList[p++]=wx_attribList[arg++]; break;
|
gl_attribList[p++] = GLX_LEVEL;
|
||||||
|
gl_attribList[p++] = wx_attribList[arg++];
|
||||||
|
break;
|
||||||
case WX_GL_DOUBLEBUFFER:
|
case WX_GL_DOUBLEBUFFER:
|
||||||
if (wxGLCanvas::GetGLXVersion() <= 12)
|
if (wxGLCanvas::GetGLXVersion() <= 12)
|
||||||
gl_attribList[p++] = GLX_DOUBLEBUFFER;
|
gl_attribList[p++] = GLX_DOUBLEBUFFER;
|
||||||
@@ -520,35 +529,61 @@ void wxGLCanvas::GetGLAttribListFromWX(int *wx_attribList, int *gl_attribList )
|
|||||||
// for GLX >= 1.3, GLX_DOUBLEBUFFER format is different (1 <=> True)
|
// for GLX >= 1.3, GLX_DOUBLEBUFFER format is different (1 <=> True)
|
||||||
// it seems this flag is useless for some hardware opengl implementation.
|
// it seems this flag is useless for some hardware opengl implementation.
|
||||||
// but for Mesa 6.2.1, this flag is used so don't ignore it.
|
// but for Mesa 6.2.1, this flag is used so don't ignore it.
|
||||||
gl_attribList[p++] = GLX_DOUBLEBUFFER; gl_attribList[p++]=1;
|
gl_attribList[p++] = GLX_DOUBLEBUFFER;
|
||||||
|
gl_attribList[p++] = 1;
|
||||||
|
break;
|
||||||
|
case WX_GL_STEREO:
|
||||||
|
gl_attribList[p++] = GLX_STEREO;
|
||||||
break;
|
break;
|
||||||
case WX_GL_STEREO: gl_attribList[p++] = GLX_STEREO; break;
|
|
||||||
case WX_GL_AUX_BUFFERS:
|
case WX_GL_AUX_BUFFERS:
|
||||||
gl_attribList[p++]=GLX_AUX_BUFFERS; gl_attribList[p++]=wx_attribList[arg++]; break;
|
gl_attribList[p++] = GLX_AUX_BUFFERS;
|
||||||
|
gl_attribList[p++] = wx_attribList[arg++];
|
||||||
|
break;
|
||||||
case WX_GL_MIN_RED:
|
case WX_GL_MIN_RED:
|
||||||
gl_attribList[p++]=GLX_RED_SIZE; gl_attribList[p++]=wx_attribList[arg++]; break;
|
gl_attribList[p++] = GLX_RED_SIZE;
|
||||||
|
gl_attribList[p++] = wx_attribList[arg++];
|
||||||
|
break;
|
||||||
case WX_GL_MIN_GREEN:
|
case WX_GL_MIN_GREEN:
|
||||||
gl_attribList[p++]=GLX_GREEN_SIZE; gl_attribList[p++]=wx_attribList[arg++]; break;
|
gl_attribList[p++] = GLX_GREEN_SIZE;
|
||||||
|
gl_attribList[p++] = wx_attribList[arg++];
|
||||||
|
break;
|
||||||
case WX_GL_MIN_BLUE:
|
case WX_GL_MIN_BLUE:
|
||||||
gl_attribList[p++]=GLX_BLUE_SIZE; gl_attribList[p++]=wx_attribList[arg++]; break;
|
gl_attribList[p++] = GLX_BLUE_SIZE;
|
||||||
|
gl_attribList[p++] = wx_attribList[arg++];
|
||||||
|
break;
|
||||||
case WX_GL_MIN_ALPHA:
|
case WX_GL_MIN_ALPHA:
|
||||||
gl_attribList[p++]=GLX_ALPHA_SIZE; gl_attribList[p++]=wx_attribList[arg++]; break;
|
gl_attribList[p++] = GLX_ALPHA_SIZE;
|
||||||
|
gl_attribList[p++] = wx_attribList[arg++];
|
||||||
|
break;
|
||||||
case WX_GL_DEPTH_SIZE:
|
case WX_GL_DEPTH_SIZE:
|
||||||
gl_attribList[p++]=GLX_DEPTH_SIZE; gl_attribList[p++]=wx_attribList[arg++]; break;
|
gl_attribList[p++] = GLX_DEPTH_SIZE;
|
||||||
|
gl_attribList[p++] = wx_attribList[arg++];
|
||||||
|
break;
|
||||||
case WX_GL_STENCIL_SIZE:
|
case WX_GL_STENCIL_SIZE:
|
||||||
gl_attribList[p++]=GLX_STENCIL_SIZE; gl_attribList[p++]=wx_attribList[arg++]; break;
|
gl_attribList[p++] = GLX_STENCIL_SIZE;
|
||||||
|
gl_attribList[p++] = wx_attribList[arg++];
|
||||||
|
break;
|
||||||
case WX_GL_MIN_ACCUM_RED:
|
case WX_GL_MIN_ACCUM_RED:
|
||||||
gl_attribList[p++]=GLX_ACCUM_RED_SIZE; gl_attribList[p++]=wx_attribList[arg++]; break;
|
gl_attribList[p++] = GLX_ACCUM_RED_SIZE;
|
||||||
|
gl_attribList[p++] = wx_attribList[arg++];
|
||||||
|
break;
|
||||||
case WX_GL_MIN_ACCUM_GREEN:
|
case WX_GL_MIN_ACCUM_GREEN:
|
||||||
gl_attribList[p++]=GLX_ACCUM_GREEN_SIZE; gl_attribList[p++]=wx_attribList[arg++]; break;
|
gl_attribList[p++] = GLX_ACCUM_GREEN_SIZE;
|
||||||
|
gl_attribList[p++] = wx_attribList[arg++];
|
||||||
|
break;
|
||||||
case WX_GL_MIN_ACCUM_BLUE:
|
case WX_GL_MIN_ACCUM_BLUE:
|
||||||
gl_attribList[p++]=GLX_ACCUM_BLUE_SIZE; gl_attribList[p++]=wx_attribList[arg++]; break;
|
gl_attribList[p++] = GLX_ACCUM_BLUE_SIZE;
|
||||||
|
gl_attribList[p++] = wx_attribList[arg++];
|
||||||
|
break;
|
||||||
case WX_GL_MIN_ACCUM_ALPHA:
|
case WX_GL_MIN_ACCUM_ALPHA:
|
||||||
gl_attribList[p++]=GLX_ACCUM_ALPHA_SIZE; gl_attribList[p++]=wx_attribList[arg++]; break;
|
gl_attribList[p++] = GLX_ACCUM_ALPHA_SIZE;
|
||||||
|
gl_attribList[p++] = wx_attribList[arg++];
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gl_attribList[p] = 0;
|
gl_attribList[p] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -659,4 +694,3 @@ bool wxGLApp::InitGLVisual(int *attribList)
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
// wxUSE_GLCANVAS
|
// wxUSE_GLCANVAS
|
||||||
|
|
||||||
|
@@ -159,7 +159,8 @@ void wxGLContext::SetCurrent()
|
|||||||
|
|
||||||
if (wxGLCanvas::GetGLXVersion() >= 13)
|
if (wxGLCanvas::GetGLXVersion() >= 13)
|
||||||
// GLX >= 1.3
|
// GLX >= 1.3
|
||||||
glXMakeContextCurrent( GDK_DISPLAY(), GDK_WINDOW_XWINDOW(window), GDK_WINDOW_XWINDOW(window), m_glContext );
|
glXMakeContextCurrent( GDK_DISPLAY(), GDK_WINDOW_XWINDOW(window),
|
||||||
|
GDK_WINDOW_XWINDOW(window), m_glContext );
|
||||||
else
|
else
|
||||||
// GLX <= 1.2
|
// GLX <= 1.2
|
||||||
glXMakeCurrent( GDK_DISPLAY(), GDK_WINDOW_XWINDOW(window), m_glContext );
|
glXMakeCurrent( GDK_DISPLAY(), GDK_WINDOW_XWINDOW(window), m_glContext );
|
||||||
@@ -389,8 +390,10 @@ bool wxGLCanvas::Create( wxWindow *parent,
|
|||||||
else
|
else
|
||||||
// GLX <= 1.2
|
// GLX <= 1.2
|
||||||
vi = (XVisualInfo *) ChooseGLVisual(attribList);
|
vi = (XVisualInfo *) ChooseGLVisual(attribList);
|
||||||
|
|
||||||
m_canFreeVi = TRUE;
|
m_canFreeVi = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_vi = vi; // save for later use
|
m_vi = vi; // save for later use
|
||||||
|
|
||||||
wxCHECK_MSG( m_vi, FALSE, _T("required visual couldn't be found") );
|
wxCHECK_MSG( m_vi, FALSE, _T("required visual couldn't be found") );
|
||||||
@@ -445,10 +448,12 @@ bool wxGLCanvas::Create( wxWindow *parent,
|
|||||||
wxGLCanvas::~wxGLCanvas()
|
wxGLCanvas::~wxGLCanvas()
|
||||||
{
|
{
|
||||||
GLXFBConfig * fbc = (GLXFBConfig *) m_fbc;
|
GLXFBConfig * fbc = (GLXFBConfig *) m_fbc;
|
||||||
if (fbc && m_canFreeFBC) XFree( fbc );
|
if (fbc && m_canFreeFBC)
|
||||||
|
XFree( fbc );
|
||||||
|
|
||||||
XVisualInfo *vi = (XVisualInfo *) m_vi;
|
XVisualInfo *vi = (XVisualInfo *) m_vi;
|
||||||
if (vi && m_canFreeVi) XFree( vi );
|
if (vi && m_canFreeVi)
|
||||||
|
XFree( vi );
|
||||||
|
|
||||||
delete m_glContext;
|
delete m_glContext;
|
||||||
}
|
}
|
||||||
@@ -510,9 +515,13 @@ void wxGLCanvas::GetGLAttribListFromWX(int *wx_attribList, int *gl_attribList )
|
|||||||
gl_attribList[p++] = GLX_RGBA;
|
gl_attribList[p++] = GLX_RGBA;
|
||||||
break;
|
break;
|
||||||
case WX_GL_BUFFER_SIZE:
|
case WX_GL_BUFFER_SIZE:
|
||||||
gl_attribList[p++]=GLX_BUFFER_SIZE; gl_attribList[p++]=wx_attribList[arg++]; break;
|
gl_attribList[p++] = GLX_BUFFER_SIZE;
|
||||||
|
gl_attribList[p++] = wx_attribList[arg++];
|
||||||
|
break;
|
||||||
case WX_GL_LEVEL:
|
case WX_GL_LEVEL:
|
||||||
gl_attribList[p++]=GLX_LEVEL; gl_attribList[p++]=wx_attribList[arg++]; break;
|
gl_attribList[p++] = GLX_LEVEL;
|
||||||
|
gl_attribList[p++] = wx_attribList[arg++];
|
||||||
|
break;
|
||||||
case WX_GL_DOUBLEBUFFER:
|
case WX_GL_DOUBLEBUFFER:
|
||||||
if (wxGLCanvas::GetGLXVersion() <= 12)
|
if (wxGLCanvas::GetGLXVersion() <= 12)
|
||||||
gl_attribList[p++] = GLX_DOUBLEBUFFER;
|
gl_attribList[p++] = GLX_DOUBLEBUFFER;
|
||||||
@@ -520,35 +529,61 @@ void wxGLCanvas::GetGLAttribListFromWX(int *wx_attribList, int *gl_attribList )
|
|||||||
// for GLX >= 1.3, GLX_DOUBLEBUFFER format is different (1 <=> True)
|
// for GLX >= 1.3, GLX_DOUBLEBUFFER format is different (1 <=> True)
|
||||||
// it seems this flag is useless for some hardware opengl implementation.
|
// it seems this flag is useless for some hardware opengl implementation.
|
||||||
// but for Mesa 6.2.1, this flag is used so don't ignore it.
|
// but for Mesa 6.2.1, this flag is used so don't ignore it.
|
||||||
gl_attribList[p++] = GLX_DOUBLEBUFFER; gl_attribList[p++]=1;
|
gl_attribList[p++] = GLX_DOUBLEBUFFER;
|
||||||
|
gl_attribList[p++] = 1;
|
||||||
|
break;
|
||||||
|
case WX_GL_STEREO:
|
||||||
|
gl_attribList[p++] = GLX_STEREO;
|
||||||
break;
|
break;
|
||||||
case WX_GL_STEREO: gl_attribList[p++] = GLX_STEREO; break;
|
|
||||||
case WX_GL_AUX_BUFFERS:
|
case WX_GL_AUX_BUFFERS:
|
||||||
gl_attribList[p++]=GLX_AUX_BUFFERS; gl_attribList[p++]=wx_attribList[arg++]; break;
|
gl_attribList[p++] = GLX_AUX_BUFFERS;
|
||||||
|
gl_attribList[p++] = wx_attribList[arg++];
|
||||||
|
break;
|
||||||
case WX_GL_MIN_RED:
|
case WX_GL_MIN_RED:
|
||||||
gl_attribList[p++]=GLX_RED_SIZE; gl_attribList[p++]=wx_attribList[arg++]; break;
|
gl_attribList[p++] = GLX_RED_SIZE;
|
||||||
|
gl_attribList[p++] = wx_attribList[arg++];
|
||||||
|
break;
|
||||||
case WX_GL_MIN_GREEN:
|
case WX_GL_MIN_GREEN:
|
||||||
gl_attribList[p++]=GLX_GREEN_SIZE; gl_attribList[p++]=wx_attribList[arg++]; break;
|
gl_attribList[p++] = GLX_GREEN_SIZE;
|
||||||
|
gl_attribList[p++] = wx_attribList[arg++];
|
||||||
|
break;
|
||||||
case WX_GL_MIN_BLUE:
|
case WX_GL_MIN_BLUE:
|
||||||
gl_attribList[p++]=GLX_BLUE_SIZE; gl_attribList[p++]=wx_attribList[arg++]; break;
|
gl_attribList[p++] = GLX_BLUE_SIZE;
|
||||||
|
gl_attribList[p++] = wx_attribList[arg++];
|
||||||
|
break;
|
||||||
case WX_GL_MIN_ALPHA:
|
case WX_GL_MIN_ALPHA:
|
||||||
gl_attribList[p++]=GLX_ALPHA_SIZE; gl_attribList[p++]=wx_attribList[arg++]; break;
|
gl_attribList[p++] = GLX_ALPHA_SIZE;
|
||||||
|
gl_attribList[p++] = wx_attribList[arg++];
|
||||||
|
break;
|
||||||
case WX_GL_DEPTH_SIZE:
|
case WX_GL_DEPTH_SIZE:
|
||||||
gl_attribList[p++]=GLX_DEPTH_SIZE; gl_attribList[p++]=wx_attribList[arg++]; break;
|
gl_attribList[p++] = GLX_DEPTH_SIZE;
|
||||||
|
gl_attribList[p++] = wx_attribList[arg++];
|
||||||
|
break;
|
||||||
case WX_GL_STENCIL_SIZE:
|
case WX_GL_STENCIL_SIZE:
|
||||||
gl_attribList[p++]=GLX_STENCIL_SIZE; gl_attribList[p++]=wx_attribList[arg++]; break;
|
gl_attribList[p++] = GLX_STENCIL_SIZE;
|
||||||
|
gl_attribList[p++] = wx_attribList[arg++];
|
||||||
|
break;
|
||||||
case WX_GL_MIN_ACCUM_RED:
|
case WX_GL_MIN_ACCUM_RED:
|
||||||
gl_attribList[p++]=GLX_ACCUM_RED_SIZE; gl_attribList[p++]=wx_attribList[arg++]; break;
|
gl_attribList[p++] = GLX_ACCUM_RED_SIZE;
|
||||||
|
gl_attribList[p++] = wx_attribList[arg++];
|
||||||
|
break;
|
||||||
case WX_GL_MIN_ACCUM_GREEN:
|
case WX_GL_MIN_ACCUM_GREEN:
|
||||||
gl_attribList[p++]=GLX_ACCUM_GREEN_SIZE; gl_attribList[p++]=wx_attribList[arg++]; break;
|
gl_attribList[p++] = GLX_ACCUM_GREEN_SIZE;
|
||||||
|
gl_attribList[p++] = wx_attribList[arg++];
|
||||||
|
break;
|
||||||
case WX_GL_MIN_ACCUM_BLUE:
|
case WX_GL_MIN_ACCUM_BLUE:
|
||||||
gl_attribList[p++]=GLX_ACCUM_BLUE_SIZE; gl_attribList[p++]=wx_attribList[arg++]; break;
|
gl_attribList[p++] = GLX_ACCUM_BLUE_SIZE;
|
||||||
|
gl_attribList[p++] = wx_attribList[arg++];
|
||||||
|
break;
|
||||||
case WX_GL_MIN_ACCUM_ALPHA:
|
case WX_GL_MIN_ACCUM_ALPHA:
|
||||||
gl_attribList[p++]=GLX_ACCUM_ALPHA_SIZE; gl_attribList[p++]=wx_attribList[arg++]; break;
|
gl_attribList[p++] = GLX_ACCUM_ALPHA_SIZE;
|
||||||
|
gl_attribList[p++] = wx_attribList[arg++];
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gl_attribList[p] = 0;
|
gl_attribList[p] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -659,4 +694,3 @@ bool wxGLApp::InitGLVisual(int *attribList)
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
// wxUSE_GLCANVAS
|
// wxUSE_GLCANVAS
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user