Comments (3)
Are you running it on amd64 ?
If so, you probably need to regenerate sdl_defs.go (touch sdl.c ; make).
But after that (probably due to bug in godefs) you need to repair Keysym struct.
You need to change the type of Sym from byte to uint32 and remove unnecessary padding.
Im not sure if that is correct on amd64, so you need to experiment, or send me the whole file and i will try to figure it out.
If that doesn't help get the most recent version, i added some more debugging.
from go-sdl.
Yeah, I'm using a 64 bit processor. I regenerated the sdl_defs.go file, although I got a bunch of warnings doing so.
godefs -g sdl sdl.c > sdl_defs.go
warning: missing name for struct sprivate_hwdata
warning: missing name for struct sSDL_BlitMap
ignoring bitfield $VideoInfo.hw_available
ignoring bitfield $VideoInfo.wm_available
ignoring bitfield $VideoInfo.UnusedBits1
ignoring bitfield $VideoInfo.UnusedBits2
ignoring bitfield $VideoInfo.blit_hw
ignoring bitfield $VideoInfo.blit_hw_CC
ignoring bitfield $VideoInfo.blit_hw_A
ignoring bitfield $VideoInfo.blit_sw
ignoring bitfield $VideoInfo.blit_sw_CC
ignoring bitfield $VideoInfo.blit_sw_A
ignoring bitfield $VideoInfo.blit_fill
warning: missing name for struct sprivate_yuvhwfuncs
warning: missing name for struct sprivate_yuvhwdata
ignoring bitfield $Overlay.hw_overlay
ignoring bitfield $Overlay.UnusedBits
6g -o _go_.6 sdl_defs.go sdl.cgo1.go sdl.cgo2.go
rm -f _obj/sdl.a
gopack grc _obj/sdl.a _go_.6 sdl.cgo3.6
The generated file is here (http://gopaste.org/view/3nN2O ) I changed Sym from byte to uint32 and I removed the paddings (I also tried different combinations of removing or keeping the padding in the Keysym struct) but I still got the unknown key error printed. However, if I press control and hit any key in the test, then the first number becomes 64 and an @ symbol is printed. When the shift key is pressed, the first number becomes one, but unknown key is still printed.
from go-sdl.
Cgo adds extra algnment before nested structs. I corrected Keysym by hand and everything except Scancode should work now (for amd64). I will try to find better solution.
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.