Thread: I feel.....clean....

  1. #1
    Used Registerer jdinger's Avatar
    Join Date
    Feb 2002
    Posts
    1,065

    Wink I feel.....clean....

    I've spent most of today upgrading the code for my game to replace my arrays and char* strings with STL containers and strings.

    While I was at it I started thinking about my old-style C macros. Where I use to have:
    Code:
    #define SafeRelease(DirectXptr) {if(DirectXptr) {DirectXptr->Release(); DirectXptr=0;}}
    I now use:
    Code:
    template<typename _T> inline void SafeRelease(_T T)
    {
       T->Release();
       T=0;
    }
    It's the kind of feeling when I first moved from VB to C++ for writing games. Like I was doing something "naughty" before....

  2. #2
    Registered User Xei's Avatar
    Join Date
    May 2002
    Posts
    719
    Whatever method works man.

  3. #3
    Registered User
    Join Date
    Jan 2002
    Posts
    552
    didnt someone recently post a quote from some guy saying never use STL in games?
    C Code. C Code Run. Run Code Run... Please!

    "Love is like a blackhole, you fall into it... then you get ripped apart"

  4. #4
    Shadow12345
    Guest
    oh 'some guy' said that huh? Well obviously he's very popular, it's not everyday 'some guy' says something useful!

  5. #5
    Used Registerer jdinger's Avatar
    Join Date
    Feb 2002
    Posts
    1,065
    Originally posted by *ClownPimp*
    didnt someone recently post a quote from some guy saying never use STL in games? :D
    Not sure what 'guy' said that or for what reason but I haven's seen any speed difference on 3 different machines since I've upgraded to STL.

    I remember someone recently posting that they read 'somewhere' that C++ was too slow for games.

    To both that and the idea that STL is too slow: If you don't understand how to use it then of course it would be too slow.

    But like I said I'm just learning iterators, etc. and I haven't noticed a difference (this is on machines ranging from P2 166 mhz - 64 MB Ram to P4 1.8 ghz 256 MB Ram).

    Of course different situations require different solutions. For my file I/O I prefer C functions/data structures because I don't need all the added functionality of fstreams.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Establishing 'make clean' with GNU make
    By Jesdisciple in forum C Programming
    Replies: 9
    Last Post: 04-11-2009, 09:10 AM
  2. Clean list function
    By killmequick in forum C Programming
    Replies: 4
    Last Post: 10-23-2008, 01:25 PM
  3. Windows XP (and Vista) shiney look and feel
    By lightatdawn in forum A Brief History of Cprogramming.com
    Replies: 25
    Last Post: 09-18-2005, 02:56 PM
  4. Clean Code...
    By Devil Panther in forum C Programming
    Replies: 24
    Last Post: 07-16-2005, 01:50 AM
  5. make clean
    By Jaguar in forum Linux Programming
    Replies: 5
    Last Post: 12-27-2002, 06:44 PM