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

Cinder 0.9: Tinderbox includes incorrect header file in CocoaView app #1073

Closed
MattijsKneppers opened this issue Aug 21, 2015 · 5 comments
Closed

Comments

@MattijsKneppers
Copy link
Contributor

When using Tinderbox to create a CocoaView OpenGL app, it looks like it includes the cinder/app/CinderView.h dependency, which appears to no longer exist in the current master.

It looks like the cocoa approach has been reworked. The AppCocoaViewTest projects suggests that the h file needed is now cinder/app/cocoa/CinderViewMac.h

@pizthewiz
Copy link
Contributor

It appears as though the whole CocoaView/OpenGL template needs a few updates for 0.9.0.

@kjhollen
Copy link

Just ran into this today and trying to work around it—having a little trouble figuring out the last parts. I got the app to compile, but it crashes on launch.

I've made a basic app called CinderCocoaViewTestApp that's just the result from running TinderBox. Here's what I've changed so far (happy to repost in another format that's not a git diff—wasn't sure what would be helpful):

diff --git a/include/CinderCocoaViewTestApp.h b/include/CinderCocoaViewTestApp.h
index 80b045c..f74210a 100644
--- a/include/CinderCocoaViewTestApp.h
+++ b/include/CinderCocoaViewTestApp.h
@@ -1,6 +1,6 @@
 #pragma once

-#include "cinder/app/AppCocoaView.h"
+#include "cinder/app/cocoa/AppCocoaView.h"

 class CinderCocoaViewTestApp : public cinder::app::AppCocoaView {
   public:
diff --git a/include/CinderCocoaViewTestDelegate.h b/include/CinderCocoaViewTestDelegate.h
index 0a82fc4..06dc2b3 100644
--- a/include/CinderCocoaViewTestDelegate.h
+++ b/include/CinderCocoaViewTestDelegate.h
@@ -1,11 +1,11 @@

-#include "cinder/app/CinderView.h"
+#include "cinder/app/cocoa/CinderViewMac.h"
 #include "CinderCocoaViewTestApp.h"
 #import <Cocoa/Cocoa.h>

 @interface CinderCocoaViewTestDelegate : NSObject <NSApplicationDelegate>
 {
-       IBOutlet CinderView             *cinderView;
+       IBOutlet CinderViewMac          *cinderView;
        IBOutlet NSWindow               *window;
        IBOutlet NSColorWell    *colorWell;

diff --git a/src/CinderCocoaViewTestDelegate.mm b/src/CinderCocoaViewTestDelegate.mm
index e9996a6..367c0b2 100644
--- a/src/CinderCocoaViewTestDelegate.mm
+++ b/src/CinderCocoaViewTestDelegate.mm
@@ -14,8 +14,8 @@
 - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
 {
        mApp = new CinderCocoaViewTestApp;
-       mApp->prepareLaunch();
-       mApp->setupCinderView( cinderView, cinder::app::RendererGl::create() );
+       //mApp->prepareLaunch();
+       mApp->setupCinderView(cinderView);
        mApp->launch();

        [window setAcceptsMouseMovedEvents:YES];

...and also a change to MainMenu.xib to use CinderViewMac instead of CinderView (omitted from diff).

The app crashes on launch when executing mApp = new CinderCocoaViewTestApp;. (Note: prepareLaunch is commented out because it's a protected method now and not accessible here, but the app crashes before even getting to this point).

If anyone has an ideas on how to work around this last hurdle, I'd be glad for the help. Thanks!

@sroske
Copy link
Contributor

sroske commented May 9, 2016

I had to get this running for a new project. Using your changes I was able to simply add a call to initialize the user app class, something like this should work in the delegate implementation:

cinder::app::AppBase::Settings settings;
cinder::app::RendererRef renderer( new cinder::app::RendererGl );
CinderCocoaViewTestApp::initialize(&settings, renderer);

mApp = new CinderCocoaViewTestApp

@kjhollen
Copy link

Cool! Thank you. I had to make one additional change, removing the Cocoa include from CinderCocoaViewTest_Prefix.pch to fix #error Attempt to include auto-generated header after gltypes.h

@andrewfb
Copy link
Collaborator

andrewfb commented Jun 5, 2016

Thanks everybody for this - should be fixed by #1460

@andrewfb andrewfb closed this as completed Jun 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants