fork download
  1. #include <memory>
  2.  
  3. struct CD3DFontDeleter {
  4. void operator()(CD3DFont* ptr) const {
  5. ptr->Invalidate();
  6. delete ptr;
  7. }
  8. }
  9. typedef std::unique_ptr<CD3DFont, CD3DFontDeleter> font_ptr;
  10. font_ptr TextCreate(const char * szFontName,int FontHeight,DWORD dwCreateFlags)
  11. {
  12. CD3DFont* ptr = new CD3DFont(szFontName,FontHeight,dwCreateFlags);
  13. ptr->Initialize(origIDirect3DDevice9);
  14. return font_ptr(ptr);
  15. }
  16.  
  17. int main() {
  18. std::vector<font_ptr> fonts;
  19. fonts.push_back(TextCreate("thing", 43124, 0));
  20. }
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty