Page 1 of 2

Mac OSX port would be lovely

Posted: Thu Jun 26, 2008 4:48 pm
by qubodup
Image

If you have a mac and find LÖVE stylish: port it, will ya? :D

Re: Mac OSX port would be lovely

Posted: Thu Jun 26, 2008 8:10 pm
by rude
Yeah ... we would of course provide MacOSX binaries, but as you may know, none of us have a Mac. :(

Re: Mac OSX port would be lovely

Posted: Thu Jun 26, 2008 10:58 pm
by mike
I mean.. we would do it if someone would donate a mac to us.. *hint hint*

(preferably a MacBook Pro)

Re: Mac OSX port would be lovely

Posted: Fri Jun 27, 2008 6:22 am
by Sardtok
I'm guessing you want that with CodeWarrior, right?

Re: Mac OSX port would be lovely

Posted: Fri Jun 27, 2008 2:56 pm
by appleide
Hi I use a mac.

Recently I have been developing a RTS game in lua (Don't ask me if its fast enough, I don't know yet.). Incidentally created something like LOVE, though of course nowhere as feature complete and probably lower level (Haven't looked at LOVE api yet so I am not sure.).

Just found this a couple of weeks ago.

I downloaded the source but unfortunately I don't know make files (Betrays my experience at C at only 6 months :\ ). That also means I haven't managed to get it to compile. I don't have access to a linux or windows machine. (I wouldn't know how to develop on a windows machine though).

I'll spend more time on the week end to try to get this working. If I don't reply that means I gave up.

Re: Mac OSX port would be lovely

Posted: Sat Jun 28, 2008 4:21 am
by appleide
I think I lost at level 3: "Making love_opengl ..."
Worked with the Linux version love source code

I am suspecting there is no "-lGL" in Mac OS X, just -framework OpenGL and -framework GLUT, so I need to use -framework SDL instead of -lSDL.
if I use -framework SDL I can't use -lSDLmain; it results in the error:
"/usr/bin/ld: Undefined symbols:
_SDL_main"

I need to compile an Objective-C code called "SDLMain.m". (That's what I did for my own project). But I suck at make files and I couldn't get it to compile with it. so I get:
"/usr/bin/ld: Undefined symbols:
_main"

I followed the compiler errors to get to where i got to:

Code: Select all

changed love.make
changed -llua to -framework lua 
added -framework Cocoa

change src/opengl/Image.cpp 
from #include <SDL_opengl.h> to #include <SDL/SDL_opengl.h>
moved #include <SDL/SDL_opengl.h> to header
changed texture to GLuint from unsigned int

moved #include "GLee.h" to before  #include <SDL/SDL_opengl.h>

changed love_opengl.cpp
line 212 changed buffers from int to GLint buffers;
line 213 changed samples from int to GLint samples;
line 220: casted buffers and samples back to int
line 663 int dst, src changed to GLint
line 675 changed int mode to GLint mode

changed TrueTypeFont.cpp
line 182 changed line to textures = (unsigned int *)(new GLuint[MAX_CHARS]);
line 200 changed line to glGenTextures(MAX_CHARS, (GLuint*)textures);
line 218 changed line to glDeleteTextures(MAX_CHARS, (const GLuint*)textures);

used darwinports to install physfs 1.0.1

changed love_opengl.make
removed "-shared"
changed -lGLU, -lGL to -frameowork GLUT
changed -llua5.1 to -framework Lua
added -framework OpenGL
changed -lSDL to -framework SDL
changed -lSDL_mixer to -framework SDL_mixer
My compiler (g++/gcc) doesn't seem to let int/unsigned and GLint/GLuint to be used interchangeably, you guys might want to investigate that.

EDIT: I use a macbook with mac os x.4 tiger, btw

Re: Mac OSX port would be lovely

Posted: Sat Jun 28, 2008 6:20 am
by appleide
I managed to compile everything by:
Editing SDLMain.m (I put it in src/opengl, random place, but wtev..) to comment out the line with "SDL_main"
In the rest of the makefiles, added -framework Lua -framework SDL -framework Cocoa src/opengl/SDLMain.m
and replaced their respective -lXXX thingies

Then I removed "-shared" option everywhere. That tag doesn't exist on mac os x.

However when I run love, it results in segmentation fault when loading the timer module.

I am going to try a couple more tricks.

Re: Mac OSX port would be lovely

Posted: Sat Jun 28, 2008 8:36 am
by appleide

Code: Select all

This is LOVE 0.3.1 (Space Meat).

INIT love.timer [SDL]
INIT love.filesystem [PhysFS]
Loading of module failed. Failed loading liblove_opengl.dylib: dlopen(liblove_opengl.dylib, 2): Library not loaded: /sw/lib/libpng12.0.dylib
  Referenced from: /usr/local/lib/libIL.1.dylib
I want to ask, where does libpng come into this??? : / Why is it not loaded....

Re: Mac OSX port would be lovely

Posted: Sat Jun 28, 2008 9:01 am
by appleide
I reinstalled libpng and removed old copies.... yay!

I am going to download love again and do this 'neatly'.

I'll upload a .app INTEL ONLY binary that I am 90% sure only works on my computer. Someone else please test it.
http://appleide.sitesled.com/LOVE.zip

Re: Mac OSX port would be lovely

Posted: Sat Jun 28, 2008 10:46 am
by appleide
EDIT: Hmm, actually, if we want to have a mac build with same source code as the linux and window builds the GLuint/ int thing is going to have to be fixed.

mac version src:
http://appleide.sitesled.com/lovesrc.zip

I editted all the make files and many source code files so its pretty messy. Need to clean it up.