Advertisement
Guest User

QTS no. 15 - Draw texture as sprite

a guest
Aug 24th, 2010
510
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.15 KB | None | 0 0
  1. /*
  2. -----------------------------------------
  3. * Game hacking QTS ( Quickie Tip Series )
  4. * no. 15 - Draw texture as sprite
  5. -----------------------------------------
  6. * Author: SEGnosis  - GHAnon.net
  7. * Thanks to:
  8. * bitterbanana      - No known site
  9. * Drunken Cheetah   - No known site
  10. * fatboy88      - No known site
  11. * Geek4Ever         - No known site
  12. * learn_more        - www.uc-forum.com
  13. * Novocaine         - http://ilsken.net/blog/?page_id=64
  14. * Philly0494        - No known site
  15. * Roverturbo        - www.uc-forum.com
  16. * SilentKarma       - www.halocoders.com - offline
  17. * Strife        - www.uc-forum.com
  18. * Wieter20      - No known site
  19. */
  20.  
  21. //----------------------------------//
  22.  
  23.  
  24. LPD3DXSPRITE        pSprite;    // Sprite pointer
  25.  
  26. D3DXCreateSprite( m_pDevice, &pSprite ); // Create sprite using device, ( only once )
  27.  
  28.  
  29. //----------------------------------//
  30.  
  31.  
  32. pSprite->Begin( D3DXSPRITE_ALPHABLEND );// D3DXSPRITE_ALPHABLEND to allow transparency
  33.  
  34.  
  35. // D3DXMatrixTransformation2D() to rotate and resize
  36.  
  37.  
  38. pSprite->Draw( m_TexFoo, 0, 0, &D3DXVECTOR3( 50, 50, 0 ), D3DCOLOR_XRGB( 255, 255, 255 ) );// Full color and full alpha channel
  39.  
  40.  
  41. pSprite->End();
  42.  
  43.  
  44. //----------------------------------//
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement