Re: [osg-users] iOS: integration with not-OpenGL apps

2012-11-03 Thread Stephan Huber
Hi Mike,

thanks for the bug-report, I fixed the issue on the gtihub repository. I
will submit a new version to osg.submission asap.

I am not sure why your app crashes, perhaps you can enable NSZombies and
get an idea, why this happens.

cheers,
Stepan
Am 31.10.12 17:16, schrieb Mike Wozniewski:
 FYI, it looks like Stephan's FlipsideView example is broken in iOS 6.
 
 I get an error when trying to add the view:
 
 Code:
 -[UIView setRootViewController:]: unrecognized selector sent to instance 
 0xca36f0
 2012-10-31 11:53:50.850 viewtest[2745:907] *** Terminating app due to 
 uncaught exception 'NSInvalidArgumentException', reason: '-[UIView 
 setRootViewController:]: unrecognized selector sent to instance 0xca36f0'
 
 
 
 In my project, I ended up creating a custom subclass of UIView, which I use 
 instead of the default one that comes with a UIViewController and added the 
 following method to my custom class:
 
 Code:
 - (void) setRootViewController:(UIViewController*)vc;
 
 
 
 It's implementation is empty (no op), but it allows the OSG view to be added 
 and everything updates correctly after that.
 
 Now my only problem is that my app crashes when the view is Dealloc'd. I get 
 this error:
 
 Code:
 *** -[GraphicsWindowIOSGLView setGraphicsWindow:]: message sent to 
 deallocated instance 0x2411acc0
 
 
 
 Any ideas for fixing that one?
 
 Thanks,
 Mike
 
 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=50919#50919
 
 
 
 
 
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] iOS: integration with not-OpenGL apps

2012-10-31 Thread Mike Wozniewski
FYI, it looks like Stephan's FlipsideView example is broken in iOS 6.

I get an error when trying to add the view:

Code:
-[UIView setRootViewController:]: unrecognized selector sent to instance 
0xca36f0
2012-10-31 11:53:50.850 viewtest[2745:907] *** Terminating app due to uncaught 
exception 'NSInvalidArgumentException', reason: '-[UIView 
setRootViewController:]: unrecognized selector sent to instance 0xca36f0'



In my project, I ended up creating a custom subclass of UIView, which I use 
instead of the default one that comes with a UIViewController and added the 
following method to my custom class:

Code:
- (void) setRootViewController:(UIViewController*)vc;



It's implementation is empty (no op), but it allows the OSG view to be added 
and everything updates correctly after that.

Now my only problem is that my app crashes when the view is Dealloc'd. I get 
this error:

Code:
*** -[GraphicsWindowIOSGLView setGraphicsWindow:]: message sent to deallocated 
instance 0x2411acc0



Any ideas for fixing that one?

Thanks,
Mike

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=50919#50919





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] iOS: integration with not-OpenGL apps

2011-05-05 Thread Alessandro Terenzi
Thank you Stefan, I'm going to try it right now...

Alessandro

On Wed, May 4, 2011 at 10:22 PM, Stephan Huber ratzf...@digitalmind.dewrote:

 Hi Alessandro,

 I had some time to polish the GraphicsWindowIOS-implementation and it
 should work now to use a GraphicsWindowIOS as part of a bigger
 IOS-application.

 on github (https://github.com/stmh/osg/tree/iphone) there's even a new
 example demonstrating the usage.

 Basically you create a WindowDataClass with your parent-view as
 parameter, this will instruct GraphicsWindowIOS to add the created view
 to this parent-view, and it does respect the sizes in the traits-object.

 After that, you can query the GraphicsWindowIOS-object for the created
 view via dynamic_castosgViewer::GraphicsWindowIOS*(window)-getView();

 See the code inside FlipSideViewController.mm for more details.

 These new changes are currently not part of osg-trunk, but I'll submit
 them, as soon as possible.

 Please let me know, if this new code works on your end.

 cheers,

 Stephan



 Am 02.05.11 19:17, schrieb Alessandro Terenzi:
  Hi,
  I'm trying to find a way to integrate OSG into a generic app for iOS, but
  I'm facing some problems. Maybe I'm missing something, but as far as I've
  understood, it looks like that, in order to use OSG on iOS, I must always
  use the UIWindow and the corresponding UIView/UIViewController objects
  created by means of GraphicsWindowIOS::WindowData...but in this way I
 find
  difficult to later manage those UIView and UIViewController objects
  especially if I need to integrate them in a dynamic view hierarchy.
 
  What I'd like to do is to create a UIView-derived class that encapsulates
  everything required to use OSG to draw in just that view, then I'd like
 to
  manage that view by my own UIViewController (not related to OSG).
 
  Is there a way to do this with what is already available in OSG (2.9.13)?
 If
  not, can anyone suggest what (beyond creating a context and all OpenGLES
  related stuff) the UIView-derived class should do from the OSG point of
  view?
 
  Thanks.
  Alessandro
 
 
 
 
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] iOS: integration with not-OpenGL apps

2011-05-05 Thread Alessandro Terenzi
I've tried the new updated version and it works fine on my end. Now it looks
very easy to manage the OSG's view within a custom view controller.

I'd like to ask a couple of things, just to understand better how everything
works.

1) in GraphicsWindowIOS, beyond the window and view, also a view
controller is defined and it is allocated in GraphicsWindowIOS.mm just after
the view...is this view controller really needed? How is it used?

2) in the view_test example, at the end of FlipsideViewController,mm file,
what is the role of USE_GRAPICSWINDOW_IMPLEMENTATION(IOS) ? I tried by
removing it and it looks like that my app still works...

Thanks.
Alessandro

On Thu, May 5, 2011 at 9:24 AM, Alessandro Terenzi a.tere...@gmail.comwrote:

 Thank you Stefan, I'm going to try it right now...

 Alessandro

 On Wed, May 4, 2011 at 10:22 PM, Stephan Huber ratzf...@digitalmind.dewrote:

 Hi Alessandro,

 I had some time to polish the GraphicsWindowIOS-implementation and it
 should work now to use a GraphicsWindowIOS as part of a bigger
 IOS-application.

 on github (https://github.com/stmh/osg/tree/iphone) there's even a new
 example demonstrating the usage.

 Basically you create a WindowDataClass with your parent-view as
 parameter, this will instruct GraphicsWindowIOS to add the created view
 to this parent-view, and it does respect the sizes in the traits-object.

 After that, you can query the GraphicsWindowIOS-object for the created
 view via dynamic_castosgViewer::GraphicsWindowIOS*(window)-getView();

 See the code inside FlipSideViewController.mm for more details.

 These new changes are currently not part of osg-trunk, but I'll submit
 them, as soon as possible.

 Please let me know, if this new code works on your end.

 cheers,

 Stephan



 Am 02.05.11 19:17, schrieb Alessandro Terenzi:
  Hi,
  I'm trying to find a way to integrate OSG into a generic app for iOS,
 but
  I'm facing some problems. Maybe I'm missing something, but as far as
 I've
  understood, it looks like that, in order to use OSG on iOS, I must
 always
  use the UIWindow and the corresponding UIView/UIViewController objects
  created by means of GraphicsWindowIOS::WindowData...but in this way I
 find
  difficult to later manage those UIView and UIViewController objects
  especially if I need to integrate them in a dynamic view hierarchy.
 
  What I'd like to do is to create a UIView-derived class that
 encapsulates
  everything required to use OSG to draw in just that view, then I'd like
 to
  manage that view by my own UIViewController (not related to OSG).
 
  Is there a way to do this with what is already available in OSG
 (2.9.13)? If
  not, can anyone suggest what (beyond creating a context and all OpenGLES
  related stuff) the UIView-derived class should do from the OSG point of
  view?
 
  Thanks.
  Alessandro
 
 
 
 
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] iOS: integration with not-OpenGL apps

2011-05-05 Thread Stephan Maximilian Huber
Am 05.05.11 11:52, schrieb Alessandro Terenzi:
 1) in GraphicsWindowIOS, beyond the window and view, also a view
 controller is defined and it is allocated in GraphicsWindowIOS.mm just after
 the view...is this view controller really needed? How is it used?

The ViewController is used to adapt the view to a new
device-orientation. It should be easy to add a new code-path to disable
the creation of the ViewController, if needed.

 2) in the view_test example, at the end of FlipsideViewController,mm file,
 what is the role of USE_GRAPICSWINDOW_IMPLEMENTATION(IOS) ? I tried by
 removing it and it looks like that my app still works...

As the osg-libs are static you'll have to tell the linker to include the
GraphicsWindowIOS-class in the final app, this is the purpose of
USE_GRAPICSWINDOW_IMPLEMENTATION(IOS). In the other examples this line
is in the file Plugins.h

cheers,

Stephan
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] iOS: integration with not-OpenGL apps

2011-05-05 Thread Alessandro Terenzi
Thanks Stephan.

Alessandro

On Thu, May 5, 2011 at 12:39 PM, Stephan Maximilian Huber 
ratzf...@digitalmind.de wrote:

 Am 05.05.11 11:52, schrieb Alessandro Terenzi:
  1) in GraphicsWindowIOS, beyond the window and view, also a view
  controller is defined and it is allocated in GraphicsWindowIOS.mm just
 after
  the view...is this view controller really needed? How is it used?

 The ViewController is used to adapt the view to a new
 device-orientation. It should be easy to add a new code-path to disable
 the creation of the ViewController, if needed.

  2) in the view_test example, at the end of FlipsideViewController,mm
 file,
  what is the role of USE_GRAPICSWINDOW_IMPLEMENTATION(IOS) ? I tried by
  removing it and it looks like that my app still works...

 As the osg-libs are static you'll have to tell the linker to include the
 GraphicsWindowIOS-class in the final app, this is the purpose of
 USE_GRAPICSWINDOW_IMPLEMENTATION(IOS). In the other examples this line
 is in the file Plugins.h

 cheers,

 Stephan
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] iOS: integration with not-OpenGL apps

2011-05-04 Thread Stephan Huber
Hi Alessandro,

I had some time to polish the GraphicsWindowIOS-implementation and it
should work now to use a GraphicsWindowIOS as part of a bigger
IOS-application.

on github (https://github.com/stmh/osg/tree/iphone) there's even a new
example demonstrating the usage.

Basically you create a WindowDataClass with your parent-view as
parameter, this will instruct GraphicsWindowIOS to add the created view
to this parent-view, and it does respect the sizes in the traits-object.

After that, you can query the GraphicsWindowIOS-object for the created
view via dynamic_castosgViewer::GraphicsWindowIOS*(window)-getView();

See the code inside FlipSideViewController.mm for more details.

These new changes are currently not part of osg-trunk, but I'll submit
them, as soon as possible.

Please let me know, if this new code works on your end.

cheers,

Stephan



Am 02.05.11 19:17, schrieb Alessandro Terenzi:
 Hi,
 I'm trying to find a way to integrate OSG into a generic app for iOS, but
 I'm facing some problems. Maybe I'm missing something, but as far as I've
 understood, it looks like that, in order to use OSG on iOS, I must always
 use the UIWindow and the corresponding UIView/UIViewController objects
 created by means of GraphicsWindowIOS::WindowData...but in this way I find
 difficult to later manage those UIView and UIViewController objects
 especially if I need to integrate them in a dynamic view hierarchy.
 
 What I'd like to do is to create a UIView-derived class that encapsulates
 everything required to use OSG to draw in just that view, then I'd like to
 manage that view by my own UIViewController (not related to OSG).
 
 Is there a way to do this with what is already available in OSG (2.9.13)? If
 not, can anyone suggest what (beyond creating a context and all OpenGLES
 related stuff) the UIView-derived class should do from the OSG point of
 view?
 
 Thanks.
 Alessandro
 
 
 
 
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] iOS: integration with not-OpenGL apps

2011-05-02 Thread Alessandro Terenzi
Hi,
I'm trying to find a way to integrate OSG into a generic app for iOS, but
I'm facing some problems. Maybe I'm missing something, but as far as I've
understood, it looks like that, in order to use OSG on iOS, I must always
use the UIWindow and the corresponding UIView/UIViewController objects
created by means of GraphicsWindowIOS::WindowData...but in this way I find
difficult to later manage those UIView and UIViewController objects
especially if I need to integrate them in a dynamic view hierarchy.

What I'd like to do is to create a UIView-derived class that encapsulates
everything required to use OSG to draw in just that view, then I'd like to
manage that view by my own UIViewController (not related to OSG).

Is there a way to do this with what is already available in OSG (2.9.13)? If
not, can anyone suggest what (beyond creating a context and all OpenGLES
related stuff) the UIView-derived class should do from the OSG point of
view?

Thanks.
Alessandro
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org