How does OpenGL store it's states?

Remind me not to have the forum email me when someone responds to my posts . I had 40 emails…LOL.

I love to read all this brainstorming. Reading your responces has also given me a new train of thought…especially with state management.

CViper,

I used to agree with you when I moved from C to C++ but I like Scott Meyers’ Effective C++/More Effective C++ books. He says that you should use inline functions and global const variables instead of #defines for a number of reasons, but I’ll let you read the book to find out why You may not agree with me (and him) but he has a lot of convincing arguments. I’ve read both his books 3 times and I could read them both another 3 times. He’s definitely a master.

Anyway, I’m not saying you’re wrong and I’m right, but that’s my preference

Hi,

What about using bitfields? Good on memory usage, although maybe not quite so efficient in terms of speed - but that’s probably not a problem.

eg.

typedef struct _states_t
{
int boState1 : 1;
int boState2 : 1;
etc…

} states_t;

  • hope I got the syntax right…

Iain