diff --git a/libs/render.h b/libs/render.h index c6fbe827..2c191170 100644 --- a/libs/render.h +++ b/libs/render.h @@ -1378,8 +1378,6 @@ public: } void save(){ glBindTexture( GL_TEXTURE_2D, _tex ); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST ); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST ); glCopyTexImage2D( GL_TEXTURE_2D, 0, GL_RGB, 0, 0, _width, _height, 0 ); //glCopyTexSubImage2D( GL_TEXTURE_2D, 0, 0, 0, 0, 0, m_nWidth, m_nHeight ); glBindTexture( GL_TEXTURE_2D, 0 ); @@ -1406,13 +1404,9 @@ public: glEnable( GL_TEXTURE_2D ); glDisable( GL_BLEND ); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE ); - glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE ); - glPolygonMode( GL_FRONT_AND_BACK, GL_FILL ); glBindTexture( GL_TEXTURE_2D, _tex ); - glColor4f( 1.f, 1.f, 1.f, 1.f ); glBegin( GL_QUADS ); @@ -1430,6 +1424,13 @@ public: protected: void construct() { glGenTextures( 1, &_tex ); + glEnable( GL_TEXTURE_2D ); + glBindTexture( GL_TEXTURE_2D, _tex ); + glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE ); + glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE ); + glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST ); + glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST ); + glBindTexture( GL_TEXTURE_2D, 0 ); _constructed = true; } private: diff --git a/radiant/xywindow.cpp b/radiant/xywindow.cpp index 54dfa9ad..90a86a16 100644 --- a/radiant/xywindow.cpp +++ b/radiant/xywindow.cpp @@ -73,8 +73,6 @@ #include "render.h" -void LoadTextureRGBA( qtexture_t* q, unsigned char* pPixels, int nWidth, int nHeight ); - bool g_bCamEntityMenu = false; @@ -1332,6 +1330,9 @@ void BackgroundImage::free_tex(){ } } +#include "texturelib.h" +void LoadTextureRGBA( qtexture_t* q, unsigned char* pPixels, int nWidth, int nHeight ); + void BackgroundImage::set( const VIEWTYPE viewtype ){ const AABB bounds = GlobalSelectionSystem().getBoundsSelected(); const int nDim1 = ( viewtype == YZ ) ? 1 : 0; diff --git a/radiant/xywindow.h b/radiant/xywindow.h index a5389196..236e30d0 100644 --- a/radiant/xywindow.h +++ b/radiant/xywindow.h @@ -30,7 +30,6 @@ #include "gtkutil/xorrectangle.h" #include "view.h" #include "map.h" -#include "texturelib.h" #include "qerplugin.h"