Giter Club home page Giter Club logo

go-sdl2-examples's People

Contributors

drakbar avatar dynamiccast avatar gen2brain avatar jendave avatar malashin avatar theunkn0wn1 avatar veeableful avatar waschik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

go-sdl2-examples's Issues

recording-audio.go is not working for me...

Hi veandco,

When I run the recording-audio.go file I get this error message:
C:\Users*****\AppData\Local\Temp\go-build233611566\b001_cgo_main.o:/tmp/go-build/cgo-generated-wrappers:2: undefined reference to `OnAudio'
collect2.exe: error: ld returned 1 exit status

Can you help me with this?

Thanks
GNK03

Sorry, I copy pasted the file and for whatever reason there was an empty line every second line. Between "//export OnAudio" and "func OnAudio(userdata unsafe.Pointer, _stream *C.Uint8, _length C.int) {" can't be an empty line. This caused the error.

Window is not visible

I am running the examples on MacOS Mojave and the window never appears even though the app icon shows the app is running in the task bar. If I call
sdl.PollEvent() or sdl.PumpEvents() just before the sdl.Delay(2000) line, then the window displays just fine. This happens for all of the examples that do not use an event loop.

Compile error "impossible type switch case: sdl.QuitEvent"

When trying to compile examples/keyboard-input/keyboard-input.go, I get the following error:


impossible type switch case: sdl.QuitEvent
event (variable of type sdl.Event) cannot have dynamic type sdl.QuitEvent

This is due to a change following the commit "examples: updated to remove pointer in event switch cases" where "*sdl.QuitEvent" was replaced by "sdl.QuitEvent" in the switch statement.

If I put back the dereferencing operator '*', the code compiles.

There must be a good reason for the change in the commit. Could you explain the rationale please? Thank you in advance !

If that matters, I am using go1.22.2 linux/amd64

Android example bug (ARM/ARM64)

I successfully compiled the so file but encountered an error while opening the example app:

For ARM architecture:

arm

For ARM64 architecture:

arm64

How to compile SDL2 to Android on Windows10 platform?

How to use go-sdl2-examples\examples\android examples on Windows platform. Is how to compile SDL2 on Windows10 platform to APK file .
The original README was for Linux, I don't know how to put it in Windows10.
Thank you!

CMD: go run main.go is an main.exe

cannot find -lSDL2_gfx (x64?)

Hi,

when i try to install gfx package with "go get github.com/veandco/go-sdl2/gfx"

C:/Program Files/mingw-w64/x86_64-7.3.0-posix-seh-rt_v5-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lSDL2_gfx
collect2.exe: error: ld returned 1 exit status

I've downloaded SDL2_gfx-1.0.1 and tried to compile it with Visual Studio but i get several error's, i guess it's because of the arch.
Is there any precompiled or successful compilation of the SDL2_gfx lib for x64 ?

Thanks in advance,
Sam

Why loop about event need twice

When it comes to Event, most of code in examples look like this:

for event := sdl.PollEvent(); event != nil; event = sdl.PollEvent() {
    switch t := event.(type) {
    ...
    } 
}

Why the event (a interface) should be written = sdl.PollEvent() twice?

Cursor unresponding

I have a problem with the cursor, it also occurs in the render example provided. The problem is if I move my mouse to the created window, it becomes unresponding.

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.