Archived

This topic is now archived and is closed to further replies.

Subotron

Whats the difference between Window::Action or WindowAction?

Recommended Posts

I'm writing an engine, and have looked at other engines to get an idea how to do it. Often I see functions like:
      
Engine::Init {
    // Code goes here

}
  
and
        
Engine::Kill {
    // Code goes here

}
  
What's the difference between doing this or just making the functions:
  
EngineInit {
    // Code goes here

}
  
and
  
EngineKill {
    // Code goes here

}
  
So, what's the difference and which one is "better"? What pros/cons do they both have? Thanx in advance for answering. P.S.: I was not sure where to post this message, so please don't flame me if you think it's not in the right forum... Edited by - Subotron on January 31, 2002 9:58:12 AM Edited by - Subotron on January 31, 2002 9:59:40 AM

Share this post


Link to post
Share on other sites
the difference is simple Engine::Init(..){..} is a member function of class Engine(OOP) and EngineInit(..){..} ist a global function(non OOP)
because you''ve asked this question I assume you don''t really know C++, so you should not start coding an engine. intstead learn C++.

Share this post


Link to post
Share on other sites
My basic C++ skills are not what they should be indeed... I switched from VB game programming to C++ and did not have the patience to learn it all again from scratch

I''ll buy a basic C++ book soon...

I already know quite a lot about C++ but OOP was beyond my knowledge... guess I should start learning it

Thank you for the help

Share this post


Link to post
Share on other sites