added missing _T()s; deTABified
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17340 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: glcanvas.cpp
|
||||
// Name: gtk/glcanvas.cpp
|
||||
// Purpose: wxGLCanvas, for using OpenGL/Mesa with wxWindows and GTK
|
||||
// Author: Robert Roebling
|
||||
// Modified by:
|
||||
@@ -24,7 +24,8 @@
|
||||
#include "wx/module.h"
|
||||
#include "wx/app.h"
|
||||
|
||||
extern "C" {
|
||||
extern "C"
|
||||
{
|
||||
#include "gtk/gtk.h"
|
||||
#include "gdk/gdk.h"
|
||||
#include "gdk/gdkx.h"
|
||||
@@ -59,11 +60,11 @@ wxGLContext::wxGLContext( bool WXUNUSED(isRGB), wxWindow *win, const wxPalette&
|
||||
wxGLCanvas *gc = (wxGLCanvas*) win;
|
||||
XVisualInfo *vi = (XVisualInfo *) gc->m_vi;
|
||||
|
||||
wxCHECK_RET( vi, "invalid visual for OpenGl" );
|
||||
wxCHECK_RET( vi, _T("invalid visual for OpenGl") );
|
||||
|
||||
m_glContext = glXCreateContext( GDK_DISPLAY(), vi, None, GL_TRUE );
|
||||
|
||||
wxCHECK_RET( m_glContext, "Couldn't create OpenGl context" );
|
||||
wxCHECK_RET( m_glContext, _T("Couldn't create OpenGl context") );
|
||||
}
|
||||
|
||||
wxGLContext::wxGLContext(
|
||||
@@ -78,14 +79,16 @@ wxGLContext::wxGLContext(
|
||||
wxGLCanvas *gc = (wxGLCanvas*) win;
|
||||
XVisualInfo *vi = (XVisualInfo *) gc->m_vi;
|
||||
|
||||
wxCHECK_RET( vi, "invalid visual for OpenGl" );
|
||||
wxCHECK_RET( vi, _T("invalid visual for OpenGl") );
|
||||
|
||||
if( other != 0 )
|
||||
m_glContext = glXCreateContext( GDK_DISPLAY(), vi, other->m_glContext, GL_TRUE );
|
||||
else
|
||||
m_glContext = glXCreateContext( GDK_DISPLAY(), vi, None, GL_TRUE );
|
||||
m_glContext = glXCreateContext( GDK_DISPLAY(), vi,
|
||||
other ? other->m_glContext : None,
|
||||
GL_TRUE );
|
||||
|
||||
wxCHECK_RET( m_glContext, "Couldn't create OpenGl context" );
|
||||
if ( !m_glContext )
|
||||
{
|
||||
wxFAIL_MSG( _T("Couldn't create OpenGl context") );
|
||||
}
|
||||
}
|
||||
|
||||
wxGLContext::~wxGLContext()
|
||||
@@ -292,16 +295,19 @@ bool wxGLCanvas::Create( wxWindow *parent,
|
||||
m_nativeSizeEvent = TRUE;
|
||||
|
||||
XVisualInfo *vi = NULL;
|
||||
if (wxTheApp->m_glVisualInfo != NULL) {
|
||||
if (wxTheApp->m_glVisualInfo != NULL)
|
||||
{
|
||||
vi = (XVisualInfo *) wxTheApp->m_glVisualInfo;
|
||||
m_canFreeVi = FALSE; // owned by wxTheApp - don't free upon destruction
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
vi = (XVisualInfo *) ChooseGLVisual(attribList);
|
||||
m_canFreeVi = TRUE;
|
||||
}
|
||||
m_vi = vi; // save for later use
|
||||
|
||||
wxCHECK_MSG( m_vi, FALSE, "required visual couldn't be found" );
|
||||
wxCHECK_MSG( m_vi, FALSE, _T("required visual couldn't be found") );
|
||||
|
||||
GdkVisual *visual = gdkx_visual_get( vi->visualid );
|
||||
GdkColormap *colormap = gdk_colormap_new( gdkx_visual_get(vi->visualid), TRUE );
|
||||
@@ -421,7 +427,8 @@ void* wxGLCanvas::ChooseGLVisual(int *attribList)
|
||||
|
||||
void wxGLCanvas::SwapBuffers()
|
||||
{
|
||||
if (m_glContext) m_glContext->SwapBuffers();
|
||||
if (m_glContext)
|
||||
m_glContext->SwapBuffers();
|
||||
}
|
||||
|
||||
void wxGLCanvas::OnSize(wxSizeEvent& WXUNUSED(event))
|
||||
@@ -430,12 +437,14 @@ void wxGLCanvas::OnSize(wxSizeEvent& WXUNUSED(event))
|
||||
|
||||
void wxGLCanvas::SetCurrent()
|
||||
{
|
||||
if (m_glContext) m_glContext->SetCurrent();
|
||||
if (m_glContext)
|
||||
m_glContext->SetCurrent();
|
||||
}
|
||||
|
||||
void wxGLCanvas::SetColour( const char *colour )
|
||||
{
|
||||
if (m_glContext) m_glContext->SetColour( colour );
|
||||
if (m_glContext)
|
||||
m_glContext->SetColour( colour );
|
||||
}
|
||||
|
||||
void wxGLCanvas::OnInternalIdle()
|
||||
@@ -463,14 +472,18 @@ IMPLEMENT_CLASS(wxGLApp, wxApp)
|
||||
|
||||
wxGLApp::~wxGLApp()
|
||||
{
|
||||
if (m_glVisualInfo) XFree(m_glVisualInfo);
|
||||
if (m_glVisualInfo)
|
||||
XFree(m_glVisualInfo);
|
||||
}
|
||||
|
||||
bool wxGLApp::InitGLVisual(int *attribList)
|
||||
{
|
||||
if (m_glVisualInfo) XFree(m_glVisualInfo);
|
||||
if (m_glVisualInfo)
|
||||
XFree(m_glVisualInfo);
|
||||
|
||||
m_glVisualInfo = wxGLCanvas::ChooseGLVisual(attribList);
|
||||
return (m_glVisualInfo != NULL);
|
||||
|
||||
return m_glVisualInfo != NULL;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: glcanvas.cpp
|
||||
// Name: gtk/glcanvas.cpp
|
||||
// Purpose: wxGLCanvas, for using OpenGL/Mesa with wxWindows and GTK
|
||||
// Author: Robert Roebling
|
||||
// Modified by:
|
||||
@@ -24,7 +24,8 @@
|
||||
#include "wx/module.h"
|
||||
#include "wx/app.h"
|
||||
|
||||
extern "C" {
|
||||
extern "C"
|
||||
{
|
||||
#include "gtk/gtk.h"
|
||||
#include "gdk/gdk.h"
|
||||
#include "gdk/gdkx.h"
|
||||
@@ -59,11 +60,11 @@ wxGLContext::wxGLContext( bool WXUNUSED(isRGB), wxWindow *win, const wxPalette&
|
||||
wxGLCanvas *gc = (wxGLCanvas*) win;
|
||||
XVisualInfo *vi = (XVisualInfo *) gc->m_vi;
|
||||
|
||||
wxCHECK_RET( vi, "invalid visual for OpenGl" );
|
||||
wxCHECK_RET( vi, _T("invalid visual for OpenGl") );
|
||||
|
||||
m_glContext = glXCreateContext( GDK_DISPLAY(), vi, None, GL_TRUE );
|
||||
|
||||
wxCHECK_RET( m_glContext, "Couldn't create OpenGl context" );
|
||||
wxCHECK_RET( m_glContext, _T("Couldn't create OpenGl context") );
|
||||
}
|
||||
|
||||
wxGLContext::wxGLContext(
|
||||
@@ -78,14 +79,16 @@ wxGLContext::wxGLContext(
|
||||
wxGLCanvas *gc = (wxGLCanvas*) win;
|
||||
XVisualInfo *vi = (XVisualInfo *) gc->m_vi;
|
||||
|
||||
wxCHECK_RET( vi, "invalid visual for OpenGl" );
|
||||
wxCHECK_RET( vi, _T("invalid visual for OpenGl") );
|
||||
|
||||
if( other != 0 )
|
||||
m_glContext = glXCreateContext( GDK_DISPLAY(), vi, other->m_glContext, GL_TRUE );
|
||||
else
|
||||
m_glContext = glXCreateContext( GDK_DISPLAY(), vi, None, GL_TRUE );
|
||||
m_glContext = glXCreateContext( GDK_DISPLAY(), vi,
|
||||
other ? other->m_glContext : None,
|
||||
GL_TRUE );
|
||||
|
||||
wxCHECK_RET( m_glContext, "Couldn't create OpenGl context" );
|
||||
if ( !m_glContext )
|
||||
{
|
||||
wxFAIL_MSG( _T("Couldn't create OpenGl context") );
|
||||
}
|
||||
}
|
||||
|
||||
wxGLContext::~wxGLContext()
|
||||
@@ -292,16 +295,19 @@ bool wxGLCanvas::Create( wxWindow *parent,
|
||||
m_nativeSizeEvent = TRUE;
|
||||
|
||||
XVisualInfo *vi = NULL;
|
||||
if (wxTheApp->m_glVisualInfo != NULL) {
|
||||
if (wxTheApp->m_glVisualInfo != NULL)
|
||||
{
|
||||
vi = (XVisualInfo *) wxTheApp->m_glVisualInfo;
|
||||
m_canFreeVi = FALSE; // owned by wxTheApp - don't free upon destruction
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
vi = (XVisualInfo *) ChooseGLVisual(attribList);
|
||||
m_canFreeVi = TRUE;
|
||||
}
|
||||
m_vi = vi; // save for later use
|
||||
|
||||
wxCHECK_MSG( m_vi, FALSE, "required visual couldn't be found" );
|
||||
wxCHECK_MSG( m_vi, FALSE, _T("required visual couldn't be found") );
|
||||
|
||||
GdkVisual *visual = gdkx_visual_get( vi->visualid );
|
||||
GdkColormap *colormap = gdk_colormap_new( gdkx_visual_get(vi->visualid), TRUE );
|
||||
@@ -421,7 +427,8 @@ void* wxGLCanvas::ChooseGLVisual(int *attribList)
|
||||
|
||||
void wxGLCanvas::SwapBuffers()
|
||||
{
|
||||
if (m_glContext) m_glContext->SwapBuffers();
|
||||
if (m_glContext)
|
||||
m_glContext->SwapBuffers();
|
||||
}
|
||||
|
||||
void wxGLCanvas::OnSize(wxSizeEvent& WXUNUSED(event))
|
||||
@@ -430,12 +437,14 @@ void wxGLCanvas::OnSize(wxSizeEvent& WXUNUSED(event))
|
||||
|
||||
void wxGLCanvas::SetCurrent()
|
||||
{
|
||||
if (m_glContext) m_glContext->SetCurrent();
|
||||
if (m_glContext)
|
||||
m_glContext->SetCurrent();
|
||||
}
|
||||
|
||||
void wxGLCanvas::SetColour( const char *colour )
|
||||
{
|
||||
if (m_glContext) m_glContext->SetColour( colour );
|
||||
if (m_glContext)
|
||||
m_glContext->SetColour( colour );
|
||||
}
|
||||
|
||||
void wxGLCanvas::OnInternalIdle()
|
||||
@@ -463,14 +472,18 @@ IMPLEMENT_CLASS(wxGLApp, wxApp)
|
||||
|
||||
wxGLApp::~wxGLApp()
|
||||
{
|
||||
if (m_glVisualInfo) XFree(m_glVisualInfo);
|
||||
if (m_glVisualInfo)
|
||||
XFree(m_glVisualInfo);
|
||||
}
|
||||
|
||||
bool wxGLApp::InitGLVisual(int *attribList)
|
||||
{
|
||||
if (m_glVisualInfo) XFree(m_glVisualInfo);
|
||||
if (m_glVisualInfo)
|
||||
XFree(m_glVisualInfo);
|
||||
|
||||
m_glVisualInfo = wxGLCanvas::ChooseGLVisual(attribList);
|
||||
return (m_glVisualInfo != NULL);
|
||||
|
||||
return m_glVisualInfo != NULL;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user