Comments (7)
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.
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.
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.
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.
A fix for this issue: https://github.com/0xe2-0x9a-0x9b/Go-SDL/commit/e4605f9fc41eb624d69a9d7e6e72e95b64e51e2a
from go-sdl.
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.
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)
- Compile error with "6g version weekly.2011-04-04 8085"
- Unlock flips the buffer HOT 1
- Unable to compile on Windows/MinGW32 HOT 3
- "Package SDL_ttf was not found in the pkg-config search path." HOT 5
- Included test program crashes on startup (OSX) HOT 2
- License?
- Bunch of unresolved names when building HOT 1
- Fail to build HOT 3
- Issue with Goinstall HOT 1
- Does Go-SDL work with the go command? HOT 2
- PushEvent HOT 3
- Event parameters HOT 1
- Go-SDL/ttf incompatible with Go 1.0.1? HOT 3
- Add SDL_mixer effects for things like positional sound
- [fyi] go-sdl-example
- Outdated Install Instructions? HOT 1
- which fork should i use? HOT 1
- Uncaught exception in OSX 10.8.4 when trying to run the tests HOT 1
- Update to newer go version
- On Windows "Package sdl was not found in the pkg-config search path."
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-sdl.