Coder Social home page Coder Social logo

Do an OSX port about agsjoy HOT 5 OPEN

ericoporto avatar ericoporto commented on June 24, 2024
Do an OSX port

from agsjoy.

Comments (5)

vga-256 avatar vga-256 commented on June 24, 2024 1

Yup. Here's a guide:
http://lazyfoo.net/tutorials/SDL/01_hello_SDL/mac/index.php

from agsjoy.

ericoporto avatar ericoporto commented on June 24, 2024

testing how to build agsjoy for OSX

Go to:

https://libsdl.org/download-2.0.php

Download the latest stable release. Place in a folder (I placed in my_home/Dev), cd to it and do:

./configure
make
sudo make install

Right now I am having the error:

$ clang++ agsjoy.cpp -Wall -framework SDL2 -dynamiclib -o libagsjoy.dylib
agsjoy.cpp:255:55: warning: operator '>>' has lower precedence than '-'; '-'
      will be evaluated first [-Wshift-op-parentheses]
         theJoy.buttons = theJoy.buttons & (4294967295-1>>ev.jbutton.button);
                                            ~~~~~~~~~~^~~~
 agsjoy.cpp:255:55: note: place parentheses around the '-' expression to silence
      this warning
     theJoy.buttons = theJoy.buttons & (4294967295-1>>ev.jbutton.button);
                                                  ^
                                        (           )
agsjoy.cpp:230:7: warning: unused variable 'ax' [-Wunused-variable]
  int ax;
      ^
agsjoy.cpp:231:7: warning: unused variable 'b' [-Wunused-variable]
  int b;
      ^
3 warnings generated.
ld: framework not found SDL2
clang: error: linker command failed with exit code 1 (use -v to see invocation)

So I guess I didn’t correctly installed the SDL2 framework (ld: framework not found SDL2).

from agsjoy.

ericoporto avatar ericoporto commented on June 24, 2024

After downloading the development library of SDL2 (SDL2-2.0.8.dmg), opening it, and copying the SDL2.framework to /Library/Frameworks/ and doing the codesign codesign -f -s - SDL2 on /Library/Frameworks/SDL2.framework/ , it was possible to build using:

clang++ agsjoy.cpp -Wall -framework SDL2 -F /Library/Frameworks/ -dynamiclib -o libagsjoy.dylib 

with this, it was possible to generate the dylib : libagsjoy.dylib.zip


Only GetName should work because conflict with SDL_pollevent, see branch ags-sdl2-port-fix for fix.


Merged the branch in a default way to check for SDL initialization

from agsjoy.

ericoporto avatar ericoporto commented on June 24, 2024

A new and working libagsjoy.dylib has been added on the releases. I still don't know yet how to properly include the plugin in the MAC OSX port, but at least it should work.

from agsjoy.

ericoporto avatar ericoporto commented on June 24, 2024

@256colour , can you verify if it's working on MacOS ?

from agsjoy.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.