Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Sun Nov 19, 2017 9:15 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Building SuperSpriteSurface2 for Cocoa?
PostPosted: Thu Apr 21, 2011 12:07 am 
Offline
User avatar

Joined: Sun Mar 23, 2008 3:30 pm
Posts: 163
I'm trying to build a game I've written using SuperSpriteSurface2 using Cocoa. It doesn't work at the moment, but I've narrowed down the problem I think. If you go and download it from TinRocket's new website here: http://www.tinrocket.com/wp-content/plu ... d.php?id=4 it will build fine for Carbon but not Cocoa.

I've gone through the code and it looks like some archaic compiler conditions dating from before RB could build for Cocoa. It checks for TargetCarbon in about four places and if it's false it builds for InterfaceLib (Mac OS 9). The Mac OS crash reports are complaining about requests for InterfaceLib, so I think these are the culprits.

But now I'm stuck at this point. Those four lines need to be updated with Cocoa alternatives but I'm not sure what they would be (besides the obvious removal of the compiler conditions). They are reproduced below:

#if TargetCarbon then
Declare Sub GetMe lib kCarbonLibrary Alias "GetCurrentProcess" (PSN As Ptr)
Declare Sub GetFrontProcess lib kCarbonLibrary (proc as ptr)
Declare function SameProcess Lib kCarbonLibrary (PSN1 as Ptr, PSN2 as Ptr, result as Ptr) as Short
#else
Declare Sub GetMe Lib "InterfaceLib" Alias "GetCurrentProcess" (PSN As Ptr) Inline68K("3F3C0037A88F")
Declare Sub GetFrontProcess Lib "InterfaceLib" (proc as Ptr) Inline68K("70FF2F003F3C0039A88F")
Declare Function SameProcess Lib "InterfaceLib" (PSN1 as Ptr, PSN2 as Ptr, result as Ptr) as Short Inline68K("3F3C003DA88F")
#endif


//flush events
#if TargetCarbon then
Declare Sub FlushEvents Lib kCarbonLibrary (whichMask as Integer, stopMask as Integer)
FlushEvents &hFFFF, 0
#endif
//


Any help would be much appreciated.


Top
 Profile  
Reply with quote  
 Post subject: Re: Building SuperSpriteSurface2 for Cocoa?
PostPosted: Fri Apr 22, 2011 9:24 am 
Offline
User avatar

Joined: Fri Sep 30, 2005 11:48 am
Posts: 3554
Location: Lenexa, KS
Have you tried contacting TinRocket for help?

_________________
Bob K.

A blog about being a Real Studio/Xojo developer at http://www.bkeeneybriefs.com


Top
 Profile  
Reply with quote  
 Post subject: Re: Building SuperSpriteSurface2 for Cocoa?
PostPosted: Fri Apr 22, 2011 10:46 am 
Offline
User avatar

Joined: Sun Mar 23, 2008 3:30 pm
Posts: 163
Yes.


Top
 Profile  
Reply with quote  
 Post subject: Re: Building SuperSpriteSurface2 for Cocoa?
PostPosted: Fri Apr 22, 2011 11:55 am 
Offline
Real Software Engineer

Joined: Sat Dec 24, 2005 8:18 pm
Posts: 7858
Location: Canada, Alberta, Near Red Deer
1) change
#if TargetCarbon then
to
#if TargetCarbon or TargetCocoa then

not 100% sure you need to update the kCarbonLibrary constant but you may (I cant tell whether it's a dynamic const or not and what the values are)

_________________
Norman Palardy (Real Software)


Top
 Profile  
Reply with quote  
 Post subject: Re: Building SuperSpriteSurface2 for Cocoa?
PostPosted: Fri Apr 22, 2011 12:01 pm 
Offline
User avatar

Joined: Sun Mar 23, 2008 3:30 pm
Posts: 163
Yes, I eded up removing the conditional statements and changing the constant. The SuperSpriteSurface 2 demo program now builds but it doesn't display anything recognizable. I can see an OpenGL surface and it does *something* but it's not what it's supposed to. It does work when building for Carbon, though.


Top
 Profile  
Reply with quote  
 Post subject: Re: Building SuperSpriteSurface2 for Cocoa?
PostPosted: Sun Apr 24, 2011 7:26 pm 
Offline
User avatar

Joined: Thu Feb 16, 2006 10:04 pm
Posts: 262
For what it's worth. None of the projects I have using the OpenGLSurface "work" when the build setting is set to Cocoa. The 3D object is not shown. You'd have to ask John at TinRocket or someone at REAL to sprinkle some calls to OpenGL.glGetError() during the initial OpenGL calls as no Console warnings are written, at least not on my machine.

I may have filed a bug report on a specific Console error .... :? .... The declare calls shouldn't matter in Cocoa, my best guess is that Cocoa restricts/defines the buffer color depth and specifics it can use where Carbon did not in the early set up stages.

_________________
Thomas C.
Real Studio Blog
http://bigdaddysurf.com/blog/

https://itunes.apple.com/us/app/maui-dragstrip-2013/id604516033?mt=8
https://itunes.apple.com/us/book/how-to-waterstart/id576214730?mt=11


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group