As my earlier email post said, you MUST call DrawSetTextureFile() before EVERY DrawTexturedRect() call (or in your case DrawSetTextureRGBA()). In your ::Paint() function you only call DrawSetTextureRGBA once.
( here is the code from your paint function: if (!m_pImage->SVGLoaded()) return; if ( (m_iTexture==-1) || (!surface()->IsTextureIDValid(m_iTexture)) ) { // BAD BAD BAD, need to call something like NeedsRender EVERY time this is called int width,height; float ratio; m_pImage->SVGGetSize(&width,&height,&ratio); NeedsRender(width*0.5,height*0.5); if ( (m_iTexture==-1) || (!surface()->IsTextureIDValid(m_iTexture)) ) return; } int wide,tall; BaseClass::GetSize(wide,tall); surface()->DrawSetTexture(m_iTexture); //surface()->DrawTexturedRect(0, 0, wide, tall); surface()->DrawTexturedRect(0, 0, 512, 1024); ). - Alfred -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jethro Beekman Sent: Saturday, March 12, 2005 2:01 AM To: hlcoders@list.valvesoftware.com Subject: [hlcoders] Re: DrawSetTextureRGBA Yes, I found your message from two days ago, and it doesn't work. And if you've had taken a look at the code you would've seen that I already have something like that. Or are you implying that I should use DrawSetTextureFile instead of DrawSetTextureRGBA? As you may understand, that is not an option with things that are rendered in memory. And can you tell what 'hardwareFilter' and 'forceReload' do? deathz0rz Alfred Reynolds writes: > In void SVGPanel::Paint() you need to have something like this: > vgui::surface()->DrawSetTextureFile(m_nTextureID, "vgui/ammobg", > true, false); > vgui::surface()->DrawSetColor(_color[0], _color[1], _color[2], > _color[3]); > vgui::surface()->DrawTexturedRect( 0, 0, 100, 100 ); > > > - Alfred > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Jethro > Beekman > Sent: Friday, March 11, 2005 3:38 PM > To: hlcoders@list.valvesoftware.com > Subject: [hlcoders] Re: DrawSetTextureRGBA > > Still doesn't work. I uploaded the change vgui_svgimage.cpp > (http://deathz0rz.homeunix.net/svgimage/vgui_svgpanel.cpp). When I > call > DrawSetTexture() before drawing, it appears to use DrawFilledRect(), > and when I just call DrawSetTextureRGBA() before drawing, it draws the > crosshairs sprite (memory leakage?). Note: I use the static buffer. > > deathz0rz > >> See my email titled "RE: [hlcoders] Texturing a HuD Element -- need >> help" from yesterday, it answers this question also. >> >> - Alfred > > > _______________________________________________ > To unsubscribe, edit your list preferences, or view the list archives, > please visit: > http://list.valvesoftware.com/mailman/listinfo/hlcoders > > > _______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders _______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders