File tree 5 files changed +280
-264
lines changed
5 files changed +280
-264
lines changed Original file line number Diff line number Diff line change 61
61
+ ` GetCurrentVideoDriver() ` returns (string, error) instead of string
62
62
+ ` Window.Destroy() ` returns error
63
63
+ ` Window.GetID() ` returns (uint32, error) instead of uint32
64
+ + ` GetNumRenderDrivers() ` returns (int, error) instead of int
65
+ + ` GetRenderDriverInfo() ` returns (int, error) instead of int
66
+ + ` Texture.Destroy() ` returns error
67
+ + ` Renderer.Destroy() ` returns error
64
68
65
69
- Unexported ` Padding ` in ` AudioSpec ` struct
66
70
- Unexported ` goHintCallback `
Original file line number Diff line number Diff line change 1
1
package sdl
2
2
3
+ /*
4
+ #include "sdl_wrapper.h"
5
+
6
+ void GoSetError(const char *fmt) {
7
+ SDL_SetError("%s", fmt);
8
+ }
9
+ */
3
10
// #include "sdl_wrapper.h"
4
11
import "C"
5
12
import "errors"
@@ -35,6 +42,16 @@ func GetError() error {
35
42
return nil
36
43
}
37
44
45
+ // SetError set the SDL error message.
46
+ // (https://wiki.libsdl.org/SDL_SetError)
47
+ func SetError (err error ) {
48
+ if err != nil {
49
+ C .GoSetError (C .CString (err .Error ()))
50
+ return
51
+ }
52
+ C .GoSetError (nil )
53
+ }
54
+
38
55
// ClearError clears any previous error message.
39
56
// (https://wiki.libsdl.org/SDL_ClearError)
40
57
func ClearError () {
You can’t perform that action at this time.
0 commit comments