• Create Account

### #Actualkrippy2k8

Posted 08 September 2012 - 06:06 PM

On a seperate point I would Ideally like to drop the WinMain call into the Core library rather than have platform specific stuff in the Application project. From what I have read this is possible by defining the /Entry in the VS project settings although I am not sure what this should be set as, for the Core static lib or the Application or both.

Personally I think that's a bad idea. What you gain from hiding the entry points in your library is marginal at best, and disruptive at worst.

You'll be taking control away from your users. What if they don't want to instantiate your application framework at the beginning of WinMain? Then they have to modify your library.

It's also going to cause them to have to set strange linker settings on every platform in order to properly link the engine if they decide to create new projects for it manually.

Ideally your WinMain would just be something like this:

int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
Application app.
app.init( hInstance, lpCmdLine );
return app.run();
}


.
With perhaps platform-specific versions of Application::init.

What would you actually gain from hiding this from your users?

### #1krippy2k8

Posted 08 September 2012 - 06:04 PM

On a seperate point I would Ideally like to drop the WinMain call into the Core library rather than have platform specific stuff in the Application project. From what I have read this is possible by defining the /Entry in the VS project settings although I am not sure what this should be set as, for the Core static lib or the Application or both.

Personally I think that's a bad idea. What you gain from hiding the entry points in your library is marginal at best, and disruptive at worst.

You'll be taking control away from your users. What if they don't want to instantiate your application framework at the beginning of WinMain? Then they have to modify your library.

It's also going to cause them to have to set strange linker settings on every platform in order to properly link the engine if they decide to create new projects for it manually.

Ideally your WinMain would just be something like this:

int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
Application app.
app.init( hInstance, lpCmdLine );
app.run();
return app.result();
}


.
With perhaps platform-specific versions of Application::init.

What would you actually gain from hiding this from your users?

PARTNERS