openframeworks / openframeworks/openFrameworks

Make ProjectGenerator for iOS release automatically generate main.mm using ofAppiOSWindow

Open
#3,903 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug iOS project-generator
Dominant language
C++
Stars
10.4k
Forks
2.6k
Avg merge
1d 21h
Merged PRs (30d)
9

Description

Hey,

in a rather lengthy debugging session (github issue, forum post) I figured out some rendering issues on an iOS openframeworks project that uses 3D.

It turns out that the ProjectGenerator by defaults creates this main.mm

#include "ofMain.h"
#include "ofApp.h"

int main(){
    ofSetupOpenGL(1024,768,OF_FULLSCREEN);          // <-------- setup the GL context

    ofRunApp(new ofApp());
}

My issue got resolved by using the ofAppiOSWindow setup, like so:

#include "ofMain.h"
#include "ofApp.h"

int main(){
    ofAppiOSWindow * iOSWindow = new ofAppiOSWindow();
    iOSWindow->enableDepthBuffer();
    ofSetupOpenGL(iOSWindow, 1024, 768, OF_FULLSCREEN);

    ofRunApp(new ofApp);
}

Despite there also being the iOSWindow->enableDepthBuffer(); which might not be needed for all projects, shouldn't the iOS ProjectGenerator use this form using ofAppiOSWindow?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in the iOS ProjectGenerator template that produces main.mm and compare its generated setup with the ofAppiOSWindow example in this issue. Determine the appropriate default window setup, including whether depth-buffer enabling belongs in the template, then verify that newly generated iOS projects contain the intended main.mm.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, ios
Domain
mobile-dev, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.