Skip to content

Conversation

@halx99
Copy link
Collaborator

@halx99 halx99 commented Jul 14, 2025

Describe your changes

  • Remove metal render backend gl/gles deps
  • Simplify ios render view creation
  • Fix various‌ compiler warnings
  • Mark ios GLViewImpl::createWithEAGLView and GLViewImpl::convertAttrs deprecated, they are no longer required since render view creation flow was simplified
  • Add -Werror=objc-method-access for apple platform to traits objc method instance missing as compiling error.

After this PR, now ios render view creation flow looks like:

- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
{

    ax::Application* app = ax::Application::getInstance();

    // Initialize the GLView attributes
    app->initGLContextAttrs();

    // Override point for customization after application launch.

    auto renderView = ax::GLViewImpl::createWithFullScreen("axmol2");
    viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil];

    // uncumment if you want disable multiple touches
    // renderView->setMultipleTouchEnabled(false);

    renderView->showWindow(viewController);

    // IMPORTANT: Setting the GLView should be done after creating the RootViewController
    ax::Director::getInstance()->setRenderView(renderView);

    // run the axmol game scene
    app->run();

    return YES;
}

Issue ticket number and link

Checklist before requesting a review

For each PR

  • Add Copyright if it missed:
    - "Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md)."

  • I have performed a self-review of my code.

    Optional:

    • I have checked readme and add important infos to this PR.
    • I have added/adapted some tests too.

For core/new feature PR

  • I have checked readme and add important infos to this PR.
  • I have added thorough tests.

@halx99 halx99 added this to the 2.7.1 milestone Jul 14, 2025
@halx99 halx99 added the enhancement New feature or request label Jul 14, 2025
@halx99 halx99 marked this pull request as draft July 14, 2025 15:59
@halx99 halx99 modified the milestones: 2.7.1, 2.8.0 Jul 14, 2025
@halx99 halx99 force-pushed the remove-metal-backend-gl-deps branch from 394786e to f44e168 Compare July 15, 2025 02:00
@halx99 halx99 force-pushed the remove-metal-backend-gl-deps branch 3 times, most recently from 1fa4966 to c20eab4 Compare July 15, 2025 02:50
@halx99 halx99 changed the title Remove metal render backend gl/gles deps Improve apple platform render view creation Jul 15, 2025
@halx99 halx99 changed the title Improve apple platform render view creation Improve apple ios platform render view creation Jul 15, 2025
@halx99 halx99 marked this pull request as ready for review July 15, 2025 03:26
@halx99 halx99 force-pushed the remove-metal-backend-gl-deps branch from c20eab4 to f713817 Compare July 15, 2025 05:28
@halx99 halx99 merged commit 7a78f5f into dev Jul 15, 2025
15 checks passed
@halx99 halx99 deleted the remove-metal-backend-gl-deps branch July 15, 2025 11:36
@rh101
Copy link
Contributor

rh101 commented Aug 12, 2025

  • Add -Werror=objc-method-access for apple platform to traits objc method instance missing as compiling error.

@halx99 With the addition of -Werror=objc-method-access, my project is now generating this error:

Planning Swift module (arm64)
Driver threw unknown argument: '-Werror=objc-method-access' without emitting errors.

It doesn't show anything else around that error in the log, so I'm not quite sure what is going on. Would you know what may cause this specific error? This same project was compiling correctly prior to the addition of -Werror=objc-method-access.

If this argument should only apply to ObjC, then perhaps changing it to something like this may be better:

if(APPLE)
    add_compile_options("$<$<COMPILE_LANGUAGE:OBJC>:-Werror=objc-method-access>")
    add_compile_options("$<$<COMPILE_LANGUAGE:OBJCXX>:-Werror=objc-method-access>")
endif()

@halx99
Copy link
Collaborator Author

halx99 commented Aug 12, 2025

  • Add -Werror=objc-method-access for apple platform to traits objc method instance missing as compiling error.

@halx99 With the addition of -Werror=objc-method-access, my project is now generating this error:

Planning Swift module (arm64)
Driver threw unknown argument: '-Werror=objc-method-access' without emitting errors.

It doesn't show anything else around that error in the log, so I'm not quite sure what is going on. Would you know what may cause this specific error? This same project was compiling correctly prior to the addition of -Werror=objc-method-access.

If this argument should only apply to ObjC, then perhaps changing it to something like this may be better:

if(APPLE)
    add_compile_options("$<$<COMPILE_LANGUAGE:OBJC>:-Werror=objc-method-access>")
    add_compile_options("$<$<COMPILE_LANGUAGE:OBJCXX>:-Werror=objc-method-access>")
endif()

Yes, it's better

@halx99
Copy link
Collaborator Author

halx99 commented Aug 12, 2025

I create a PR to fix it: #2632

@rh101
Copy link
Contributor

rh101 commented Aug 12, 2025

I create a PR to fix it: #2632

Excellent, thank you. I tested the project with the changes, and the iOS build completes successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking changes enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants