go-sdl2 | SDL2 binding for Go | Game Engine library
kandi X-RAY | go-sdl2 Summary
kandi X-RAY | go-sdl2 Summary
SDL2 binding for Go
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of go-sdl2
go-sdl2 Key Features
go-sdl2 Examples and Code Snippets
Community Discussions
Trending Discussions on go-sdl2
QUESTION
I am trying to import sdl2 package from https://github.com/veandco/go-sdl2. I followed all the steps that appear on readme.md for Windows. Installing mingw64 and do on cmd:
...ANSWER
Answered 2021-Feb-19 at 08:30According to New module changes in Go 1.16 blog
The go command now builds packages in module-aware mode by default, even when no go.mod is present. This is a big step toward using modules in all projects.
as suggested in the blog change the value for GO111MODULE to auto go env -w GO111MODULE=auto
would fix the issue.
QUESTION
SDL version: 2.0.12
OpenGL version: 3.3 INTEL-10.4.14
I had to force the OpenGL version to 3.3 by requesting core profile, the default version I would get otherwise is 1.2
Following this video tutorial http://youtu.be/yxAPS2eyKmA Games with Go, I tried the OpenGL sample code, and it just shows a black window.
It's supposed to render an orange triangle.
I'm getting INVALID_OPERATION
after the second-to-last statement gl.DrawArrays(gl.TRIANGLES, 0, 3)
https://gist.github.com/ErnestoBorio/87b09bf3cc496657a83637fd4876e943
...ANSWER
Answered 2020-May-11 at 01:46Your code never calls glUseProgram
which means you attempt to draw without a current program object, which is not valid in core profile OpenGL.
QUESTION
I register three events via SDL_RegisterEvents
. However, SDL_PollEvent()
only returns events of the first type and swallows the others.
This is my code (it's Go, but I don't think that's relevant here):
...ANSWER
Answered 2019-Aug-05 at 05:59It only is because of go binding, specifically the line https://github.com/veandco/go-sdl2/blob/24851c1f2d98dcac2a68223a24e6f799fc921f1e/sdl/events.go#L1035 (type conversion only triggered on SDL_USEREVENT
, which matches only with first registered event; anything else is reported as "CommonEvent", losing all extra data you may have passed) . You probably should report a bug to developer of said binding.
QUESTION
I just started going through the SDL tutorial lessons at http://lazyfoo.net/tutorials/SDL/index.php and am working on the first lesson (Lesson 01). I am hand-translating the C/C++ code to Go using the github.com/veandco/go-sdl2
library.
This is my code:
...ANSWER
Answered 2018-Mar-29 at 13:59Add an event loop and redraw either unconditionally or when asked to by window manager (SDL_WINDOWEVENT
). You can't just draw once and expect things to stay on screen, or even ever be visible (e.g. your draw happened before window manager was ready to show your window), especially with compositing window managers.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install go-sdl2
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page