Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated EntryPoint to allow for linux compilations #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions Walnut/src/Walnut/EntryPoint.h
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
#pragma once

#ifdef WL_PLATFORM_WINDOWS

extern Walnut::Application* Walnut::CreateApplication(int argc, char** argv);
extern Walnut::Application *Walnut::CreateApplication(int argc, char **argv);
bool g_ApplicationRunning = true;

namespace Walnut {
namespace Walnut
{

int Main(int argc, char** argv)
int Main(int argc, char **argv)
{
while (g_ApplicationRunning)
{
Walnut::Application* app = Walnut::CreateApplication(argc, argv);
Walnut::Application *app = Walnut::CreateApplication(argc, argv);
app->Run();
delete app;
}
Expand All @@ -21,6 +20,8 @@ namespace Walnut {

}

#ifdef WL_PLATFORM_WINDOWS

#ifdef WL_DIST

#include <Windows.h>
Expand All @@ -32,11 +33,17 @@ int APIENTRY WinMain(HINSTANCE hInst, HINSTANCE hInstPrev, PSTR cmdline, int cmd

#else

int main(int argc, char** argv)
int main(int argc, char **argv)
{
return Walnut::Main(argc, argv);
}

#endif // WL_DIST

#else

int main(int argc, char **argv)
{
return Walnut::Main(argc, argv);
}

#endif // WL_PLATFORM_WINDOWS