home features api download svn donate license contact
Spanish  
 

The minimal code

This example shows how you can write the minimal code possible.
 
 

Example using the implementation class

// We are including the main header file it that contains
// the implementation class.

#include <ceVideoCoreImpl.h>

// We are using the namespace "ce" (CorEngine) by default (Optional).

using namespace ce;

// We are creating our own manager class, inheriting the implementation class.
class CVideoManager : public IVideoManagerImpl<CVideoManager>
{
public:

inline short Example(void) const
{
// Load a video file.
this -> Video -> LoadVideoFile("video1.mpg");
// Initialize the window main loop.
return this -> Video -> InitVideoWindow();
};

// Operator -> (Optional).
const CVideoManager* operator -> (void) const
{ return this; };

};

int main(int argc, char **argv)
{
// We are creating a instance of our manager class.
const CVideoManager Video;

// Verify the integrity of the manager class (Optional).
if (Video -> VerifyVideoManager() == 0) return 1;

return Video -> Example();
}
 

Example using the interface class

// We are including the main header file it that contains the interface class.
#include <ceVideoCore.h>

// We are using the namespace "ce" (CorEngine) by default (Optional).

using namespace ce;

int main(int argc, char **argv)
{
// We are creating a instance of the manager class.
IVideoManager *Video = CreateVideoManager();
if (Video == NULL) return 1;

// Load a video file.
Video -> LoadVideoFile("video1.mpg");
// Initialize the window main loop.
Video -> InitVideoWindow();

// Release the instance of the class manager.
DestroyVideoManager(&Video);

return 0;
}
 
 
 SourceForge.net
 
   Creative Commons License   Except where otherwise noted, content on this site is
  licensed under a Creative Commons Attribution 3.0 License