DrawSetTextureRGBA: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (typo, again)
No edit summary
Line 1: Line 1:
DrawSetTextureRGBA() is a function that you should use to draw raw RGBA data to the HUD, for example when you are rendering a mask or something. DrawSetTextureRGBA is one of the worst documented features in the SDK, and hasn't been seen working in any way, AFAIK. The following code is by the book, but doesn't work at all (it just paints a white fog over the screen).
DrawSetTextureRGBA() is a function that you should use to draw raw RGBA data to the HUD, for example when you are rendering a mask. DrawSetTextureRGBA is one of the worst documented features in the SDK, and hasn't been seen working in any way, as far as I know. The following code is by the book, but doesn't work at all (it just paints a white fog over the screen).


<pre>
<pre>
Line 10: Line 10:
</pre>
</pre>


Emails on HLCoders (March 2005, [hlcoders] DrawSetTextureRGBA) about this issue haven't helped a bit. We, as the Source modding community can only hope VALVe will eventually fix this, or give information on how this function should be used.
Emails on HLCoders (March 2005, [hlcoders] DrawSetTextureRGBA) about this issue haven't helped a bit. We, as the Source modding community can only hope Valve will eventually fix this, or give information on how this function should be used.


[[Category: Complaints]]
[[Category: Complaints]]
[[Category: Programming]]
[[Category: Programming]]

Revision as of 10:45, 3 July 2005

DrawSetTextureRGBA() is a function that you should use to draw raw RGBA data to the HUD, for example when you are rendering a mask. DrawSetTextureRGBA is one of the worst documented features in the SDK, and hasn't been seen working in any way, as far as I know. The following code is by the book, but doesn't work at all (it just paints a white fog over the screen).

	//abPic is an unsigned int[128][128] with some texture data
	m_iHudTexture=surface()->CreateNewTextureID();
	surface()->DrawSetTextureRGBA(m_iHudTexture,(unsigned char*)abPic,128,128,false,true);
	Assert(surface()->IsTextureIDValid(m_iHudTexture));
	surface()->DrawSetColor(Color(255,255,255,128));
	surface()->DrawTexturedRect(0,0,GetWide(),GetTall());

Emails on HLCoders (March 2005, [hlcoders] DrawSetTextureRGBA) about this issue haven't helped a bit. We, as the Source modding community can only hope Valve will eventually fix this, or give information on how this function should be used.