Skip to content

Modernize examples and templates main.cpp #6720

Description

@ofTheo

Right now most of the examples in OF show the old way of making a window and starting an app.

eg:

//========================================================================
int main( ){

	ofSetupOpenGL(1024,768, OF_WINDOW);			// <-------- setup the GL context

	// this kicks off the running of my app
	// can be OF_WINDOW or OF_FULLSCREEN
	// pass in width and height too:
	ofRunApp( new ofApp());

}

For 0.12.0 should update the examples to use the newer calls and make sure the older methods are marked deprecated.

eg

//========================================================================
int main( ){

	ofWindowSettings settings;
	settings.setSize(1024, 768);
	settings.windowMode = OF_WINDOW;
    
	auto mainWindow = ofCreateWindow(settings);
	auto mainApp = make_shared<ofApp>();

	ofRunApp(mainWindow, mainApp);
	ofRunMainLoop();
}

The above hides the ofGLFWWindowSettings features but also the dependency.
Not sure if we should include some commented out code above to show how to use the more feature rich ofGLFWWindowSettings options?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions