Giter Club home page Giter Club logo

Comments (7)

banthar avatar banthar commented on August 17, 2024

http://www.libsdl.org/cgi/docwiki.cgi/SDL_envvars

Try using x11 driver (SDL_VIDEODRIVER=x11).

If you want to use the default driver (Quartz), you need to run your program through SDLmain. In Go it's not easy.

from go-sdl.

nickoneill avatar nickoneill commented on August 17, 2024

banthar, your comment helped me get sdl working in x11 on roughly the same hardware as bluehex. I'm interested in getting things running through Quartz as well, do you have any tips on where I should start looking? Or an explanation why it's not easy? Any information helps.

from go-sdl.

banthar avatar banthar commented on August 17, 2024

To use GUI on Mac (and Windows), you need to initialize some stuff before your program starts. In SDL It's done through SDLmain module. It contains entry point for GUI programs. On windows it's WinMain, on Mac it's some Objective-C stuff. The problem is you cannot write SDLmain in Go. It has to be written in C/Objective-C. And it has to be the entry point of your executable, while Go already specifies it's own to make it's own initializations. Finally, the executable has to be marked as GUI.

Basically, Go needs to add support for GUI programs. This requires some changes in go compiler and runtime. On windows some work is already done (http://code.google.com/p/go/source/detail?r=ef61c195ed), but I haven't heard anything about Mac. Maybe it's mentioned somewhere in Go docs, issues, or mailing list/irc archives.

I don't know if any of this is accurate. You should probably talk to someone familiar with Macs.

from go-sdl.

cookieo9 avatar cookieo9 commented on August 17, 2024

SDL 1.3 doesn't need a SDLmain function on OSX as far as I can tell, but the Go-SDL wrapper doesn't compile due to some API differences.

from go-sdl.

 avatar commented on August 17, 2024

A fix for this issue: https://github.com/0xe2-0x9a-0x9b/Go-SDL/commit/e4605f9fc41eb624d69a9d7e6e72e95b64e51e2a

from go-sdl.

netpoetica avatar netpoetica commented on August 17, 2024

SDL 1.3 doesn't exist as far as I can tell O_O

I initially had this issue, but then I downlloaded SDL2 and did configure, make, make install (I couldn't find any SDL 1.3) and now I get a different error:

# command-line-arguments
ld: library not found for -lSDLmain
collect2: ld returned 1 exit status
/Users/netpoetica/go/pkg/tool/darwin_amd64/6l: running gcc failed: unsuccessful exit status 0x100

Anyone know what's going on here?

Had to revert back to 1.2 as apparently SDL + Mac OSX is a major problem :0

So back to this same issue. Is there an updated solution to this (this thread is years old)? Additionally this URL http://www.libsdl.org/cgi/docwiki.cgi/SDL_envvars is broken so I cannot follow to learn more about using x11

from go-sdl.

netpoetica avatar netpoetica commented on August 17, 2024

Also if it helps any, I am using it to try to compile some of the go-gl examples. I am able to compile some of them, like some of the NeHe ones, but this particular one is actually from github.com/go-gl/examples/sdl/gears - that's where I get this issue.

As I play around more with the framework I will try to post back if I ever get the gears example working

Thanks a bunch!

from go-sdl.

Related Issues (20)

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.