diff --git a/libs/gtkutil/glwidget.h b/libs/gtkutil/glwidget.h index 43e26dc7..bf343590 100644 --- a/libs/gtkutil/glwidget.h +++ b/libs/gtkutil/glwidget.h @@ -25,7 +25,7 @@ typedef struct _GtkWidget GtkWidget; typedef int gint; typedef gint gboolean; - +#define NV_DRIVER_GAMMA_BUG 1 //! todo remove as soon, as driver will be fixed GtkWidget* glwidget_new( gboolean zbuffer ); void glwidget_swap_buffers( GtkWidget* widget ); gboolean glwidget_make_current( GtkWidget* widget ); diff --git a/radiant/texwindow.cpp b/radiant/texwindow.cpp index 7fc424dd..f96bc59d 100644 --- a/radiant/texwindow.cpp +++ b/radiant/texwindow.cpp @@ -2197,7 +2197,11 @@ GtkWidget* TextureBrowser_constructWindow( GtkWindow* toplevel ){ widget_set_visible( g_TextureBrowser.m_texture_scroll, g_TextureBrowser.m_showTextureScrollbar ); } { // gl_widget +#if NV_DRIVER_GAMMA_BUG + g_TextureBrowser.m_gl_widget = glwidget_new( TRUE ); +#else g_TextureBrowser.m_gl_widget = glwidget_new( FALSE ); +#endif gtk_widget_ref( g_TextureBrowser.m_gl_widget ); gtk_widget_set_events( g_TextureBrowser.m_gl_widget, GDK_DESTROY | GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_SCROLL_MASK ); diff --git a/radiant/xywindow.cpp b/radiant/xywindow.cpp index 960d9eb5..05b4ee49 100644 --- a/radiant/xywindow.cpp +++ b/radiant/xywindow.cpp @@ -58,12 +58,10 @@ #include "gtkutil/filechooser.h" #include "gtkmisc.h" #include "select.h" -#include "csg.h" #include "brushmanip.h" #include "selection.h" #include "entity.h" #include "camwindow.h" -#include "texwindow.h" #include "mainframe.h" #include "preferences.h" #include "commands.h" @@ -641,7 +639,11 @@ gboolean xywnd_wheel_scroll( GtkWidget* widget, GdkEventScroll* event, XYWnd* xy } gboolean xywnd_size_allocate( GtkWidget* widget, GtkAllocation* allocation, XYWnd* xywnd ){ +#if NV_DRIVER_GAMMA_BUG + xywnd->fbo_get()->reset( allocation->width, allocation->height, g_xywindow_globals_private.m_MSAA, true ); +#else xywnd->fbo_get()->reset( allocation->width, allocation->height, g_xywindow_globals_private.m_MSAA, false ); +#endif xywnd->m_nWidth = allocation->width; xywnd->m_nHeight = allocation->height; xywnd->updateProjection(); @@ -669,7 +671,11 @@ void XYWnd_CameraMoved( XYWnd& xywnd ){ } XYWnd::XYWnd() : +#if NV_DRIVER_GAMMA_BUG + m_gl_widget( glwidget_new( TRUE ) ), +#else m_gl_widget( glwidget_new( FALSE ) ), +#endif m_deferredDraw( WidgetQueueDrawCaller( *m_gl_widget ) ), m_deferredOverlayDraw( ReferenceCaller( *this ) ), m_deferred_motion( xywnd_motion, this ), @@ -2459,7 +2465,11 @@ void ToggleShowGrid(){ void MSAAImport( int value ){ g_xywindow_globals_private.m_MSAA = value ? 1 << value : value; g_pParentWnd->forEachXYWnd( []( XYWnd* xywnd ){ +#if NV_DRIVER_GAMMA_BUG + xywnd->fbo_get()->reset( xywnd->Width(), xywnd->Height(), g_xywindow_globals_private.m_MSAA, true ); +#else xywnd->fbo_get()->reset( xywnd->Width(), xywnd->Height(), g_xywindow_globals_private.m_MSAA, false ); +#endif } ); } typedef FreeCaller1 MSAAImportCaller;