Advertisement
Guest User

Untitled

a guest
Nov 25th, 2014
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. // Draw stars on top of everything else.
  2. if( mRenderStars )
  3. {
  4. // define mDots
  5. GFXVertexBufferHandle<GFXVertexPC> mDots;
  6.  
  7. // create point-dots
  8. if( mDots.isNull() )
  9. {
  10. mDots.set(GFX, mNumStars, GFXBufferTypeStatic);
  11.  
  12. U32 ndot = 0;
  13. mDots.lock();
  14. for(U32 i = 0; i < mNumStars; i++)
  15. {
  16. U32 myAlpha = (256 * mStarColors[i][3]) -1;
  17. mDots[i].color.set( 255, 255,255, myAlpha );
  18. mDots[i].point.x = mStarPoints[i][0];
  19. mDots[i].point.y = mStarPoints[i][1];
  20. mDots[i].point.z = mStarPoints[i][2];
  21. }
  22. mDots.unlock();
  23. }
  24.  
  25. GFXStateBlockDesc dotdesc;
  26. dotdesc.setBlend(true, GFXBlendSrcAlpha, GFXBlendInvSrcAlpha);
  27. dotdesc.setCullMode( GFXCullNone );
  28. GFXStateBlockRef mDotSB = GFX->createStateBlock( dotdesc );
  29.  
  30. GFX->setStateBlock(mDotSB);
  31.  
  32. // draw the points.
  33. GFX->setVertexBuffer( mDots );
  34. GFX->drawPrimitive( GFXPointList, 0, mNumStars );
  35. }
  36. // <<< STARS
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement