PixelLightAPI  .
Defines
FrontendMain.h File Reference
#include "PLCore/Main.h"
#include "PLCore/Runtime.h"
#include "PLCore/ModuleMain.h"
#include "PLCore/Frontend/Frontend.h"
#include "PLCore/Frontend/FrontendContext.h"

Go to the source code of this file.

Defines

#define pl_module_application(ModuleName, ApplicationClass)
 Defines a default frontend for a module inside a plugin library.
#define pl_module_application_frontend(ModuleName, ApplicationClass, FrontendClass)
 Defines a frontend for a module inside a plugin library.

Define Documentation

#define pl_module_application (   ModuleName,
  ApplicationClass 
)
Value:
int PLMain(const PLCore::String &sExecutableFilename, const PLCore::Array<PLCore::String> &lstArguments) \
    { \
        /* Scan PL-runtime directory for compatible plugins and load them in as well as scan for compatible data and register it */ \
        if (PLCore::Runtime::ScanDirectoryPluginsAndData()) { \
            /* Setup the frontend context */ \
            PLCore::FrontendContext cFrontendContext; \
            cFrontendContext.SetExecutableFilename(sExecutableFilename); \
            cFrontendContext.SetArguments(lstArguments); \
            cFrontendContext.SetName(ModuleName); \
            cFrontendContext.SetFrontendParameters(PLCore::String("ApplicationClass=\"") + ApplicationClass + '\"'); \
    \
            /* Run the frontend */ \
            return PLCore::Frontend::Run(cFrontendContext); \
        } else { \
            /* Error! */ \
            return -1; \
        } \
    } \
	\
	pl_module_plugin(ModuleName)

Defines a default frontend for a module inside a plugin library.

Parameters:
[in]ModuleNameModule name
[in]ApplicationClassName of the application RTTI class to use (must be derived from "PLCore::FrontendApplication")
Remarks:
Use this when you don't want to care about the program entry point.
#define pl_module_application_frontend (   ModuleName,
  ApplicationClass,
  FrontendClass 
)
Value:
int PLMain(const PLCore::String &sExecutableFilename, const PLCore::Array<PLCore::String> &lstArguments) \
    { \
        /* Scan PL-runtime directory for compatible plugins and load them in as well as scan for compatible data and register it */ \
        if (PLCore::Runtime::ScanDirectoryPluginsAndData()) { \
            /* Setup the frontend context */ \
            PLCore::FrontendContext cFrontendContext; \
            cFrontendContext.SetExecutableFilename(sExecutableFilename); \
            cFrontendContext.SetArguments(lstArguments); \
            cFrontendContext.SetName(ModuleName); \
            cFrontendContext.SetFrontendParameters(PLCore::String("ApplicationClass=\"") + ApplicationClass + '\"'); \
            cFrontendContext.SetFrontendImplementation(FrontendClass); \
    \
            /* Run the frontend */ \
            return PLCore::Frontend::Run(cFrontendContext); \
        } else { \
            /* Error! */ \
            return -1; \
        } \
    } \
	\
	pl_module_plugin(ModuleName)

Defines a frontend for a module inside a plugin library.

Parameters:
[in]ModuleNameModule name
[in]ApplicationClassName of the application RTTI class to use (must be derived from "PLCore::FrontendApplication")
[in]FrontendClassName of the frontend implementation RTTI class to use (e.g. "PLFrontendOS::Frontend")
Remarks:
Use this when you don't want to care about the program entry point.


PixelLight PixelLight 0.9.10-R1
Copyright (C) 2002-2011 by The PixelLight Team
Last modified Fri Dec 23 2011 15:51:06
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported