[Mono-devel-list] SDL on mac os x: has anyone managed it yet?

Jason Bell bell_jason at yahoo.ca
Sat Feb 26 23:33:51 EST 2005


I love it when trying an alternate method provides a
solution to the original problem.  Messing about with
cocoasharp solved the problem.

I got SDL working with mono on mac os x!  I'm sure the
tao guys will be very interested, I'll post in their
forums.  Here's how:

First of all, you can't use mono to start the
application, you have to use CocoaSharpLoader.

I still got the error:

<Uncaught exception:
<NSInternalInconsistencyException> Error (1002)
creating CGSWindow
Trace/BPT trap

A bit of research showed that this error occurres if
cocoa hasn't been initialised,  which can be done with
the API call NSApplicationLoad.

So, I did an external declaration for that function:

[DllImport("/System/Library/Frameworks/Cocoa.framework/Cocoa")]
public static extern void NSApplicationLoad();

then just make a call to NSApplicationLoad prior to
calling SDL_Init.

Voila

Jason Bell

 --- kangaroo <grompf at sublimeintervention.com> wrote: 
> Jason,
> 
> 	Do you have any sample code that you expect to work
> that doesn't? (ie; 
> a testcase)
> If so forward it off to me and I'll take a look at
> the issue when I 
> have time.
> 
> -kangaroo
> 
> On 26-Feb-05, at 6:08 AM, Jason Bell wrote:
> 
> > Thanks for the idea, but alas, I experience the
> same
> > problems.
> >
> > I was looking at cocoasharp, and see it has
> bindings
> > for NSOpenGLView.  So until someone with more
> > knowledge of the inner workings of mono and sdl
> finds
> > a solution, I'll create seperate windowing classes
> and
> > functions for the mac.  So a common function that
> the
> > user calls can just use ifdefs to determing what
> os it
> > is running under.  Once someone manages to find a
> way
> > to get SDL working, It'll be a simple matter to
> remove
> > the cocoasharp code.
> >
> > It's not the solution I was hoping for, but I'm
> tired
> > of beating my head against this issue.
> >
> > Thanks for your input
> >
> > Jason Bell
> >
> >  --- Paolo Molaro <lupus at ximian.com> wrote:
> >> On 02/24/05 Jason Bell wrote:
> >>> 2) Application starts, and an initialisation
> >> function
> >>> of my own making in an unmanaged library is
> >> called, no
> >>> errors occur, but the application enters an
> >> infinite
> >>> loop, presumably because the program didn't
> return
> >> to
> >>> the c# Main function.
> >>
> >> Are you using mono 1.1.4? Earlier versions ran
> the
> >> user program
> >> in a subthread and the apple cocoa runtime
> >> misbehaves in this case.
> >>
> >> lupus
> >>
> >> -- 
> >>
> >
>
-----------------------------------------------------------------
> >> lupus at debian.org
> >> debian/rules
> >> lupus at ximian.com                            
> Monkeys
> >> do it better
> >> _______________________________________________
> >> Mono-devel-list mailing list
> >> Mono-devel-list at lists.ximian.com
> >>
> >
>
http://lists.ximian.com/mailman/listinfo/mono-devel-list
> >>
> >
> >
>
______________________________________________________________________
> > Post your free ad now! http://personals.yahoo.ca
> > _______________________________________________
> > Mono-devel-list mailing list
> > Mono-devel-list at lists.ximian.com
> >
>
http://lists.ximian.com/mailman/listinfo/mono-devel-list
> >
> >
> > !DSPAM:4220570e40051695418125!
> >
> 
>  

______________________________________________________________________ 
Post your free ad now! http://personals.yahoo.ca



More information about the Mono-devel-list mailing list