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

Add ability to create console apps #1859

Merged
merged 3 commits into from
Apr 28, 2024
Merged

Conversation

smilediver
Copy link
Contributor

This PR has two changes:

  • It adds CONSOLE option to the ax_setup_app_config() function to allow creating console apps that use Axmol.
  • And a small change to 1k/build.ps1 to print out what CMake command is run when building.

@halx99
Copy link
Collaborator

halx99 commented Apr 27, 2024

entrypoint will missing when build as console app

@smilediver
Copy link
Contributor Author

smilediver commented Apr 28, 2024

I'm aware of this, but I think if someone will use this option, then he knows what he is doing and it will be an easy fix. And I don't know of a simple way to solve this.

@rh101
Copy link
Contributor

rh101 commented Apr 28, 2024

I'm aware of this, but I think if someone will use this option, then he knows what he is doing and it will be an easy fix. And I don't know of a simple way to solve this.

What about adding a AX_CONSOLE_APP definition or similar in cmake, via add_compile_definition, that you can check for in the code, and have the correct main function used in proj.win32/main.cpp and main.h as a result?

#if defined(AX_CONSOLE_APP)
int main()
#else
int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
#endif
{
...
}

@halx99 halx99 added this to the 2.1.3 milestone Apr 28, 2024
@halx99 halx99 added the enhancement New feature or request label Apr 28, 2024
@halx99
Copy link
Collaborator

halx99 commented Apr 28, 2024

I'm aware of this, but I think if someone will use this option, then he knows what he is doing and it will be an easy fix. And I don't know of a simple way to solve this.

What about adding a AX_CONSOLE_APP definition or similar in cmake, via add_compile_definition, that you can check for in the code, and have the correct main function used in proj.win32/main.cpp and main.h as a result?

#if defined(AX_CONSOLE_APP)
int main()
#else
int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
#endif
{
...
}

I fixed it

@halx99 halx99 merged commit 354f3ab into axmolengine:dev Apr 28, 2024
14 of 15 checks passed
@smilediver smilediver deleted the console_apps branch April 30, 2024 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants