From 015c36b3f5f103f5e0825ba120efcab37e29e082 Mon Sep 17 00:00:00 2001 From: Larpon Date: Sat, 18 Nov 2023 11:03:26 +0100 Subject: [PATCH] all: update to new attribute syntax `[attr]` -> `@[attr]` (#623) --- a_types.c.v | 2 +- atomic.c.v | 2 +- audio.c.v | 6 +-- events.c.v | 58 ++++++++++++++-------------- examples/basic_mixer/basic_mixer.v | 2 +- examples/sdl_opengl_and_sokol/main.v | 2 +- examples/tvintris/tvintris.v | 6 +-- gamecontroller.c.v | 4 +- haptic.c.v | 18 ++++----- joystick.c.v | 4 +- keyboard.c.v | 2 +- messagebox.c.v | 8 ++-- mixer/mixer.c.v | 4 +- mouse.c.v | 2 +- mutex.c.v | 6 +-- pixels.c.v | 6 +-- rect.c.v | 6 +-- render.c.v | 6 +-- rwops.c.v | 2 +- sensor.c.v | 2 +- shape.c.v | 4 +- stdinc.c.v | 2 +- surface.c.v | 2 +- system_windows.c.v | 2 +- thread.c.v | 2 +- touch.c.v | 2 +- ttf/ttf.c.v | 2 +- version.c.v | 2 +- video.c.v | 4 +- 29 files changed, 85 insertions(+), 85 deletions(-) diff --git a/a_types.c.v b/a_types.c.v index dcd98466..c9861cf0 100644 --- a/a_types.c.v +++ b/a_types.c.v @@ -1,5 +1,5 @@ module sdl // va_list -[typedef] +@[typedef] pub struct C.va_list {} diff --git a/atomic.c.v b/atomic.c.v index 31c661c9..54bb0e1c 100644 --- a/atomic.c.v +++ b/atomic.c.v @@ -116,7 +116,7 @@ pub fn memory_barrier_acquire_function() { // AtomicT is a type representing an atomic integer value. It is a struct // so people don't accidentally use numeric operations on it. -[typedef] +@[typedef] pub struct C.SDL_atomic_t { pub: value int diff --git a/audio.c.v b/audio.c.v index 5607f324..bb908d55 100644 --- a/audio.c.v +++ b/audio.c.v @@ -147,7 +147,7 @@ pub type AudioCallback = fn (userdata voidptr, stream &u8, len int) // 7: FL FR FC LFE BC SL SR (6.1 surround) // 8: FL FR FC LFE BL BR SL SR (7.1 surround) -[typedef] +@[typedef] pub struct C.SDL_AudioSpec { pub: freq int // DSP frequency -- samples per second @@ -204,7 +204,7 @@ pub type AudioCVTPackedSDLAudioCVT = C.SDL_AUDIOCVT_PACKEDSDL_AudioCVT // you to pass it aligned data, but can possibly run much faster if you // set both its (buf) field to a pointer that is aligned to 16 bytes, and its // (len) field to something that's a multiple of 16, if possible. -[typedef] +@[typedef] pub struct C.SDL_AudioCVT { pub: needed int // Set to 1 if conversion possible @@ -501,7 +501,7 @@ pub fn convert_audio(cvt &AudioCVT) int { // - You push data as you have it, and pull it when you need it // // this is opaque to the outside world. -[typedef] +@[typedef] pub struct C.SDL_AudioStream { } diff --git a/events.c.v b/events.c.v index 28a20a0d..96ccfbeb 100644 --- a/events.c.v +++ b/events.c.v @@ -117,7 +117,7 @@ pub enum EventType { } // CommonEvent is fields shared by every event -[typedef] +@[typedef] pub struct C.SDL_CommonEvent { pub: @type EventType @@ -128,7 +128,7 @@ pub type CommonEvent = C.SDL_CommonEvent // DisplayEvent is display state change event data (event.display.*) // DisplayEvent is C.SDL_DisplayEvent -[typedef] +@[typedef] pub struct C.SDL_DisplayEvent { pub: @type u32 // ::SDL_DISPLAYEVENT @@ -144,7 +144,7 @@ pub: pub type DisplayEvent = C.SDL_DisplayEvent // WindowEvent is window state change event data (event.window.*) -[typedef] +@[typedef] pub struct C.SDL_WindowEvent { pub: @type EventType // ::SDL_WINDOWEVENT @@ -161,7 +161,7 @@ pub: pub type WindowEvent = C.SDL_WindowEvent // KeyboardEvent is Keyboard button event structure (event.key.*) -[typedef] +@[typedef] pub struct C.SDL_KeyboardEvent { pub: @type EventType // ::SDL_KEYDOWN or ::SDL_KEYUP @@ -177,7 +177,7 @@ pub: pub type KeyboardEvent = C.SDL_KeyboardEvent // TextEditingEvent is keyboard text editing event structure (event.edit.*) -[typedef] +@[typedef] pub struct C.SDL_TextEditingEvent { pub: @type EventType // ::SDL_TEXTEDITING @@ -191,7 +191,7 @@ pub: pub type TextEditingEvent = C.SDL_TextEditingEvent // TextInputEvent is keyboard text input event structure (event.text.*) -[typedef] +@[typedef] pub struct C.SDL_TextInputEvent { pub: @type EventType // ::SDL_TEXTINPUT @@ -203,7 +203,7 @@ pub: pub type TextInputEvent = C.SDL_TextInputEvent // MouseMotionEvent is mouse motion event structure (event.motion.*) -[typedef] +@[typedef] pub struct C.SDL_MouseMotionEvent { pub: @type EventType // ::SDL_MOUSEMOTION @@ -220,7 +220,7 @@ pub: pub type MouseMotionEvent = C.SDL_MouseMotionEvent // MouseButtonEvent is mouse button event structure (event.button.*) -[typedef] +@[typedef] pub struct C.SDL_MouseButtonEvent { pub: @type EventType // ::SDL_MOUSEBUTTONDOWN or ::SDL_MOUSEBUTTONUP @@ -238,7 +238,7 @@ pub: pub type MouseButtonEvent = C.SDL_MouseButtonEvent // MouseWheelEvent is mouse wheel event structure (event.wheel.*) -[typedef] +@[typedef] pub struct C.SDL_MouseWheelEvent { pub: @type EventType // ::SDL_MOUSEWHEEL @@ -253,7 +253,7 @@ pub: pub type MouseWheelEvent = C.SDL_MouseWheelEvent // JoyAxisEvent is joystick axis motion event structure (event.jaxis.*) -[typedef] +@[typedef] pub struct C.SDL_JoyAxisEvent { pub: @type EventType // ::SDL_JOYAXISMOTION @@ -270,7 +270,7 @@ pub: pub type JoyAxisEvent = C.SDL_JoyAxisEvent // JoyBallEvent is joystick trackball motion event structure (event.jball.*) -[typedef] +@[typedef] pub struct C.SDL_JoyBallEvent { pub: @type EventType // ::SDL_JOYBALLMOTION @@ -287,7 +287,7 @@ pub: pub type JoyBallEvent = C.SDL_JoyBallEvent // JoyHatEvent is joystick hat position change event structure (event.jhat.*) -[typedef] +@[typedef] pub struct C.SDL_JoyHatEvent { pub: @type EventType // ::SDL_JOYHATMOTION @@ -306,7 +306,7 @@ pub: pub type JoyHatEvent = C.SDL_JoyHatEvent // JoyButtonEvent is joystick button event structure (event.jbutton.*) -[typedef] +@[typedef] pub struct C.SDL_JoyButtonEvent { pub: @type EventType // ::SDL_JOYBUTTONDOWN or ::SDL_JOYBUTTONUP @@ -321,7 +321,7 @@ pub: pub type JoyButtonEvent = C.SDL_JoyButtonEvent // JoyDeviceEvent is joystick device event structure (event.jdevice.*) -[typedef] +@[typedef] pub struct C.SDL_JoyDeviceEvent { pub: @type EventType // ::SDL_JOYDEVICEADDED or ::SDL_JOYDEVICEREMOVED @@ -332,7 +332,7 @@ pub: pub type JoyDeviceEvent = C.SDL_JoyDeviceEvent // ControllerAxisEvent is game controller axis motion event structure (event.caxis.*) -[typedef] +@[typedef] pub struct C.SDL_ControllerAxisEvent { pub: @type EventType // ::SDL_CONTROLLERAXISMOTION @@ -349,7 +349,7 @@ pub: pub type ControllerAxisEvent = C.SDL_ControllerAxisEvent // ControllerButtonEvent is game controller button event structure (event.cbutton.*) -[typedef] +@[typedef] pub struct C.SDL_ControllerButtonEvent { pub: @type EventType // ::SDL_CONTROLLERBUTTONDOWN or ::SDL_CONTROLLERBUTTONUP @@ -364,7 +364,7 @@ pub: pub type ControllerButtonEvent = C.SDL_ControllerButtonEvent // ControllerDeviceEvent is controller device event structure (event.cdevice.*) -[typedef] +@[typedef] pub struct C.SDL_ControllerDeviceEvent { pub: @type EventType // ::SDL_CONTROLLERDEVICEADDED, ::SDL_CONTROLLERDEVICEREMOVED, or ::SDL_CONTROLLERDEVICEREMAPPED @@ -375,7 +375,7 @@ pub: pub type ControllerDeviceEvent = C.SDL_ControllerDeviceEvent // AudioDeviceEvent is audio device event structure (event.adevice.*) -[typedef] +@[typedef] pub struct C.SDL_AudioDeviceEvent { pub: @type EventType // ::SDL_AUDIODEVICEADDED, or ::SDL_AUDIODEVICEREMOVED @@ -390,7 +390,7 @@ pub: pub type AudioDeviceEvent = C.SDL_AudioDeviceEvent // TouchFingerEvent is touch finger event structure (event.tfinger.*) -[typedef] +@[typedef] pub struct C.SDL_TouchFingerEvent { pub: @type EventType // ::SDL_FINGERMOTION or ::SDL_FINGERDOWN or ::SDL_FINGERUP @@ -407,7 +407,7 @@ pub: pub type TouchFingerEvent = C.SDL_TouchFingerEvent // MultiGestureEvent is Multiple Finger Gesture Event (event.mgesture.*) -[typedef] +@[typedef] pub struct C.SDL_MultiGestureEvent { pub: @type EventType // ::SDL_MULTIGESTURE @@ -424,7 +424,7 @@ pub: pub type MultiGestureEvent = C.SDL_MultiGestureEvent // DollarGestureEvent is Dollar Gesture Event (event.dgesture.*) -[typedef] +@[typedef] pub struct C.SDL_DollarGestureEvent { pub: @type EventType // ::SDL_DOLLARGESTURE or ::SDL_DOLLARRECORD @@ -443,7 +443,7 @@ pub type DollarGestureEvent = C.SDL_DollarGestureEvent // This event is enabled by default, you can disable it with SDL_EventState(). // NOTE If this event is enabled, you must free the filename in the event. -[typedef] +@[typedef] pub struct C.SDL_DropEvent { pub: @type EventType // ::SDL_DROPBEGIN or ::SDL_DROPFILE or ::SDL_DROPTEXT or ::SDL_DROPCOMPLETE @@ -456,7 +456,7 @@ pub type DropEvent = C.SDL_DropEvent // SensorEvent is sensor event structure (event.sensor.*) // SensorEvent is C.SDL_SensorEvent -[typedef] +@[typedef] pub struct C.SDL_SensorEvent { pub: @type u32 // ::SDL_SENSORUPDATE @@ -468,7 +468,7 @@ pub: pub type SensorEvent = C.SDL_SensorEvent // QuitEvent is the "quit requested" event -[typedef] +@[typedef] pub struct C.SDL_QuitEvent { pub: @type EventType // ::SDL_QUIT @@ -478,7 +478,7 @@ pub: pub type QuitEvent = C.SDL_QuitEvent // OSEvent is an OS Specific event -[typedef] +@[typedef] pub struct C.SDL_OSEvent { pub: @type EventType // ::SDL_QUIT @@ -488,7 +488,7 @@ pub: pub type OSEvent = C.SDL_OSEvent // UserEvent is an user-defined event type (event.user.*) -[typedef] +@[typedef] pub struct C.SDL_UserEvent { pub: @type EventType // ::SDL_USEREVENT through ::SDL_LASTEVENT-1 @@ -505,13 +505,13 @@ pub type UserEvent = C.SDL_UserEvent // This event is disabled by default, you can enable it with SDL_EventState() // // NOTE If you want to use this event, you should include SDL_syswm.h. -[typedef] +@[typedef] pub struct C.SDL_SysWMmsg { } pub type SysWMmsg = C.SDL_SysWMmsg -[typedef] +@[typedef] pub struct C.SDL_SysWMEvent { pub: @type EventType // ::SDL_SYSWMEVENT @@ -522,7 +522,7 @@ pub: pub type SysWMEvent = C.SDL_SysWMEvent // Event is a general event structure. -[typedef] +@[typedef] pub union C.SDL_Event { pub: @type EventType // Event type, shared with all events diff --git a/examples/basic_mixer/basic_mixer.v b/examples/basic_mixer/basic_mixer.v index 4572b436..3f39dc01 100644 --- a/examples/basic_mixer/basic_mixer.v +++ b/examples/basic_mixer/basic_mixer.v @@ -111,7 +111,7 @@ fn load_mus(path string) !&mixer.Music { // We output to terminal to prevent depending on e.g. sdl.tff, in case // it doesn't work or is broken - it then become easier to // diagnose any potential library problems a setup might have. -[console] +@[console] fn main() { println('Const version ${mixer.major_version}.${mixer.minor_version}.${mixer.patchlevel}') mut compiled_version := sdl.Version{} diff --git a/examples/sdl_opengl_and_sokol/main.v b/examples/sdl_opengl_and_sokol/main.v index 8a177a66..5a112b7e 100644 --- a/examples/sdl_opengl_and_sokol/main.v +++ b/examples/sdl_opengl_and_sokol/main.v @@ -25,7 +25,7 @@ struct Vertex_t { a f32 } -[console] +@[console] fn main() { sdl.init(sdl.init_video) diff --git a/examples/tvintris/tvintris.v b/examples/tvintris/tvintris.v index 24fd7133..a01dcba7 100644 --- a/examples/tvintris/tvintris.v +++ b/examples/tvintris/tvintris.v @@ -451,7 +451,7 @@ enum Action { fire } -[inline] +@[inline] fn (game &Game) fill_rect(s &sdl.Surface, r &sdl.Rect, c &sdl.Color) { sdl.fill_rect(s, r, sdl.map_rgba(game.sdl.screen.format, c.r, c.g, c.b, c.a)) } @@ -767,12 +767,12 @@ fn (g &Game) draw_text(x int, y int, text string, tcol sdl.Color) { sdl.free_surface(tsurf) } -[inline] +@[inline] fn (g &Game) draw_ptext(x int, y int, text string, tcol sdl.Color) { g.draw_text(g.ofs_x + x, y, text, tcol) } -[live] +@[live] fn (g &Game) draw_begin() { // println('about to clear') sdl.render_clear(g.sdl.renderer) diff --git a/gamecontroller.c.v b/gamecontroller.c.v index e8268fe4..82df3b08 100644 --- a/gamecontroller.c.v +++ b/gamecontroller.c.v @@ -17,7 +17,7 @@ module sdl // // GameController is the gamecontroller structure used to identify an SDL game controller -[typedef] +@[typedef] pub struct C.SDL_GameController { } @@ -43,7 +43,7 @@ pub: hat_mask int } -[typedef] +@[typedef] pub struct C.SDL_GameControllerButtonBind { pub: bindType GameControllerBindType // C.SDL_GameControllerBindType diff --git a/haptic.c.v b/haptic.c.v index 80e1ac2a..09437440 100644 --- a/haptic.c.v +++ b/haptic.c.v @@ -131,7 +131,7 @@ pub const ( haptic_infinity = C.SDL_HAPTIC_INFINITY // 4294967295U ) -[typedef] +@[typedef] pub struct C.SDL_Haptic { } @@ -235,7 +235,7 @@ direction.dir[0] = 9000; // Since we only have two axes we don't need more param // See also: SDL_HapticEffect // See also: SDL_HapticNumAxes -[typedef] +@[typedef] pub struct C.SDL_HapticDirection { pub mut: @type u8 // The type of encoding @@ -253,7 +253,7 @@ pub type HapticDirection = C.SDL_HapticDirection // // See also: SDL_HAPTIC_CONSTANT // See also: SDL_HapticEffect -[typedef] +@[typedef] pub struct C.SDL_HapticConstant { pub mut: @type u16 // ::SDL_HAPTIC_CONSTANT @@ -329,7 +329,7 @@ pub type HapticConstant = C.SDL_HapticConstant // See also: SDL_HAPTIC_SAWTOOTHDOWN // See also: SDL_HapticEffect -[typedef] +@[typedef] pub struct C.SDL_HapticPeriodic { pub mut: @type u16 // ::SDL_HAPTIC_SINE, ::SDL_HAPTIC_LEFTRIGHT, ::SDL_HAPTIC_TRIANGLE, ::SDL_HAPTIC_SAWTOOTHUP or ::SDL_HAPTIC_SAWTOOTHDOWN @@ -372,7 +372,7 @@ pub type HapticPeriodic = C.SDL_HapticPeriodic // See also: SDL_HAPTIC_INERTIA // See also: SDL_HAPTIC_FRICTION // See also: SDL_HapticEffect -[typedef] +@[typedef] pub struct C.SDL_HapticCondition { pub mut: @type u16 // ::SDL_HAPTIC_SPRING, ::SDL_HAPTIC_DAMPER, ::SDL_HAPTIC_INERTIA or ::SDL_HAPTIC_FRICTION @@ -402,7 +402,7 @@ pub type HapticCondition = C.SDL_HapticCondition // // See also: SDL_HAPTIC_RAMP // See also: SDL_HapticEffect -[typedef] +@[typedef] pub struct C.SDL_HapticRamp { pub mut: @type u16 // ::SDL_HAPTIC_RAMP @@ -431,7 +431,7 @@ pub type HapticRamp = C.SDL_HapticRamp // // See also: SDL_HAPTIC_LEFTRIGHT // See also: SDL_HapticEffect -[typedef] +@[typedef] pub struct C.SDL_HapticLeftRight { pub mut: @type u16 // ::SDL_HAPTIC_LEFTRIGHT @@ -455,7 +455,7 @@ pub type HapticLeftRight = C.SDL_HapticLeftRight // // See also: SDL_HAPTIC_CUSTOM // See also: SDL_HapticEffect -[typedef] +@[typedef] pub struct C.SDL_HapticCustom { pub mut: @type u16 // ::SDL_HAPTIC_CUSTOM @@ -549,7 +549,7 @@ Uint16 fade_level; // Level at the end of the fade. // See also: SDL_HapticLeftRight // See also: SDL_HapticCustom -[typedef] +@[typedef] union C.SDL_HapticEffect { pub mut: // Common for all force feedback effects diff --git a/joystick.c.v b/joystick.c.v index 83455359..46ba0546 100644 --- a/joystick.c.v +++ b/joystick.c.v @@ -25,13 +25,13 @@ pub const ( hat_leftdown = C.SDL_HAT_LEFTDOWN // hat_left | hat_down ) -[typedef] +@[typedef] pub struct C.SDL_Joystick { } pub type Joystick = C.SDL_Joystick -[typedef] +@[typedef] pub struct C.SDL_JoystickGUID { pub: data [16]u8 diff --git a/keyboard.c.v b/keyboard.c.v index 070a461d..73a09619 100644 --- a/keyboard.c.v +++ b/keyboard.c.v @@ -10,7 +10,7 @@ module sdl // The SDL keysym structure, used in key events. // // NOTE If you are looking for translated character input, see the ::SDL_TEXTINPUT event. -[typedef] +@[typedef] pub struct C.SDL_Keysym { pub: scancode Scancode // C.SDL_Scancode // SDL physical key code - see ::SDL_Scancode for details diff --git a/messagebox.c.v b/messagebox.c.v index c8239d3e..e192bbff 100644 --- a/messagebox.c.v +++ b/messagebox.c.v @@ -23,7 +23,7 @@ pub enum MessageBoxButtonFlags { } // MessageBoxButtonData is individual button data. -[typedef] +@[typedef] pub struct C.SDL_MessageBoxButtonData { pub: flags u32 // ::SDL_MessageBoxButtonFlags @@ -34,7 +34,7 @@ pub: pub type MessageBoxButtonData = C.SDL_MessageBoxButtonData // MessageBoxColor is a RGB value used in a message box color scheme -[typedef] +@[typedef] pub struct C.SDL_MessageBoxColor { pub: r u8 @@ -55,7 +55,7 @@ pub enum MessageBoxColorType { } // MessageBoxColorScheme is a set of colors to use for message box dialogs -[typedef] +@[typedef] pub struct C.SDL_MessageBoxColorScheme { pub: colors [6]MessageBoxColor @@ -64,7 +64,7 @@ pub: pub type MessageBoxColorScheme = C.SDL_MessageBoxColorScheme // MessageBoxData is a MessageBox structure containing title, text, window, etc. -[typedef] +@[typedef] pub struct C.SDL_MessageBoxData { pub: flags u32 // ::SDL_MessageBoxFlags diff --git a/mixer/mixer.c.v b/mixer/mixer.c.v index 6ee31146..1fdd452c 100644 --- a/mixer/mixer.c.v +++ b/mixer/mixer.c.v @@ -84,7 +84,7 @@ pub const ( pub const effectsmaxspeed = 'MIX_EFFECTSMAXSPEED' // Chunk is the internal format for an audio chunk -[typedef] +@[typedef] pub struct C.Mix_Chunk { pub: allocated int @@ -123,7 +123,7 @@ pub const ( ) // Music is the internal format for a music chunk interpreted via mikmod -[typedef] +@[typedef] pub struct C.Mix_Music { } diff --git a/mouse.c.v b/mouse.c.v index dcaa9e33..1b2b58c1 100644 --- a/mouse.c.v +++ b/mouse.c.v @@ -6,7 +6,7 @@ module sdl // // SDL_mouse.h // -[typedef] +@[typedef] pub struct C.SDL_Cursor { } diff --git a/mutex.c.v b/mutex.c.v index 17324041..a92f1ba7 100644 --- a/mutex.c.v +++ b/mutex.c.v @@ -20,7 +20,7 @@ pub const mutex_maxwait = C.SDL_MUTEX_MAXWAIT // Mutex is the SDL mutex structure, defined in SDL_sysmutex.c // Mutex is C.SDL_mutex -[typedef] +@[typedef] pub struct C.SDL_mutex { } @@ -72,7 +72,7 @@ pub fn destroy_mutex(mutex &Mutex) { // Sem is the SDL semaphore structure, defined in SDL_syssem.c // Sem is C.SDL_sem -[typedef] +@[typedef] pub struct C.SDL_sem { } @@ -142,7 +142,7 @@ pub fn sem_value(sem &Sem) u32 { // Cond is the SDL condition variable structure, defined in SDL_syscond.c // Cond is C.SDL_cond -[typedef] +@[typedef] pub struct C.SDL_cond { } diff --git a/pixels.c.v b/pixels.c.v index 8b29b4f9..168aceb8 100644 --- a/pixels.c.v +++ b/pixels.c.v @@ -126,7 +126,7 @@ pub enum Format { external_oes = C.SDL_PIXELFORMAT_EXTERNAL_OES // Android video texture format } -[typedef] +@[typedef] pub struct C.SDL_Color { pub mut: r u8 @@ -137,7 +137,7 @@ pub mut: pub type Color = C.SDL_Color -[typedef] +@[typedef] pub struct C.SDL_Palette { pub mut: ncolors int @@ -149,7 +149,7 @@ pub mut: pub type Palette = C.SDL_Palette // NOTE Everything in the pixel format structure is read-only. -[typedef] +@[typedef] pub struct C.SDL_PixelFormat { pub: format Format diff --git a/rect.c.v b/rect.c.v index 313ce2d9..51dd81fd 100644 --- a/rect.c.v +++ b/rect.c.v @@ -12,7 +12,7 @@ module sdl // See also: SDL_EnclosePoints // See also: SDL_PointInRect // Point is C.SDL_Point -[typedef] +@[typedef] pub struct C.SDL_Point { pub mut: x int @@ -30,7 +30,7 @@ pub type Point = C.SDL_Point // See also: SDL_UnionRect // See also: SDL_EnclosePoints // Rect is C.SDL_Rect -[typedef] +@[typedef] pub struct C.SDL_Rect { pub mut: x int @@ -67,7 +67,7 @@ fn C.SDL_HasIntersection(const_a &C.SDL_Rect, const_b &C.SDL_Rect) bool // has_intersection determine whether two rectangles intersect. // // returns SDL_TRUE if there is an intersection, SDL_FALSE otherwise. -[inline] +@[inline] pub fn has_intersection(const_a &Rect, const_b &Rect) bool { return C.SDL_HasIntersection(const_a, const_b) } diff --git a/render.c.v b/render.c.v index ef9a1f0f..8b885c86 100644 --- a/render.c.v +++ b/render.c.v @@ -34,7 +34,7 @@ pub enum RendererFlags { targettexture = C.SDL_RENDERER_TARGETTEXTURE // 0x00000008 } -[typedef] +@[typedef] pub struct C.SDL_RendererInfo { pub: name &char // The name of the renderer @@ -68,13 +68,13 @@ pub enum RendererFlip { vertical = C.SDL_FLIP_VERTICAL // 0x00000002 flip vertically } -[typedef] +@[typedef] pub struct C.SDL_Renderer { } pub type Renderer = C.SDL_Renderer -[typedef] +@[typedef] pub struct C.SDL_Texture { } diff --git a/rwops.c.v b/rwops.c.v index af1b1139..da7ac28d 100644 --- a/rwops.c.v +++ b/rwops.c.v @@ -33,7 +33,7 @@ fn C.SDL_RWwrite(ctx &C.SDL_RWops, ptr voidptr, size usize, n usize) usize fn C.SDL_RWclose(ctx &C.SDL_RWops) int // This is the read/write operation structure -- very basic. -[typedef] +@[typedef] pub struct C.SDL_RWops { pub: // Returns the size of the file in this rwops, or -1 if unknown diff --git a/sensor.c.v b/sensor.c.v index 3203f897..75e83ae0 100644 --- a/sensor.c.v +++ b/sensor.c.v @@ -12,7 +12,7 @@ module sdl // for sensors, and load appropriate drivers. // // Sensor is C.SDL_Sensor -[typedef] +@[typedef] pub struct C.SDL_Sensor { } diff --git a/shape.c.v b/shape.c.v index 9d201d08..d4c09af0 100644 --- a/shape.c.v +++ b/shape.c.v @@ -66,7 +66,7 @@ pub fn shapemodealpha(mode WindowShapeModeFlag) bool { // WindowShapeParams is a union containing parameters for shaped windows. // WindowShapeParams is C.SDL_WindowShapeParams -[typedef] +@[typedef] union C.SDL_WindowShapeParams { pub mut: binarizationCutoff u8 // A cutoff alpha value for binarization of the window shape's alpha channel. @@ -78,7 +78,7 @@ pub type WindowShapeParams = C.SDL_WindowShapeParams // WindowShapeMode is a struct that tags the SDL_WindowShapeParams union with // an enum describing the type of its contents. // WindowShapeMode is C.SDL_WindowShapeMode -[typedef] +@[typedef] pub struct C.SDL_WindowShapeMode { pub: mode WindowShapeModeFlag // The mode of these window-shape parameters. diff --git a/stdinc.c.v b/stdinc.c.v index b6a19a51..60955f32 100644 --- a/stdinc.c.v +++ b/stdinc.c.v @@ -599,7 +599,7 @@ pub const ( // SDL_iconv_* are now always real symbols/types, not macros or inlined. // typedef struct _SDL_iconv_t *SDL_iconv_t; -[typedef] +@[typedef] pub struct C.SDL_iconv_t { } diff --git a/surface.c.v b/surface.c.v index bce33a6d..f2a755cc 100644 --- a/surface.c.v +++ b/surface.c.v @@ -12,7 +12,7 @@ module sdl // NOTE This structure should be treated as read-only, except for `pixels`, // which, if not NULL, contains the raw pixel data for the surface. // -[typedef] +@[typedef] pub struct C.SDL_Surface { pub: flags u32 // Read-only diff --git a/system_windows.c.v b/system_windows.c.v index 501d1c21..4c258d5d 100644 --- a/system_windows.c.v +++ b/system_windows.c.v @@ -26,7 +26,7 @@ pub fn direct_3d9_get_adapter_index(display_index int) int { return C.SDL_Direct3D9GetAdapterIndex(display_index) } -[typedef] +@[typedef] pub struct C.IDirect3DDevice9 { } diff --git a/thread.c.v b/thread.c.v index 849f2340..a0d00e3a 100644 --- a/thread.c.v +++ b/thread.c.v @@ -10,7 +10,7 @@ module sdl // Thread is the SDL thread structure, defined in SDL_thread.c // Thread is C.SDL_Thread -[typedef] +@[typedef] pub struct C.SDL_Thread { } diff --git a/touch.c.v b/touch.c.v index 1b3933aa..ddf5ad84 100644 --- a/touch.c.v +++ b/touch.c.v @@ -17,7 +17,7 @@ pub const ( touch_mouseid = C.SDL_TOUCH_MOUSEID ) -[typedef] +@[typedef] pub struct C.SDL_Finger { pub: id FingerID // C.SDL_FingerID diff --git a/ttf/ttf.c.v b/ttf/ttf.c.v index ae8ca4e3..76d1f1d4 100644 --- a/ttf/ttf.c.v +++ b/ttf/ttf.c.v @@ -40,7 +40,7 @@ pub fn byte_swapped_unicode(swapped int) { // Font is the internal structure containing font information // Font is C.TTF_Font -[typedef] +@[typedef] pub struct C.TTF_Font { } diff --git a/version.c.v b/version.c.v index f3cc8940..f369a641 100644 --- a/version.c.v +++ b/version.c.v @@ -23,7 +23,7 @@ pub const ( // // See also: SDL_VERSION // See also: SDL_GetVersion -[typedef] +@[typedef] pub struct C.SDL_version { pub: major u8 // major version diff --git a/video.c.v b/video.c.v index d5a664d7..5e150a05 100644 --- a/video.c.v +++ b/video.c.v @@ -16,7 +16,7 @@ module sdl // See also: SDL_GetClosestDisplayMode() // See also: SDL_SetWindowDisplayMode() // See also: SDL_GetWindowDisplayMode() -[typedef] +@[typedef] pub struct C.SDL_DisplayMode { pub: format u32 // pixel format @@ -55,7 +55,7 @@ pub type DisplayMode = C.SDL_DisplayMode // See also: SDL_SetWindowTitle() // See also: SDL_ShowWindow() // -[typedef] +@[typedef] pub struct C.SDL_Window { }