fesoliveira014 / cubeproject

Some voxel stuffs
7 stars 2 forks source link

Create Application Interface #6

Open fesoliveira014 opened 8 years ago

fesoliveira014 commented 8 years ago

The Application interface purpose is to give the developer an sketch to what an application using the engine looks like. It will contain all attributes to create a scene and the input logic. In essence, the dev will create an application class inheriting from this interface and will have to implement several methods:

class IApplication
{
public:
  IApplication(<settings>);
  ~IApplication() = 0 (?);

  Run() = 0;

protected:
  Initialize(params) = 0;
  CleanUp()=0;

  Camera activeCamera;
  IsoCamera, FpsCamera (...)
  <other relevant attributes, like scene graph, chunk manager, etc>
};

At the main.cpp file, the dev would just call each of these functions:

main.cpp

int main(args)
{
  Settings settings = <open settings files or create settings object>
  (...other relevant instantiations...)

  Application app(settings);
  app.run()

  return 0;
}