Skip to main content
gamedev.net
🔒 Locked

Enumerated types

Started by Briskon Jul 23, 2003 at 2:04 PM 0 replies 250+ views
Original Post
Briskon
Briskon
What is the reason for using enumerated types as opposed to a #define? I.e. Say for the RenderStateTypes, why are they enumerated instead of being #defined?
Namethatnobodyelsetook
Namethatnobodyelsetook
If you try writing a value from one enum into a variable of another enum type you should get a compiler error, so better type checking.

Also enum names appear in the debugger. You can even type in new values as enum names in the debugger. Much more handy than referring to, or memorizing, a list of defines.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.