[vala-extra-vapis] Update SDL2 bindings
- From: Evan Nemerson <evann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala-extra-vapis] Update SDL2 bindings
- Date: Sat, 22 Oct 2016 17:56:23 +0000 (UTC)
commit 428d1cc80d0237edff3b7d1b5d2026736a270641
Author: Mario Daniel Ruiz Saavedra <desiderantes93 gmail com>
Date: Sat Oct 22 11:39:52 2016 -0500
Update SDL2 bindings
sdl2-android.vapi | 44 +-
sdl2-gfx.vapi | 444 +++---
sdl2-image.vapi | 86 +-
sdl2-ios.vapi | 22 +-
sdl2-mixer.vapi | 278 ++--
sdl2-net.vapi | 136 +-
sdl2-ttf.vapi | 181 ++--
sdl2-windows.vapi | 33 +-
sdl2.vapi | 3966 +++++++++++++++++++++++++++++++----------------------
9 files changed, 2945 insertions(+), 2245 deletions(-)
---
diff --git a/sdl2-android.vapi b/sdl2-android.vapi
index 24ef310..44caa94 100644
--- a/sdl2-android.vapi
+++ b/sdl2-android.vapi
@@ -1,7 +1,7 @@
/*
The MIT License (MIT)
-Copyright (c) <2013> <SDL2.0 vapi>
+Copyright (c) 2013-2016
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -28,30 +28,30 @@ namespace SDL {
///
/// Android
///
- [CCode (cheader="SDL2/SDL_system.h")]
+ [CCode (cheader = "SDL2/SDL_system.h")]
[Compact]
public class Android {
- [CCode (cname="SDL_AndroidGetJNIEnv")]
- public static void* get_jnienv();
-
- [CCode (cname="SDL_AndroidGetActivity")]
- public static void* get_activity();
-
- [CCode (cname="SDL_AndroidGetInternalStoragePath")]
- public static string get_internal_storage_path();
-
- [CCode (cname="SDL_AndroidGetExternalStoragePath")]
- public static string get_external_storage_path();
-
- [CCode (cname="SDL_AndroidGetExternalStorageState")]
- public static int get_external_storage_state();
-
- [CCode (cname="SDL_ANDROID_EXTERNAL_STORAGE_READ")]
+ [CCode (cname = "SDL_AndroidGetJNIEnv")]
+ public static void* get_jnienv ();
+
+ [CCode (cname = "SDL_AndroidGetActivity")]
+ public static void* get_activity ();
+
+ [CCode (cname = "SDL_AndroidGetInternalStoragePath")]
+ public static string get_internal_storage_path ();
+
+ [CCode (cname = "SDL_AndroidGetExternalStoragePath")]
+ public static string get_external_storage_path ();
+
+ [CCode (cname = "SDL_AndroidGetExternalStorageState")]
+ public static int get_external_storage_state ();
+
+ [CCode (cname = "SDL_ANDROID_EXTERNAL_STORAGE_READ")]
public static const int EXTERNAL_STORAGE_READ;
-
- [CCode (cname="SDL_ANDROID_EXTERNAL_STORAGE_WRITE")]
+
+ [CCode (cname = "SDL_ANDROID_EXTERNAL_STORAGE_WRITE")]
public static const int EXTERNAL_STORAGE_WRITE;
}// Android
-
-
+
+
}
diff --git a/sdl2-gfx.vapi b/sdl2-gfx.vapi
index 032087d..481a696 100644
--- a/sdl2-gfx.vapi
+++ b/sdl2-gfx.vapi
@@ -1,7 +1,7 @@
/*
The MIT License (MIT)
-Copyright (c) <2013> <SDL2.0 vapi>
+Copyright (c) 2013-2016
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -27,279 +27,279 @@ THE SOFTWARE.
namespace SDLGraphics {
- [CCode (cheader_filename="SDL2/SDL2_gfxPrimitives.h")]
+ [CCode (cheader_filename = "SDL2/SDL2_gfxPrimitives.h")]
[Compact]
public class Pixel {
- [CCode (cname="pixelColor")]
- public static int color(SDL.Video.Renderer dst, int16 x, int16 y, uint32 color);
+ [CCode (cname = "pixelColor")]
+ public static int color (SDL.Video.Renderer dst, int16 x, int16 y, uint32 color);
- [CCode (cname="pixelRGBA")]
- public static int rgba(SDL.Video.Renderer dst, int16 x, int16 y,
+ [CCode (cname = "pixelRGBA")]
+ public static int rgba (SDL.Video.Renderer dst, int16 x, int16 y,
uchar r, uchar g, uchar b, uchar a);
}// Pixel
- [CCode (cheader_filename="SDL2/SDL2_gfxPrimitives.h")]
+ [CCode (cheader_filename = "SDL2/SDL2_gfxPrimitives.h")]
[Compact]
public class Line {
- [CCode (cname="hlineColor")]
- public static int color_h(SDL.Video.Renderer dst, int16 x1, int16 x2,
+ [CCode (cname = "hlineColor")]
+ public static int color_h (SDL.Video.Renderer dst, int16 x1, int16 x2,
int16 y, uint32 color);
- [CCode (cname="hlineRGBA")]
- public static int rgba_h(SDL.Video.Renderer dst, int16 x1, int16 x2,
+ [CCode (cname = "hlineRGBA")]
+ public static int rgba_h (SDL.Video.Renderer dst, int16 x1, int16 x2,
int16 y, uchar r, uchar g, uchar b, uchar a);
- [CCode (cname="vlineColor")]
- public static int color_v(SDL.Video.Renderer dst, int16 x, int16 y1,
+ [CCode (cname = "vlineColor")]
+ public static int color_v (SDL.Video.Renderer dst, int16 x, int16 y1,
int16 y2, uint32 color);
- [CCode (cname="vlineRGBA")]
- public static int rgba_v(SDL.Video.Renderer dst, int16 x, int16 y1,
+ [CCode (cname = "vlineRGBA")]
+ public static int rgba_v (SDL.Video.Renderer dst, int16 x, int16 y1,
int16 y2, uchar r, uchar g, uchar b, uchar a);
- [CCode (cname="lineColor")]
- public static int color(SDL.Video.Renderer dst, int16 x1, int16 y1,
+ [CCode (cname = "lineColor")]
+ public static int color (SDL.Video.Renderer dst, int16 x1, int16 y1,
int16 x2, int16 y2, uint32 color);
- [CCode (cname="lineRGBA")]
- public static int rgba(SDL.Video.Renderer dst, int16 x1, int16 y1,
+ [CCode (cname = "lineRGBA")]
+ public static int rgba (SDL.Video.Renderer dst, int16 x1, int16 y1,
int16 x2, int16 y2, uchar r, uchar g, uchar b, uchar a);
- [CCode (cname="aalineColor")]
- public static int color_aa(SDL.Video.Renderer dst, int16 x1, int16 y1,
+ [CCode (cname = "aalineColor")]
+ public static int color_aa (SDL.Video.Renderer dst, int16 x1, int16 y1,
int16 x2, int16 y2, uint32 color);
- [CCode (cname="aalineRGBA")]
- public static int rgba_aa(SDL.Video.Renderer dst, int16 x1, int16 y1,
+ [CCode (cname = "aalineRGBA")]
+ public static int rgba_aa (SDL.Video.Renderer dst, int16 x1, int16 y1,
int16 x2, int16 y2, uchar r, uchar g, uchar b, uchar a);
}// Line
- [CCode (cheader_filename="SDL2/SDL2_gfxPrimitives.h")]
+ [CCode (cheader_filename = "SDL2/SDL2_gfxPrimitives.h")]
[Compact]
public class Rectangle {
- [CCode (cname="rectangleColor")]
- public static int outline_color(SDL.Video.Renderer dst, int16 x1, int16 y1,
+ [CCode (cname = "rectangleColor")]
+ public static int outline_color (SDL.Video.Renderer dst, int16 x1, int16 y1,
int16 x2, int16 y2, uint32 color);
- [CCode (cname="rectangleRGBA")]
- public static int outline_rgba(SDL.Video.Renderer dst, int16 x1, int16 y1,
+ [CCode (cname = "rectangleRGBA")]
+ public static int outline_rgba (SDL.Video.Renderer dst, int16 x1, int16 y1,
int16 x2, int16 y2, uchar r, uchar g, uchar b, uchar a);
- [CCode (cname="roundedRectangleColor")]
- public static int rounded_outline_color(SDL.Video.Renderer dst, int16 x1, int16 y1,
+ [CCode (cname = "roundedRectangleColor")]
+ public static int rounded_outline_color (SDL.Video.Renderer dst, int16 x1, int16 y1,
int16 x2, int16 y2, int16 rad, uint32 color);
- [CCode (cname="roundedRectangleRGBA")]
- public static int rounded_outline_rgba(SDL.Video.Renderer dst, int16 x1, int16 y1,
- int16 x2, int16 y2, int16 rad,uchar r, uchar g, uchar b, uchar a);
+ [CCode (cname = "roundedRectangleRGBA")]
+ public static int rounded_outline_rgba (SDL.Video.Renderer dst, int16 x1, int16 y1,
+ int16 x2, int16 y2, int16 rad, uchar r, uchar g, uchar b, uchar a);
- [CCode (cname="boxColor")]
- public static int fill_color(SDL.Video.Renderer dst, int16 x1, int16 y1,
+ [CCode (cname = "boxColor")]
+ public static int fill_color (SDL.Video.Renderer dst, int16 x1, int16 y1,
int16 x2, int16 y2, uint32 color);
- [CCode (cname="boxRGBA")]
- public static int fill_rgba(SDL.Video.Renderer dst, int16 x1, int16 y1,
+ [CCode (cname = "boxRGBA")]
+ public static int fill_rgba (SDL.Video.Renderer dst, int16 x1, int16 y1,
int16 x2, int16 y2, uchar r, uchar g, uchar b, uchar a);
- [CCode (cname="roundedBoxColor")]
- public static int rounded_fill_color(SDL.Video.Renderer dst, int16 x1, int16 y1,
- int16 x2, int16 y2, int16 rad,uint32 color);
+ [CCode (cname = "roundedBoxColor")]
+ public static int rounded_fill_color (SDL.Video.Renderer dst, int16 x1, int16 y1,
+ int16 x2, int16 y2, int16 rad, uint32 color);
- [CCode (cname="roundedBoxRGBA")]
- public static int rounded_fill_rgba(SDL.Video.Renderer dst, int16 x1, int16 y1,
+ [CCode (cname = "roundedBoxRGBA")]
+ public static int rounded_fill_rgba (SDL.Video.Renderer dst, int16 x1, int16 y1,
int16 x2, int16 y2, int16 rad, uchar r, uchar g, uchar b, uchar a);
}// Rectangle
- [CCode (cheader_filename="SDL2/SDL2_gfxPrimitives.h")]
+ [CCode (cheader_filename = "SDL2/SDL2_gfxPrimitives.h")]
[Compact]
public class Circle {
- [CCode (cname="circleColor")]
- public static int outline_color(SDL.Video.Renderer dst, int16 x, int16 y,
+ [CCode (cname = "circleColor")]
+ public static int outline_color (SDL.Video.Renderer dst, int16 x, int16 y,
int16 radius, uint32 color);
- [CCode (cname="circleRGBA")]
- public static int outline_rgba(SDL.Video.Renderer dst, int16 x, int16 y, int16 radius,
+ [CCode (cname = "circleRGBA")]
+ public static int outline_rgba (SDL.Video.Renderer dst, int16 x, int16 y, int16 radius,
uchar r, uchar g, uchar b, uchar a);
- [CCode (cname="aacircleColor")]
- public static int outline_color_aa(SDL.Video.Renderer dst, int16 x, int16 y,
+ [CCode (cname = "aacircleColor")]
+ public static int outline_color_aa (SDL.Video.Renderer dst, int16 x, int16 y,
int16 radius, uint32 color);
- [CCode (cname="aacircleRGBA")]
- public static int outline_rgba_aa(SDL.Video.Renderer dst, int16 x, int16 y, int16 radius,
+ [CCode (cname = "aacircleRGBA")]
+ public static int outline_rgba_aa (SDL.Video.Renderer dst, int16 x, int16 y, int16 radius,
uchar r, uchar g, uchar b, uchar a);
- [CCode (cname="filledCircleColor")]
- public static int fill_color(SDL.Video.Renderer dst, int16 x, int16 y,
+ [CCode (cname = "filledCircleColor")]
+ public static int fill_color (SDL.Video.Renderer dst, int16 x, int16 y,
int16 radius, uint32 color);
- [CCode (cname="filledCircleRGBA")]
- public static int fill_rgba(SDL.Video.Renderer dst, int16 x, int16 y, int16 radius,
+ [CCode (cname = "filledCircleRGBA")]
+ public static int fill_rgba (SDL.Video.Renderer dst, int16 x, int16 y, int16 radius,
uchar r, uchar g, uchar b, uchar a);
}// Circle
- [CCode (cheader_filename="SDL2/SDL2_gfxPrimitives.h")]
+ [CCode (cheader_filename = "SDL2/SDL2_gfxPrimitives.h")]
[Compact]
public class Ellipse {
- [CCode (cname="ellipseColor")]
- public static int outline_color(SDL.Video.Renderer dst, int16 xc, int16 yc,
+ [CCode (cname = "ellipseColor")]
+ public static int outline_color (SDL.Video.Renderer dst, int16 xc, int16 yc,
int16 rx, int16 ry, uint32 color);
- [CCode (cname="ellipseRGBA")]
- public static int outline_rgba(SDL.Video.Renderer dst, int16 xc, int16 yc,
+ [CCode (cname = "ellipseRGBA")]
+ public static int outline_rgba (SDL.Video.Renderer dst, int16 xc, int16 yc,
int16 rx, int16 ry, uchar r, uchar g, uchar b, uchar a);
- [CCode (cname="aaellipseColor")]
- public static int outline_color_aa(SDL.Video.Renderer dst, int16 xc, int16 yc,
+ [CCode (cname = "aaellipseColor")]
+ public static int outline_color_aa (SDL.Video.Renderer dst, int16 xc, int16 yc,
int16 rx, int16 ry, uint32 color);
- [CCode (cname="aaellipseRGBA")]
- public static int outline_rgba_aa(SDL.Video.Renderer dst, int16 xc, int16 yc,
+ [CCode (cname = "aaellipseRGBA")]
+ public static int outline_rgba_aa (SDL.Video.Renderer dst, int16 xc, int16 yc,
int16 rx, int16 ry, uchar r, uchar g, uchar b, uchar a);
- [CCode (cname="filledEllipseColor")]
- public static int fill_color(SDL.Video.Renderer dst, int16 xc, int16 yc,
+ [CCode (cname = "filledEllipseColor")]
+ public static int fill_color (SDL.Video.Renderer dst, int16 xc, int16 yc,
int16 rx, int16 ry, uint32 color);
- [CCode (cname="filledEllipseRGBA")]
- public static int fill_rgba(SDL.Video.Renderer dst, int16 xc, int16 yc,
+ [CCode (cname = "filledEllipseRGBA")]
+ public static int fill_rgba (SDL.Video.Renderer dst, int16 xc, int16 yc,
int16 rx, int16 ry, uchar r, uchar g, uchar b, uchar a);
}// Ellipse
- [CCode (cheader_filename="SDL2/SDL2_gfxPrimitives.h")]
+ [CCode (cheader_filename = "SDL2/SDL2_gfxPrimitives.h")]
[Compact]
public class Arc {
- [CCode (cname="pieColor")]
- public static int outline_color(SDL.Video.Renderer dst, int16 x, int16 y, int16 radius,
+ [CCode (cname = "pieColor")]
+ public static int outline_color (SDL.Video.Renderer dst, int16 x, int16 y, int16 radius,
int16 start, int16 end, uint32 color);
- [CCode (cname="pieRGBA")]
- public static int outline_rgba(SDL.Video.Renderer dst, int16 x, int16 y, int16 radius,
+ [CCode (cname = "pieRGBA")]
+ public static int outline_rgba (SDL.Video.Renderer dst, int16 x, int16 y, int16 radius,
int16 start, int16 end, uchar r, uchar g, uchar b, uchar a);
- [CCode (cname="filledPieColor")]
- public static int fill_color(SDL.Video.Renderer dst, int16 x, int16 y, int16 radius,
+ [CCode (cname = "filledPieColor")]
+ public static int fill_color (SDL.Video.Renderer dst, int16 x, int16 y, int16 radius,
int16 start, int16 end, uint32 color);
- [CCode (cname="filledPieRGBA")]
- public static int fill_rgba(SDL.Video.Renderer dst, int16 x, int16 y, int16 radius,
+ [CCode (cname = "filledPieRGBA")]
+ public static int fill_rgba (SDL.Video.Renderer dst, int16 x, int16 y, int16 radius,
int16 start, int16 end, uchar r, uchar g, uchar b, uchar a);
}// Arc
- [CCode (cheader_filename="SDL2/SDL2_gfxPrimitives.h")]
+ [CCode (cheader_filename = "SDL2/SDL2_gfxPrimitives.h")]
[Compact]
public class Trigon {
- [CCode (cname="trigonColor")]
- public static int outline_color(SDL.Video.Renderer dst, int16 x1, int16 y1,
+ [CCode (cname = "trigonColor")]
+ public static int outline_color (SDL.Video.Renderer dst, int16 x1, int16 y1,
int16 x2, int16 y2, int16 x3, int16 y3, uint32 color);
- [CCode (cname="trigonRGBA")]
- public static int outline_rgba(SDL.Video.Renderer dst, int16 x1, int16 y1,
- int16 x2, int16 y2, int16 x3, int16 y3,
+ [CCode (cname = "trigonRGBA")]
+ public static int outline_rgba (SDL.Video.Renderer dst, int16 x1, int16 y1,
+ int16 x2, int16 y2, int16 x3, int16 y3,
uchar r, uchar g, uchar b, uchar a);
- [CCode (cname="aatrigonColor")]
- public static int outline_color_aa(SDL.Video.Renderer dst, int16 x1, int16 y1,
+ [CCode (cname = "aatrigonColor")]
+ public static int outline_color_aa (SDL.Video.Renderer dst, int16 x1, int16 y1,
int16 x2, int16 y2, int16 x3, int16 y3, uint32 color);
- [CCode (cname="aatrigonRGBA")]
- public static int outline_rgba_aa(SDL.Video.Renderer dst, int16 x1, int16 y1,
- int16 x2, int16 y2, int16 x3, int16 y3,
+ [CCode (cname = "aatrigonRGBA")]
+ public static int outline_rgba_aa (SDL.Video.Renderer dst, int16 x1, int16 y1,
+ int16 x2, int16 y2, int16 x3, int16 y3,
uchar r, uchar g, uchar b, uchar a);
- [CCode (cname="filledTrigonColor")]
- public static int fill_color(SDL.Video.Renderer dst, int16 x1, int16 y1,
+ [CCode (cname = "filledTrigonColor")]
+ public static int fill_color (SDL.Video.Renderer dst, int16 x1, int16 y1,
int16 x2, int16 y2, int16 x3, int16 y3, uint32 color);
- [CCode (cname="filledTrigonRGBA")]
- public static int fill_rgba(SDL.Video.Renderer dst, int16 x1, int16 y1,
- int16 x2, int16 y2, int16 x3, int16 y3,
+ [CCode (cname = "filledTrigonRGBA")]
+ public static int fill_rgba (SDL.Video.Renderer dst, int16 x1, int16 y1,
+ int16 x2, int16 y2, int16 x3, int16 y3,
uchar r, uchar g, uchar b, uchar a);
}// Trigon
- [CCode (cheader_filename="SDL2/SDL2_gfxPrimitives.h")]
+ [CCode (cheader_filename = "SDL2/SDL2_gfxPrimitives.h")]
[Compact]
public class Polygon {
- [CCode (cname="polygonColor")]
- public static int outline_color(SDL.Video.Renderer dst, [CCode (array_length = false)]
int16[] vx, [CCode (array_length = false)] int16[] vy,
+ [CCode (cname = "polygonColor")]
+ public static int outline_color (SDL.Video.Renderer dst, [CCode (array_length = false)]
int16[] vx, [CCode (array_length = false)] int16[] vy,
int n, uint32 color);
- [CCode (cname="polygonRGBA")]
- public static int outline_rgba(SDL.Video.Renderer dst, [CCode (array_length = false)] int16[]
vx, [CCode (array_length = false)] int16[] vy,
+ [CCode (cname = "polygonRGBA")]
+ public static int outline_rgba (SDL.Video.Renderer dst, [CCode (array_length = false)]
int16[] vx, [CCode (array_length = false)] int16[] vy,
int n, uchar r, uchar g, uchar b, uchar a);
- [CCode (cname="aapolygonColor")]
- public static int outline_color_aa(SDL.Video.Renderer dst, [CCode (array_length = false)]
int16[] vx, [CCode (array_length = false)] int16[] vy,
+ [CCode (cname = "aapolygonColor")]
+ public static int outline_color_aa (SDL.Video.Renderer dst, [CCode (array_length = false)]
int16[] vx, [CCode (array_length = false)] int16[] vy,
int n, uint32 color);
- [CCode (cname="aapolygonRGBA")]
- public static int outline_rgba_aa(SDL.Video.Renderer dst, [CCode (array_length = false)]
int16[] vx, [CCode (array_length = false)] int16[] vy,
+ [CCode (cname = "aapolygonRGBA")]
+ public static int outline_rgba_aa (SDL.Video.Renderer dst, [CCode (array_length = false)]
int16[] vx, [CCode (array_length = false)] int16[] vy,
int n, uchar r, uchar g, uchar b, uchar a);
- [CCode (cname="filledPolygonColor")]
- public static int fill_color(SDL.Video.Renderer dst, [CCode (array_length = false)] int16[]
vx, [CCode (array_length = false)] int16[] vy,
+ [CCode (cname = "filledPolygonColor")]
+ public static int fill_color (SDL.Video.Renderer dst, [CCode (array_length = false)] int16[]
vx, [CCode (array_length = false)] int16[] vy,
int n, uint32 color);
- [CCode (cname="filledPolygonRGBA")]
- public static int fill_rgba(SDL.Video.Renderer dst, [CCode (array_length = false)] int16[]
vx, [CCode (array_length = false)] int16[] vy,
+ [CCode (cname = "filledPolygonRGBA")]
+ public static int fill_rgba (SDL.Video.Renderer dst, [CCode (array_length = false)] int16[]
vx, [CCode (array_length = false)] int16[] vy,
int n, uchar r, uchar g, uchar b, uchar a);
}// Polygon
- [CCode (cheader_filename="SDL2/SDL2_gfxPrimitives.h")]
+ [CCode (cheader_filename = "SDL2/SDL2_gfxPrimitives.h")]
[Compact]
public class BezierCurve {
- [CCode (cname="bezierColor")]
- public static int color(SDL.Video.Renderer dst, [CCode (array_length = false)] int16[] vx,
[CCode (array_length = false)] int16[] vy,
+ [CCode (cname = "bezierColor")]
+ public static int color (SDL.Video.Renderer dst, [CCode (array_length = false)] int16[] vx,
[CCode (array_length = false)] int16[] vy,
int vertices, int steps, uint32 color);
- [CCode (cname="bezierRGBA")]
- public static int rgba(SDL.Video.Renderer dst, [CCode (array_length = false)] int16[] vx,
[CCode (array_length = false)] int16[] vy,
+ [CCode (cname = "bezierRGBA")]
+ public static int rgba (SDL.Video.Renderer dst, [CCode (array_length = false)] int16[] vx,
[CCode (array_length = false)] int16[] vy,
int vertices, int steps, uchar r, uchar g, uchar b, uchar a);
}// BezierCurve
- [CCode (cheader_filename="SDL2/SDL2_gfxPrimitives.h")]
+ [CCode (cheader_filename = "SDL2/SDL2_gfxPrimitives.h")]
[Compact]
public class Text {
- [CCode (cname="stringColor")]
- public static int color(SDL.Video.Renderer dst, int16 x, int16 y, string s, uint32 color);
+ [CCode (cname = "stringColor")]
+ public static int color (SDL.Video.Renderer dst, int16 x, int16 y, string s, uint32 color);
- [CCode (cname="stringRGBA")]
- public static int rgba(SDL.Video.Renderer dst, int16 x, int16 y, string s,
+ [CCode (cname = "stringRGBA")]
+ public static int rgba (SDL.Video.Renderer dst, int16 x, int16 y, string s,
uchar r, uchar g, uchar b, uchar a);
- [CCode (cname="gfxPrimitivesSetFont")]
- public static int set_font(void* fontdata, int cw, int ch);
+ [CCode (cname = "gfxPrimitivesSetFont")]
+ public static int set_font (void* fontdata, int cw, int ch);
}// Text
- [CCode (cheader_filename="SDL2/SDL2_rotozoom.h")]
+ [CCode (cheader_filename = "SDL2/SDL2_rotozoom.h")]
[Compact]
public class RotoZoom {
- [CCode (cname="rotozoomSurface")]
- public static SDL.Video.Surface rotozoom(SDL.Video.Surface src, double degrees,
+ [CCode (cname = "rotozoomSurface")]
+ public static SDL.Video.Surface rotozoom (SDL.Video.Surface src, double degrees,
double zoom, int smooth);
- [CCode (cname="rotozoomSurfaceXY")]
- public static SDL.Video.Surface rotozoom_xy(SDL.Video.Surface src, double degrees,
+ [CCode (cname = "rotozoomSurfaceXY")]
+ public static SDL.Video.Surface rotozoom_xy (SDL.Video.Surface src, double degrees,
double zoomx, double zoomy, int smooth);
- [CCode (cname="rotozoomSurfaceSize")]
- public static void rotozoom_size(int width, int height, double degrees,
+ [CCode (cname = "rotozoomSurfaceSize")]
+ public static void rotozoom_size (int width, int height, double degrees,
double zoom, ref int dstwidth, ref int dstheight);
- [CCode (cname="rotozoomSurfaceSizeXY")]
- public static void rotozoom_size_xy(int width, int height, double degrees,
+ [CCode (cname = "rotozoomSurfaceSizeXY")]
+ public static void rotozoom_size_xy (int width, int height, double degrees,
double zoomx, double zoomy, ref int dstwidth, ref int dstheight);
- [CCode (cname="zoomSurface")]
- public static SDL.Video.Surface zoom(SDL.Video.Surface src, double zoomx,
+ [CCode (cname = "zoomSurface")]
+ public static SDL.Video.Surface zoom (SDL.Video.Surface src, double zoomx,
double zoomy, int smooth);
- [CCode (cname="zoomSurfaceSize")]
- public static void zoom_size(int width, int height, double zoomx,
+ [CCode (cname = "zoomSurfaceSize")]
+ public static void zoom_size (int width, int height, double zoomx,
double zoomy, ref int dstwidth, ref int dstheight);
}// RotoZoom
- [CCode (cheader_filename="SDL2/SDL2_framerate.h", cname="FPSmanager", free_function="g_free")]
+ [CCode (cheader_filename = "SDL2/SDL2_framerate.h", cname = "FPSmanager", free_function = "g_free")]
[Compact]
public struct FramerateManager {
uint32 framecount;
@@ -307,141 +307,141 @@ namespace SDLGraphics {
uint32 baseticks;
uint32 lastticks;
uint32 rate;
-
- [CCode (cname="SDL_initFramerate")]
- public void init();
- [CCode (cname="SDL_setFramerate")]
- public int set_rate(int rate);
+ [CCode (cname = "SDL_initFramerate")]
+ public void init ();
+
+ [CCode (cname = "SDL_setFramerate")]
+ public int set_rate (int rate);
- [CCode (cname="SDL_getFramerate")]
- public int get_rate();
+ [CCode (cname = "SDL_getFramerate")]
+ public int get_rate ();
- [CCode (cname="SDL_getFramecount")]
- public int get_count();
+ [CCode (cname = "SDL_getFramecount")]
+ public int get_count ();
- [CCode (cname="SDL_framerateDelay")]
- public void run();
+ [CCode (cname = "SDL_framerateDelay")]
+ public void run ();
}// FramerateManager
- [CCode (cheader_filename="SDL2/SDL2_imageFilter.h")]
+ [CCode (cheader_filename = "SDL2/SDL2_imageFilter.h")]
[Compact]
public class Filter {
- [CCode (cname="SDL_imageFilterMMXdetect")]
- public static int have_mmx();
+ [CCode (cname = "SDL_imageFilterMMXdetect")]
+ public static int have_mmx ();
- [CCode (cname="SDL_imageFilterMMXon")]
- public static void enable_mmx();
+ [CCode (cname = "SDL_imageFilterMMXon")]
+ public static void enable_mmx ();
- [CCode (cname="SDL_imageFilterMMXoff")]
- public static void disable_mmx();
+ [CCode (cname = "SDL_imageFilterMMXoff")]
+ public static void disable_mmx ();
- [CCode (cname="SDL_imageFilterAdd")]
- public static int add([CCode (array_length = false)] uchar[] src1, [CCode (array_length =
false)] uchar[] src2, [CCode (array_length = false)] uchar[] dst, int length);
+ [CCode (cname = "SDL_imageFilterAdd")]
+ public static int add ([CCode (array_length = false)] uchar[] src1, [CCode (array_length =
false)] uchar[] src2, [CCode (array_length = false)] uchar[] dst, int length);
- [CCode (cname="SDL_imageFilterMean")]
- public static int mean([CCode (array_length = false)] uchar[] src1, [CCode (array_length =
false)] uchar[] src2, [CCode (array_length = false)] uchar[] dst, int length);
+ [CCode (cname = "SDL_imageFilterMean")]
+ public static int mean ([CCode (array_length = false)] uchar[] src1, [CCode (array_length =
false)] uchar[] src2, [CCode (array_length = false)] uchar[] dst, int length);
- [CCode (cname="SDL_imageFilterSub")]
- public static int subtract([CCode (array_length = false)] uchar[] src1, [CCode (array_length
= false)] uchar[] src2, [CCode (array_length = false)] uchar[] dst, int length);
+ [CCode (cname = "SDL_imageFilterSub")]
+ public static int subtract ([CCode (array_length = false)] uchar[] src1, [CCode (array_length
= false)] uchar[] src2, [CCode (array_length = false)] uchar[] dst, int length);
- [CCode (cname="SDL_imageFilterAbsDiff")]
- public static int absolute_difference([CCode (array_length = false)] uchar[] src1, [CCode
(array_length = false)] uchar[] src2, [CCode (array_length = false)] uchar[] dst, int length);
+ [CCode (cname = "SDL_imageFilterAbsDiff")]
+ public static int absolute_difference ([CCode (array_length = false)] uchar[] src1, [CCode
(array_length = false)] uchar[] src2, [CCode (array_length = false)] uchar[] dst, int length);
- [CCode (cname="SDL_imageFilterMult")]
- public static int multiply([CCode (array_length = false)] uchar[] src1, [CCode (array_length
= false)] uchar[] src2, [CCode (array_length = false)] uchar[] dst, int length);
+ [CCode (cname = "SDL_imageFilterMult")]
+ public static int multiply ([CCode (array_length = false)] uchar[] src1, [CCode (array_length
= false)] uchar[] src2, [CCode (array_length = false)] uchar[] dst, int length);
- [CCode (cname="SDL_imageFilterMultNor")]
- public static int multiply_normalized([CCode (array_length = false)] uchar[] src1, [CCode
(array_length = false)] uchar[] src2, [CCode (array_length = false)] uchar[] dst, int length);
+ [CCode (cname = "SDL_imageFilterMultNor")]
+ public static int multiply_normalized ([CCode (array_length = false)] uchar[] src1, [CCode
(array_length = false)] uchar[] src2, [CCode (array_length = false)] uchar[] dst, int length);
- [CCode (cname="SDL_imageFilterMultDivby2")]
- public static int multiply_half([CCode (array_length = false)] uchar[] src1, [CCode
(array_length = false)] uchar[] src2, [CCode (array_length = false)] uchar[] dst, int length);
+ [CCode (cname = "SDL_imageFilterMultDivby2")]
+ public static int multiply_half ([CCode (array_length = false)] uchar[] src1, [CCode
(array_length = false)] uchar[] src2, [CCode (array_length = false)] uchar[] dst, int length);
- [CCode (cname="SDL_imageFilterMultDivby4")]
- public static int multiply_quarter([CCode (array_length = false)] uchar[] src1, [CCode
(array_length = false)] uchar[] src2, [CCode (array_length = false)] uchar[] dst, int length);
+ [CCode (cname = "SDL_imageFilterMultDivby4")]
+ public static int multiply_quarter ([CCode (array_length = false)] uchar[] src1, [CCode
(array_length = false)] uchar[] src2, [CCode (array_length = false)] uchar[] dst, int length);
- [CCode (cname="SDL_imageFilterBitAnd")]
- public static int and([CCode (array_length = false)] uchar[] src1, [CCode (array_length =
false)] uchar[] src2, [CCode (array_length = false)] uchar[] dst, int length);
+ [CCode (cname = "SDL_imageFilterBitAnd")]
+ public static int and ([CCode (array_length = false)] uchar[] src1, [CCode (array_length =
false)] uchar[] src2, [CCode (array_length = false)] uchar[] dst, int length);
- [CCode (cname="SDL_imageFilterBitOr")]
- public static int or([CCode (array_length = false)] uchar[] src1, [CCode (array_length =
false)] uchar[] src2, [CCode (array_length = false)] uchar[] dst, int length);
+ [CCode (cname = "SDL_imageFilterBitOr")]
+ public static int or ([CCode (array_length = false)] uchar[] src1, [CCode (array_length =
false)] uchar[] src2, [CCode (array_length = false)] uchar[] dst, int length);
- [CCode (cname="SDL_imageFilterDiv")]
- public static int divide([CCode (array_length = false)] uchar[] src1, [CCode (array_length =
false)] uchar[] src2, [CCode (array_length = false)] uchar[] dst, int length);
+ [CCode (cname = "SDL_imageFilterDiv")]
+ public static int divide ([CCode (array_length = false)] uchar[] src1, [CCode (array_length =
false)] uchar[] src2, [CCode (array_length = false)] uchar[] dst, int length);
- [CCode (cname="SDL_imageFilterBitNegation")]
- public static int negate([CCode (array_length = false)] uchar[] src1, [CCode (array_length =
false)] uchar[] dst, int length);
+ [CCode (cname = "SDL_imageFilterBitNegation")]
+ public static int negate ([CCode (array_length = false)] uchar[] src1, [CCode (array_length =
false)] uchar[] dst, int length);
- [CCode (cname="SDL_imageFilterAddByte")]
- public static int add_uchar([CCode (array_length = false)] uchar[] src1, [CCode (array_length
= false)] uchar[] dst, int length, uchar addend);
+ [CCode (cname = "SDL_imageFilterAddByte")]
+ public static int add_uchar ([CCode (array_length = false)] uchar[] src1, [CCode
(array_length = false)] uchar[] dst, int length, uchar addend);
- [CCode (cname="SDL_imageFilterAddUint")]
- public static int add_uint([CCode (array_length = false)] uchar[] src1, [CCode (array_length
= false)] uchar[] dst, int length, uint addend);
+ [CCode (cname = "SDL_imageFilterAddUint")]
+ public static int add_uint ([CCode (array_length = false)] uchar[] src1, [CCode (array_length
= false)] uchar[] dst, int length, uint addend);
- [CCode (cname="SDL_imageFilterAddByteToHalf")]
- public static int halve_add_uchar([CCode (array_length = false)] uchar[] src1, [CCode
(array_length = false)] uchar[] dst, int length, uchar addend);
+ [CCode (cname = "SDL_imageFilterAddByteToHalf")]
+ public static int halve_add_uchar ([CCode (array_length = false)] uchar[] src1, [CCode
(array_length = false)] uchar[] dst, int length, uchar addend);
- [CCode (cname="SDL_imageFilterSubByte")]
- public static int subtract_uchar([CCode (array_length = false)] uchar[] src1, [CCode
(array_length = false)] uchar[] dst, int length, uchar subtrahend);
+ [CCode (cname = "SDL_imageFilterSubByte")]
+ public static int subtract_uchar ([CCode (array_length = false)] uchar[] src1, [CCode
(array_length = false)] uchar[] dst, int length, uchar subtrahend);
- [CCode (cname="SDL_imageFilterSubUint")]
- public static int subtract_uint([CCode (array_length = false)] uchar[] src1, [CCode
(array_length = false)] uchar[] dst, int length, uint subtrahend);
+ [CCode (cname = "SDL_imageFilterSubUint")]
+ public static int subtract_uint ([CCode (array_length = false)] uchar[] src1, [CCode
(array_length = false)] uchar[] dst, int length, uint subtrahend);
- [CCode (cname="SDL_imageFilterShiftRight")]
- public static int shift_right_uchar([CCode (array_length = false)] uchar[] src1, [CCode
(array_length = false)] uchar[] dst, int length, uchar shiftcount);
+ [CCode (cname = "SDL_imageFilterShiftRight")]
+ public static int shift_right_uchar ([CCode (array_length = false)] uchar[] src1, [CCode
(array_length = false)] uchar[] dst, int length, uchar shiftcount);
- [CCode (cname="SDL_imageFilterShiftRightUint")]
- public static int shift_right_uint([CCode (array_length = false)] uchar[] src1, [CCode
(array_length = false)] uchar[] dst, int length, uint shiftcount);
+ [CCode (cname = "SDL_imageFilterShiftRightUint")]
+ public static int shift_right_uint ([CCode (array_length = false)] uchar[] src1, [CCode
(array_length = false)] uchar[] dst, int length, uint shiftcount);
- [CCode (cname="SDL_imageFilterMultByByte")]
- public static int multiply_uchar([CCode (array_length = false)] uchar[] src1, [CCode
(array_length = false)] uchar[] dst, int length, uchar multiplicand);
+ [CCode (cname = "SDL_imageFilterMultByByte")]
+ public static int multiply_uchar ([CCode (array_length = false)] uchar[] src1, [CCode
(array_length = false)] uchar[] dst, int length, uchar multiplicand);
- [CCode (cname="SDL_imageFilterShiftRightAndMultByByte")]
- public static int shift_right_multiply_uchar([CCode (array_length = false)] uchar[] src1,
[CCode (array_length = false)] uchar[] dst, int length, uchar shiftcount, uchar multiplicand);
+ [CCode (cname = "SDL_imageFilterShiftRightAndMultByByte")]
+ public static int shift_right_multiply_uchar ([CCode (array_length = false)] uchar[] src1,
[CCode (array_length = false)] uchar[] dst, int length, uchar shiftcount, uchar multiplicand);
- [CCode (cname="SDL_imageFilterShiftLeftByte")]
- public static int shift_left_uchar([CCode (array_length = false)] uchar[] src1, [CCode
(array_length = false)] uchar[] dst, int length, uchar shiftcount);
+ [CCode (cname = "SDL_imageFilterShiftLeftByte")]
+ public static int shift_left_uchar ([CCode (array_length = false)] uchar[] src1, [CCode
(array_length = false)] uchar[] dst, int length, uchar shiftcount);
- [CCode (cname="SDL_imageFilterShiftLeftUint")]
- public static int shift_left_uint([CCode (array_length = false)] uchar[] src1, [CCode
(array_length = false)] uchar[] dst, int length, uint shiftcount);
+ [CCode (cname = "SDL_imageFilterShiftLeftUint")]
+ public static int shift_left_uint ([CCode (array_length = false)] uchar[] src1, [CCode
(array_length = false)] uchar[] dst, int length, uint shiftcount);
- [CCode (cname="SDL_imageFilterBinarizeUsingThreshold")]
- public static int binarize([CCode (array_length = false)] uchar[] src1, [CCode (array_length
= false)] uchar[] dst, int length, uchar threshold);
+ [CCode (cname = "SDL_imageFilterBinarizeUsingThreshold")]
+ public static int binarize ([CCode (array_length = false)] uchar[] src1, [CCode (array_length
= false)] uchar[] dst, int length, uchar threshold);
- [CCode (cname="SDL_imageFilterClipToRange")]
- public static int clip([CCode (array_length = false)] uchar[] src1, [CCode (array_length =
false)] uchar[] dst, int length, uchar min, uchar max);
+ [CCode (cname = "SDL_imageFilterClipToRange")]
+ public static int clip ([CCode (array_length = false)] uchar[] src1, [CCode (array_length =
false)] uchar[] dst, int length, uchar min, uchar max);
- [CCode (cname="SDL_imageFilterNormalize")]
- public static int normalize([CCode (array_length = false)] uchar[] src1, [CCode (array_length
= false)] uchar[] dst, int length, int cmin, int cmax, int nmin, int nmax);
+ [CCode (cname = "SDL_imageFilterNormalize")]
+ public static int normalize ([CCode (array_length = false)] uchar[] src1, [CCode
(array_length = false)] uchar[] dst, int length, int cmin, int cmax, int nmin, int nmax);
- [CCode (cname="SDL_imageFilterConvolveKernel3x3Divide")]
- public static int convolve_3x3_divide([CCode (array_length = false)] uchar[] src1, [CCode
(array_length = false)] uchar[] dst, int rows, int columns, [CCode (array_length = false)] int16[] kernel,
uchar divisor);
+ [CCode (cname = "SDL_imageFilterConvolveKernel3x3Divide")]
+ public static int convolve_3x3_divide ([CCode (array_length = false)] uchar[] src1, [CCode
(array_length = false)] uchar[] dst, int rows, int columns, [CCode (array_length = false)] int16[] kernel,
uchar divisor);
- [CCode (cname="SDL_imageFilterConvolveKernel5x5Divide")]
- public static int convolve_5x5_divide([CCode (array_length = false)] uchar[] src1, [CCode
(array_length = false)] uchar[] dst, int rows, int columns, [CCode (array_length = false)] int16[] kernel,
uchar divisor);
+ [CCode (cname = "SDL_imageFilterConvolveKernel5x5Divide")]
+ public static int convolve_5x5_divide ([CCode (array_length = false)] uchar[] src1, [CCode
(array_length = false)] uchar[] dst, int rows, int columns, [CCode (array_length = false)] int16[] kernel,
uchar divisor);
- [CCode (cname="SDL_imageFilterConvolveKernel7x7Divide")]
- public static int convolve_7x7_divide([CCode (array_length = false)] uchar[] src1, [CCode
(array_length = false)] uchar[] dst, int rows, int columns, [CCode (array_length = false)] int16[] kernel,
uchar divisor);
+ [CCode (cname = "SDL_imageFilterConvolveKernel7x7Divide")]
+ public static int convolve_7x7_divide ([CCode (array_length = false)] uchar[] src1, [CCode
(array_length = false)] uchar[] dst, int rows, int columns, [CCode (array_length = false)] int16[] kernel,
uchar divisor);
- [CCode (cname="SDL_imageFilterConvolveKernel9x9Divide")]
- public static int convolve_9x9_divide([CCode (array_length = false)] uchar[] src1, [CCode
(array_length = false)] uchar[] dst, int rows, int columns, [CCode (array_length = false)] int16[] kernel,
uchar divisor);
+ [CCode (cname = "SDL_imageFilterConvolveKernel9x9Divide")]
+ public static int convolve_9x9_divide ([CCode (array_length = false)] uchar[] src1, [CCode
(array_length = false)] uchar[] dst, int rows, int columns, [CCode (array_length = false)] int16[] kernel,
uchar divisor);
- [CCode (cname="SDL_imageFilterConvolveKernel3x3ShiftRight")]
- public static int convolve_3x3_shift([CCode (array_length = false)] uchar[] src1, [CCode
(array_length = false)] uchar[] dst, int rows, int columns, [CCode (array_length = false)] int16[] kernel,
uchar shiftcount);
+ [CCode (cname = "SDL_imageFilterConvolveKernel3x3ShiftRight")]
+ public static int convolve_3x3_shift ([CCode (array_length = false)] uchar[] src1, [CCode
(array_length = false)] uchar[] dst, int rows, int columns, [CCode (array_length = false)] int16[] kernel,
uchar shiftcount);
- [CCode (cname="SDL_imageFilterConvolveKernel5x5ShiftRight")]
- public static int convolve_5x5_shift([CCode (array_length = false)] uchar[] src1, [CCode
(array_length = false)] uchar[] dst, int rows, int columns, [CCode (array_length = false)] int16[] kernel,
uchar shiftcount);
+ [CCode (cname = "SDL_imageFilterConvolveKernel5x5ShiftRight")]
+ public static int convolve_5x5_shift ([CCode (array_length = false)] uchar[] src1, [CCode
(array_length = false)] uchar[] dst, int rows, int columns, [CCode (array_length = false)] int16[] kernel,
uchar shiftcount);
- [CCode (cname="SDL_imageFilterConvolveKernel7x7ShiftRight")]
- public static int convolve_7x7_shift([CCode (array_length = false)] uchar[] src1, [CCode
(array_length = false)] uchar[] dst, int rows, int columns, [CCode (array_length = false)] int16[] kernel,
uchar shiftcount);
+ [CCode (cname = "SDL_imageFilterConvolveKernel7x7ShiftRight")]
+ public static int convolve_7x7_shift ([CCode (array_length = false)] uchar[] src1, [CCode
(array_length = false)] uchar[] dst, int rows, int columns, [CCode (array_length = false)] int16[] kernel,
uchar shiftcount);
- [CCode (cname="SDL_imageFilterConvolveKernel9x9ShiftRight")]
- public static int convolve_9x9_shift([CCode (array_length = false)] uchar[] src1, [CCode
(array_length = false)] uchar[] dst, int rows, int columns, [CCode (array_length = false)] int16[] kernel,
uchar shiftcount);
+ [CCode (cname = "SDL_imageFilterConvolveKernel9x9ShiftRight")]
+ public static int convolve_9x9_shift ([CCode (array_length = false)] uchar[] src1, [CCode
(array_length = false)] uchar[] dst, int rows, int columns, [CCode (array_length = false)] int16[] kernel,
uchar shiftcount);
- [CCode (cname="SDL_imageFilterSobelX")]
- public static int sobel([CCode (array_length = false)] uchar[] src1, [CCode (array_length =
false)] uchar[] dst, int rows, int columns);
+ [CCode (cname = "SDL_imageFilterSobelX")]
+ public static int sobel ([CCode (array_length = false)] uchar[] src1, [CCode (array_length =
false)] uchar[] dst, int rows, int columns);
- [CCode (cname="SDL_imageFilterSobelXShiftRight")]
- public static int sobel_shift([CCode (array_length = false)] uchar[] src1, [CCode
(array_length = false)] uchar[] dst, int rows, int columns, uchar shiftcount);
+ [CCode (cname = "SDL_imageFilterSobelXShiftRight")]
+ public static int sobel_shift ([CCode (array_length = false)] uchar[] src1, [CCode
(array_length = false)] uchar[] dst, int rows, int columns, uchar shiftcount);
}// Filter
}// SDLGraphics
diff --git a/sdl2-image.vapi b/sdl2-image.vapi
index f3f5862..fcc7d1a 100644
--- a/sdl2-image.vapi
+++ b/sdl2-image.vapi
@@ -1,7 +1,7 @@
/*
The MIT License (MIT)
-Copyright (c) <2013> <SDL2.0 vapi>
+Copyright (c) 2013-2016
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -41,126 +41,126 @@ namespace SDLImage {
//! General
[CCode (cname = "IMG_Linked_Version")]
- public static unowned SDL.Version linked();
+ public static unowned SDL.Version linked ();
[CCode (cname = "IMG_Init")]
- public static int init(int flags);
+ public static int init (int flags);
[CCode (cname = "IMG_Quit")]
- public static void quit();
+ public static void quit ();
//! Loading
[CCode (cname = "IMG_Load")]
- public static SDL.Video.Surface? load(string file);
+ public static SDL.Video.Surface? load (string file);
[CCode (cname = "IMG_Load_RW")]
- public static SDL.Video.Surface? load_rw(SDL.RWops src, bool freesrc = false);
+ public static SDL.Video.Surface? load_rw (SDL.RWops src, bool freesrc = false);
[CCode (cname = "IMG_LoadTyped_RW")]
- public static SDL.Video.Surface? load_rw_typed(SDL.RWops src, bool freesrc, string type);
+ public static SDL.Video.Surface? load_rw_typed (SDL.RWops src, bool freesrc, string type);
[CCode (cname = "IMG_LoadTexture")]
- public static SDL.Video.Texture? load_texture(SDL.Video.Renderer renderer, string file);
+ public static SDL.Video.Texture? load_texture (SDL.Video.Renderer renderer, string file);
[CCode (cname = "IMG_LoadTexture_RW")]
- public static SDL.Video.Texture? load_texture_rw(SDL.Video.Renderer renderer, SDL.RWops src, bool
freesrc = false);
+ public static SDL.Video.Texture? load_texture_rw (SDL.Video.Renderer renderer, SDL.RWops src, bool
freesrc = false);
[CCode (cname = "IMG_LoadTextureTyped_RW")]
- public static SDL.Video.Texture? load_texture_rw_typed(SDL.Video.Renderer renderer, SDL.RWops src,
bool freesrc, string type);
-
+ public static SDL.Video.Texture? load_texture_rw_typed (SDL.Video.Renderer renderer, SDL.RWops src,
bool freesrc, string type);
+
[CCode (cname = "IMG_InvertAlpha")]
- public static int invert_alpha(int on);
-
+ public static int invert_alpha (int on);
+
[CCode (cname = "IMG_LoadCUR_RW")]
- public static SDL.Video.Surface? load_cur(SDL.RWops src);
+ public static SDL.Video.Surface? load_cur (SDL.RWops src);
[CCode (cname = "IMG_LoadICO_RW")]
- public static SDL.Video.Surface? load_ico(SDL.RWops src);
+ public static SDL.Video.Surface? load_ico (SDL.RWops src);
[CCode (cname = "IMG_LoadBMP_RW")]
- public static SDL.Video.Surface? load_bmp(SDL.RWops src);
+ public static SDL.Video.Surface? load_bmp (SDL.RWops src);
[CCode (cname = "IMG_LoadPNM_RW")]
- public static SDL.Video.Surface? load_pnm(SDL.RWops src);
+ public static SDL.Video.Surface? load_pnm (SDL.RWops src);
[CCode (cname = "IMG_LoadXPM_RW")]
- public static SDL.Video.Surface? load_xpm(SDL.RWops src);
+ public static SDL.Video.Surface? load_xpm (SDL.RWops src);
[CCode (cname = "IMG_LoadXCF_RW")]
- public static SDL.Video.Surface? load_xcf(SDL.RWops src);
+ public static SDL.Video.Surface? load_xcf (SDL.RWops src);
[CCode (cname = "IMG_LoadPCX_RW")]
- public static SDL.Video.Surface? load_pcx(SDL.RWops src);
+ public static SDL.Video.Surface? load_pcx (SDL.RWops src);
[CCode (cname = "IMG_LoadGIF_RW")]
- public static SDL.Video.Surface? load_gif(SDL.RWops src);
+ public static SDL.Video.Surface? load_gif (SDL.RWops src);
[CCode (cname = "IMG_LoadJPG_RW")]
- public static SDL.Video.Surface? load_jpg(SDL.RWops src);
+ public static SDL.Video.Surface? load_jpg (SDL.RWops src);
[CCode (cname = "IMG_LoadTIF_RW")]
- public static SDL.Video.Surface? load_tif(SDL.RWops src);
+ public static SDL.Video.Surface? load_tif (SDL.RWops src);
[CCode (cname = "IMG_LoadPNG_RW")]
- public static SDL.Video.Surface? load_png(SDL.RWops src);
+ public static SDL.Video.Surface? load_png (SDL.RWops src);
[CCode (cname = "IMG_LoadTGA_RW")]
- public static SDL.Video.Surface? load_tga(SDL.RWops src);
+ public static SDL.Video.Surface? load_tga (SDL.RWops src);
[CCode (cname = "IMG_LoadLBM_RW")]
- public static SDL.Video.Surface? load_lbm(SDL.RWops src);
+ public static SDL.Video.Surface? load_lbm (SDL.RWops src);
[CCode (cname = "IMG_LoadXV_RW")]
- public static SDL.Video.Surface? load_xv(SDL.RWops src);
+ public static SDL.Video.Surface? load_xv (SDL.RWops src);
[CCode (cname = "IMG_LoadWEBP_RW")]
- public static SDL.Video.Surface? load_webp(SDL.RWops src);
+ public static SDL.Video.Surface? load_webp (SDL.RWops src);
[CCode (cname = "IMG_ReadXPMFromArray")]
- public static SDL.Video.Surface? read_xpm(string[] xpmdata);
+ public static SDL.Video.Surface? read_xpm (string[] xpmdata);
//!Info
[CCode (cname = "IMG_isCUR")]
- public static bool is_cur(SDL.RWops src);
+ public static bool is_cur (SDL.RWops src);
[CCode (cname = "IMG_isICO")]
- public static bool is_ico(SDL.RWops src);
+ public static bool is_ico (SDL.RWops src);
[CCode (cname = "IMG_isBMP")]
- public static bool is_bmp(SDL.RWops src);
+ public static bool is_bmp (SDL.RWops src);
[CCode (cname = "IMG_isPNM")]
- public static bool is_pnm(SDL.RWops src);
+ public static bool is_pnm (SDL.RWops src);
[CCode (cname = "IMG_isXPM")]
- public static bool is_xpm(SDL.RWops src);
+ public static bool is_xpm (SDL.RWops src);
[CCode (cname = "IMG_isXCF")]
- public static bool is_xcf(SDL.RWops src);
+ public static bool is_xcf (SDL.RWops src);
[CCode (cname = "IMG_isPCX")]
- public static bool is_pcx(SDL.RWops src);
+ public static bool is_pcx (SDL.RWops src);
[CCode (cname = "IMG_isGIF")]
- public static bool is_gif(SDL.RWops src);
+ public static bool is_gif (SDL.RWops src);
[CCode (cname = "IMG_isJPG")]
- public static bool is_jpg(SDL.RWops src);
+ public static bool is_jpg (SDL.RWops src);
[CCode (cname = "IMG_isTIF")]
- public static bool is_tif(SDL.RWops src);
+ public static bool is_tif (SDL.RWops src);
[CCode (cname = "IMG_isPNG")]
- public static bool is_png(SDL.RWops src);
+ public static bool is_png (SDL.RWops src);
[CCode (cname = "IMG_isLBM")]
- public static bool is_lbm(SDL.RWops src);
+ public static bool is_lbm (SDL.RWops src);
[CCode (cname = "IMG_isXV")]
- public static bool is_xv(SDL.RWops src);
+ public static bool is_xv (SDL.RWops src);
[CCode (cname = "IMG_isWEBP")]
- public static bool is_webp(SDL.RWops src);
+ public static bool is_webp (SDL.RWops src);
} // SDLImage
diff --git a/sdl2-ios.vapi b/sdl2-ios.vapi
index aa9b1a8..a696fe7 100644
--- a/sdl2-ios.vapi
+++ b/sdl2-ios.vapi
@@ -1,7 +1,7 @@
/*
The MIT License (MIT)
-Copyright (c) <2013> <SDL2.0 vapi>
+Copyright (c) 2013-2016
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -21,24 +21,24 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
-//FOR: SDL2.0 - This is not official, to be futurely changed for the official binding
+//FOR: SDL2.0.4 - This is not official, to be futurely changed for the official binding
//Maintainer: PedroHLC, Txasatonga, Desiderantes
namespace SDL {
///
/// iOS
///
-
+
public delegate void AnimationFunc ();
- [CCode (cheader="SDL2/SDL_system.h")]
+ [CCode (cheader = "SDL2/SDL_system.h")]
[Compact]
public class iPhone {
- [CCode (cname="SDL_iPhoneSetAnimationCallback")]
- public static int set_animation_callback(Video.Window window, int interval, AnimationFunc
func);
-
- [CCode (cname="SDL_iPhoneSetEventPump")]
- public static void set_event_pump(bool enable);
+ [CCode (cname = "SDL_iPhoneSetAnimationCallback")]
+ public static int set_animation_callback (Video.Window window, int interval, AnimationFunc
func);
+
+ [CCode (cname = "SDL_iPhoneSetEventPump")]
+ public static void set_event_pump (bool enable);
}// iPhone
-
-
+
+
}
diff --git a/sdl2-mixer.vapi b/sdl2-mixer.vapi
index d6ed931..57313d7 100644
--- a/sdl2-mixer.vapi
+++ b/sdl2-mixer.vapi
@@ -1,7 +1,7 @@
/*
The MIT License (MIT)
-Copyright (c) <2013> <SDL2.0 vapi>
+Copyright (c) 2013-2016
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -24,231 +24,231 @@ THE SOFTWARE.
//FOR: SDL2.0 - This is not official, to be futurely changed for the official binding
//Maintainer: PedroHLC, Txasatonga, Desiderantes
-[CCode (cheader_filename="SDL2/SDL_mixer.h")]
+[CCode (cheader_filename = "SDL2/SDL_mixer.h")]
namespace SDLMixer {
- [CCode (cname="Mix_Linked_Version")]
- public static unowned SDL.Version linked();
+ [CCode (cname = "Mix_Linked_Version")]
+ public static unowned SDL.Version linked ();
- [CCode (cname="Mix_OpenAudio")]
- public static int open(int frequency, SDL.Audio.Format format, int channels, int chunksize);
+ [CCode (cname = "Mix_OpenAudio")]
+ public static int open (int frequency, SDL.Audio.AudioFormat format, int channels, int chunksize);
- [CCode (cname="Mix_CloseAudio")]
- public static void close();
+ [CCode (cname = "Mix_CloseAudio")]
+ public static void close ();
- [CCode (cname="Mix_QuerySpec")]
- public static int query(out int frequency, out SDL.Audio.Format format, out int channels);
+ [CCode (cname = "Mix_QuerySpec")]
+ public static int query (out int frequency, out SDL.Audio.AudioFormat format, out int channels);
- [CCode (cname="Mix_SetPostMix")]
- public static void set_post_mixer(MixFunction f);
+ [CCode (cname = "Mix_SetPostMix")]
+ public static void set_post_mixer (MixFunction f);
- [CCode (cname="Mix_SetSynchroValue")]
- public static int set_synchro_value(int value);
+ [CCode (cname = "Mix_SetSynchroValue")]
+ public static int set_synchro_value (int value);
- [CCode (cname="Mix_GetSynchroValue")]
- public static int get_synchro_value();
+ [CCode (cname = "Mix_GetSynchroValue")]
+ public static int get_synchro_value ();
[CCode (has_target = true, delegate_target_pos = 0)]
- public delegate void MixFunction(uchar[] stream);
- public delegate void MusicFinishedCallback();
- public delegate void ChannelFinishedCallback(int channel);
+ public delegate void MixFunction (uchar[] stream);
+ public delegate void MusicFinishedCallback ();
+ public delegate void ChannelFinishedCallback (int channel);
[CCode (has_target = true, delegate_target_pos = 2.1)]
- public delegate void EffectCallback(int chan, void* stream, int len);
+ public delegate void EffectCallback (int chan, void* stream, int len);
[CCode (has_target = true, delegate_target_pos = 0.1)]
- public delegate void EffectDoneCallback(int chan);
+ public delegate void EffectDoneCallback (int chan);
- [CCode (cname="int", cprefix="MIX_")]
+ [CCode (cname = "int", cprefix = "MIX_")]
public enum FadeStatus {
NO_FADING, FADING_OUT, FADING_IN
}// FadeStatus
- [CCode (cname="int", cprefix="MUS_")]
+ [CCode (cname = "int", cprefix = "MUS_")]
public enum MusicType {
NONE, CMD, WAV, MOD, MID, OGG, MP3, MP3_MAD
}// MusicType
- [CCode (cname="Mix_Chunk", free_function="Mix_FreeChunk")]
+ [CCode (cname = "Mix_Chunk", free_function = "Mix_FreeChunk")]
[Compact]
public class Chunk {
- [CCode (cname="Mix_LoadWAV_RW")]
- public Chunk.WAV_RW(SDL.RWops src, int freesrc=0);
-
- [CCode (cname="Mix_LoadWAV")]
- public Chunk.WAV(string file);
+ [CCode (cname = "Mix_LoadWAV_RW")]
+ public Chunk.WAV_RW (SDL.RWops src, int freesrc = 0);
- [CCode (cname="Mix_QuickLoad_WAV")]
- public Chunk.QuickWAV([CCode (array_length = false)] uchar[] mem);
+ [CCode (cname = "Mix_LoadWAV")]
+ public Chunk.WAV (string file);
- [CCode (cname="Mix_QuickLoad_RAW")]
- public Chunk.QuickRAW(uchar[] mem);
+ [CCode (cname = "Mix_QuickLoad_WAV")]
+ public Chunk.QuickWAV ([CCode (array_length = false)] uchar[] mem);
- [CCode (cname="Mix_VolumeChunk")]
- public int volume(int num);
+ [CCode (cname = "Mix_QuickLoad_RAW")]
+ public Chunk.QuickRAW (uchar[] mem);
+
+ [CCode (cname = "Mix_VolumeChunk")]
+ public int volume (int num);
}// Chunk
- [CCode (cname="Mix_Music", free_function="Mix_FreeMusic")]
+ [CCode (cname = "Mix_Music", free_function = "Mix_FreeMusic")]
[Compact]
public class Music {
- [CCode (cname="Mix_GetMusicHookData")]
- public static void* get_hook_data();
+ [CCode (cname = "Mix_GetMusicHookData")]
+ public static void* get_hook_data ();
- [CCode (cname="Mix_HookMusic")]
- public static void hook_mixer(MixFunction? f);
+ [CCode (cname = "Mix_HookMusic")]
+ public static void hook_mixer (MixFunction? f);
- [CCode (cname="Mix_HookMusicFinished")]
- public static void hook_finished(MusicFinishedCallback cb);
+ [CCode (cname = "Mix_HookMusicFinished")]
+ public static void hook_finished (MusicFinishedCallback cb);
- [CCode (cname="Mix_FadeOutMusic")]
- public static int fade_out(int ms);
+ [CCode (cname = "Mix_FadeOutMusic")]
+ public static int fade_out (int ms);
- [CCode (cname="Mix_FadingMusic")]
- public static FadeStatus is_fading();
+ [CCode (cname = "Mix_FadingMusic")]
+ public static FadeStatus is_fading ();
- [CCode (cname="Mix_VolumeMusic")]
- public static int volume(int num);
+ [CCode (cname = "Mix_VolumeMusic")]
+ public static int volume (int num);
- [CCode (cname="Mix_HaltMusic")]
- public static int halt();
+ [CCode (cname = "Mix_HaltMusic")]
+ public static int halt ();
- [CCode (cname="Mix_PauseMusic")]
- public static void pause();
+ [CCode (cname = "Mix_PauseMusic")]
+ public static void pause ();
- [CCode (cname="Mix_ResumeMusic")]
- public static void resume();
+ [CCode (cname = "Mix_ResumeMusic")]
+ public static void resume ();
- [CCode (cname="Mix_RewindMusic")]
- public static void rewind();
+ [CCode (cname = "Mix_RewindMusic")]
+ public static void rewind ();
- [CCode (cname="Mix_PausedMusic")]
- public static bool is_paused();
+ [CCode (cname = "Mix_PausedMusic")]
+ public static bool is_paused ();
- [CCode (cname="Mix_SetMusicPosition")]
- public static int position(double position);
+ [CCode (cname = "Mix_SetMusicPosition")]
+ public static int position (double position);
- [CCode (cname="Mix_PlayingMusic")]
- public static bool is_playing();
+ [CCode (cname = "Mix_PlayingMusic")]
+ public static bool is_playing ();
- [CCode (cname="Mix_SetMusicCMD")]
- public static int set_play_command(string command);
+ [CCode (cname = "Mix_SetMusicCMD")]
+ public static int set_play_command (string command);
- [CCode (cname="Mix_LoadMUS")]
- public Music(string file);
+ [CCode (cname = "Mix_LoadMUS")]
+ public Music (string file);
- [CCode (cname="Mix_LoadMUS_RW")]
- public Music.RW(SDL.RWops rw);
+ [CCode (cname = "Mix_LoadMUS_RW")]
+ public Music.RW (SDL.RWops rw);
- [CCode (cname="Mix_GetMusicType")]
- public MusicType type();
+ [CCode (cname = "Mix_GetMusicType")]
+ public MusicType type ();
- [CCode (cname="Mix_PlayMusic")]
- public int play(int loops);
+ [CCode (cname = "Mix_PlayMusic")]
+ public int play (int loops);
- [CCode (cname="Mix_FadeInMusicPos")]
- public int fade_in(int loops, int ms, double position=0.0);
+ [CCode (cname = "Mix_FadeInMusicPos")]
+ public int fade_in (int loops, int ms, double position = 0.0);
}// Music
[Compact]
public class Effect {
- [CCode (cname="Mix_RegisterEffect")]
- public static int register(int chan, EffectCallback f,
+ [CCode (cname = "Mix_RegisterEffect")]
+ public static int register (int chan, EffectCallback f,
EffectDoneCallback? d);
- [CCode (cname="Mix_UnregisterEffect")]
- public static int unregister(int chan, EffectCallback f);
+ [CCode (cname = "Mix_UnregisterEffect")]
+ public static int unregister (int chan, EffectCallback f);
- [CCode (cname="Mix_UnregisterAllEffects")]
- public static int unregister_all(int channel);
+ [CCode (cname = "Mix_UnregisterAllEffects")]
+ public static int unregister_all (int channel);
}// Effect
-
- [CCode (cname="int")]
+
+ [CCode (cname = "int")]
[SimpleType]
public struct Channel: int {
- [CCode (cname="Mix_AllocateChannels")]
- public static int allocate(int num_channels);
+ [CCode (cname = "Mix_AllocateChannels")]
+ public static int allocate (int num_channels);
- [CCode (cname="Mix_ReserveChannels")]
- public static int reserve(int num_channels);
+ [CCode (cname = "Mix_ReserveChannels")]
+ public static int reserve (int num_channels);
- [CCode (cname="Mix_ChannelFinished")]
- public static void hook_finished(ChannelFinishedCallback? cb);
+ [CCode (cname = "Mix_ChannelFinished")]
+ public static void hook_finished (ChannelFinishedCallback? cb);
- [CCode (cname="Mix_SetPanning")]
- public int pan(uchar left, uchar right);
+ [CCode (cname = "Mix_SetPanning")]
+ public int pan (uchar left, uchar right);
- [CCode (cname="Mix_SetPosition")]
- public int position(int16 degrees, uchar distance);
+ [CCode (cname = "Mix_SetPosition")]
+ public int position (int16 degrees, uchar distance);
- [CCode (cname="Mix_SetDistance")]
- public int distance(uchar distance);
+ [CCode (cname = "Mix_SetDistance")]
+ public int distance (uchar distance);
- [CCode (cname="Mix_SetReverseStereo")]
- public int reverse_stereo(int flip);
+ [CCode (cname = "Mix_SetReverseStereo")]
+ public int reverse_stereo (int flip);
- [CCode (cname="Mix_PlayChannelTimed")]
- public int play(Chunk chunk, int loops, int ticks=-1);
+ [CCode (cname = "Mix_PlayChannelTimed")]
+ public int play (Chunk chunk, int loops, int ticks = -1);
- [CCode (cname="Mix_FadeInChannelTimed")]
- public int fade_in(Chunk chunk, int loops, int ms, int ticks=-1);
+ [CCode (cname = "Mix_FadeInChannelTimed")]
+ public int fade_in (Chunk chunk, int loops, int ms, int ticks = -1);
- [CCode (cname="Mix_FadeOutChannelTimed")]
- public int fade_out(int ms);
+ [CCode (cname = "Mix_FadeOutChannelTimed")]
+ public int fade_out (int ms);
- [CCode (cname="Mix_FadingChannel")]
- public FadeStatus is_fading();
+ [CCode (cname = "Mix_FadingChannel")]
+ public FadeStatus is_fading ();
- [CCode (cname="Mix_Volume")]
- public int volume(int num);
+ [CCode (cname = "Mix_Volume")]
+ public int volume (int num);
- [CCode (cname="Mix_HaltChannel")]
- public int halt();
+ [CCode (cname = "Mix_HaltChannel")]
+ public int halt ();
- [CCode (cname="Mix_ExpireChannel")]
- public int expire(int ticks);
+ [CCode (cname = "Mix_ExpireChannel")]
+ public int expire (int ticks);
- [CCode (cname="Mix_Pause")]
- public void pause();
+ [CCode (cname = "Mix_Pause")]
+ public void pause ();
- [CCode (cname="Mix_Paused")]
- public int is_paused();
+ [CCode (cname = "Mix_Paused")]
+ public int is_paused ();
- [CCode (cname="Mix_Resume")]
- public void resume();
+ [CCode (cname = "Mix_Resume")]
+ public void resume ();
- [CCode (cname="Mix_Playing")]
- public int is_playing();
+ [CCode (cname = "Mix_Playing")]
+ public int is_playing ();
- [CCode (cname="Mix_GetChunk")]
- public Chunk? get_chunk();
+ [CCode (cname = "Mix_GetChunk")]
+ public Chunk? get_chunk ();
}// Channel
-
- [CCode (cname="-1")]
+
+ [CCode (cname = "-1")]
public static const SDLMixer.Channel DEFAULT_CHANNEL;
- [CCode (cname="int")]
+ [CCode (cname = "int")]
[SimpleType]
public struct ChannelGroup: int {
- [CCode (cname="Mix_GroupChannel")]
- public static int add(int channel, int group);
+ [CCode (cname = "Mix_GroupChannel")]
+ public static int add (int channel, int group);
- [CCode (cname="Mix_GroupChannels")]
- public static int add_range(int from_channel, int to_channel, int group);
+ [CCode (cname = "Mix_GroupChannels")]
+ public static int add_range (int from_channel, int to_channel, int group);
- [CCode (cname="Mix_GroupAvailable")]
- public int first_available();
+ [CCode (cname = "Mix_GroupAvailable")]
+ public int first_available ();
- [CCode (cname="Mix_GroupCount")]
- public int count();
+ [CCode (cname = "Mix_GroupCount")]
+ public int count ();
- [CCode (cname="Mix_GroupOldest")]
- public int oldest();
+ [CCode (cname = "Mix_GroupOldest")]
+ public int oldest ();
- [CCode (cname="Mix_GroupNewer")]
- public int newest();
+ [CCode (cname = "Mix_GroupNewer")]
+ public int newest ();
- [CCode (cname="Mix_HaltGroup")]
- public int halt();
+ [CCode (cname = "Mix_HaltGroup")]
+ public int halt ();
- [CCode (cname="Mix_FadeOutGroup")]
- public int fade_out(int ms);
+ [CCode (cname = "Mix_FadeOutGroup")]
+ public int fade_out (int ms);
}// ChannelGroup
}// SDLMixer
diff --git a/sdl2-net.vapi b/sdl2-net.vapi
index dee9a22..9791d87 100644
--- a/sdl2-net.vapi
+++ b/sdl2-net.vapi
@@ -1,7 +1,7 @@
/*
The MIT License (MIT)
-Copyright (c) <2013> <SDL2.0 vapi>
+Copyright (c) 2013-2016
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -24,49 +24,49 @@ THE SOFTWARE.
//FOR: SDL2.0 - This is not official, to be futurely changed for the official binding
//Maintainer: PedroHLC, Txasatonga, Desiderantes
-[CCode (cprefix="SDLNet_", cheader_filename="SDL2/SDL2_net.h")]
+[CCode (cprefix = "SDLNet_", cheader_filename = "SDL2/SDL2_net.h")]
namespace SDLNet {
- [CCode (cname="SDLNet_Linked_Version")]
- public static SDL.Version linked();
+ [CCode (cname = "SDLNet_Linked_Version")]
+ public static SDL.Version linked ();
- [CCode (cname="SDLNet_Init")]
- public static int init();
+ [CCode (cname = "SDLNet_Init")]
+ public static int init ();
- [CCode (cname="SDLNet_Quit")]
- public static void quit();
+ [CCode (cname = "SDLNet_Quit")]
+ public static void quit ();
- [CCode (cname="SDLNet_Write16")]
- public static void write16(uint16 value, void *area);
+ [CCode (cname = "SDLNet_Write16")]
+ public static void write16 (uint16 value, void* area);
- [CCode (cname="SDLNet_Write32")]
- public static void write32(uint value, void *area);
+ [CCode (cname = "SDLNet_Write32")]
+ public static void write32 (uint value, void* area);
- [CCode (cname="SDLNet_Read16")]
- public static uint16 read16(void *area);
+ [CCode (cname = "SDLNet_Read16")]
+ public static uint16 read16 (void* area);
- [CCode (cname="SDLNet_Read32")]
- public static uint read32(void *area);
+ [CCode (cname = "SDLNet_Read32")]
+ public static uint read32 (void* area);
- [CCode (cname="IPaddress", free_function="g_free", has_type_id=false)]
+ [CCode (cname = "IPaddress", free_function = "g_free", has_type_id = false)]
public struct IPAddress {
public uint host;
public uint16 port;
- [CCode (cname="INADDR_ANY")]
+ [CCode (cname = "INADDR_ANY")]
public static const uint ANY;
- [CCode (cname="INADDR_NONE")]
+ [CCode (cname = "INADDR_NONE")]
public static const uint NONE;
- [CCode (cname="SDLNet_ResolveHost")]
- public static int from_host(out IPAddress address, string? host, uint16 port);
+ [CCode (cname = "SDLNet_ResolveHost")]
+ public static int from_host (out IPAddress address, string? host, uint16 port);
- [CCode (cname="SDLNet_ResolveIP")]
- public unowned string? lookup();
+ [CCode (cname = "SDLNet_ResolveIP")]
+ public unowned string? lookup ();
}// IPAddress
- [CCode (cname="UDPpacket", free_function="SDLNet_FreePacket")]
+ [CCode (cname = "UDPpacket", free_function = "SDLNet_FreePacket")]
[Compact]
public class UDPPacket {
public int channel;
@@ -76,82 +76,82 @@ namespace SDLNet {
public int status;
public IPAddress address;
- [CCode (cname="SDLNet_AllocPacket")]
- public UDPPacket(int size);
+ [CCode (cname = "SDLNet_AllocPacket")]
+ public UDPPacket (int size);
- [CCode (cname="SDLNet_ResizePacket")]
- public int resize(int newsize);
+ [CCode (cname = "SDLNet_ResizePacket")]
+ public int resize (int newsize);
}// UDPPacket
- [CCode (cname="void")]
+ [CCode (cname = "void")]
[Compact]
public class Socket {
public int ready;
}// Socket
- [CCode (cname="struct _TCPsocket", free_function="SDLNet_TCP_Close")]
+ [CCode (cname = "struct _TCPsocket", free_function = "SDLNet_TCP_Close")]
[Compact]
public class TCPSocket: Socket {
- [CCode (cname="SDLNet_TCP_Open")]
- public TCPSocket(IPAddress ip);
+ [CCode (cname = "SDLNet_TCP_Open")]
+ public TCPSocket (IPAddress ip);
- [CCode (cname="SDLNet_TCP_Accept")]
- public TCPSocket? accept();
+ [CCode (cname = "SDLNet_TCP_Accept")]
+ public TCPSocket? accept ();
- [CCode (cname="SDLNet_TCP_GetPeerAddress")]
- public IPAddress? get_address();
+ [CCode (cname = "SDLNet_TCP_GetPeerAddress")]
+ public IPAddress? get_address ();
- [CCode (cname="SDLNet_TCP_Send")]
- public int send(uchar[] data);
+ [CCode (cname = "SDLNet_TCP_Send")]
+ public int send (uchar[] data);
- [CCode (cname="SDLNet_TCP_Recv")]
- public int receive(uchar[] data);
+ [CCode (cname = "SDLNet_TCP_Recv")]
+ public int receive (uchar[] data);
}// TCPSocket
- [CCode (cname="struct _UDPsocket", free_function="SDLNet_UDP_Close")]
+ [CCode (cname = "struct _UDPsocket", free_function = "SDLNet_UDP_Close")]
[Compact]
public class UDPSocket: Socket {
- [CCode (cname="SDLNet_UDP_Open")]
- public UDPSocket(uint16 port);
+ [CCode (cname = "SDLNet_UDP_Open")]
+ public UDPSocket (uint16 port);
- [CCode (cname="SDLNet_UDP_Bind")]
- public int bind(int channel, IPAddress address);
+ [CCode (cname = "SDLNet_UDP_Bind")]
+ public int bind (int channel, IPAddress address);
- [CCode (cname="SDLNet_UDP_Unbind")]
- public void unbind(int channel);
+ [CCode (cname = "SDLNet_UDP_Unbind")]
+ public void unbind (int channel);
- [CCode (cname="SDLNet_UDP_GetPeerAddress")]
- public IPAddress? get_address(int channel);
+ [CCode (cname = "SDLNet_UDP_GetPeerAddress")]
+ public IPAddress? get_address (int channel);
- [CCode (cname="SDLNet_UDP_Send")]
- public int send(int channel, UDPPacket packet);
+ [CCode (cname = "SDLNet_UDP_Send")]
+ public int send (int channel, UDPPacket packet);
- [CCode (cname="SDLNet_UDP_Recv")]
- public int receive(UDPPacket packet);
+ [CCode (cname = "SDLNet_UDP_Recv")]
+ public int receive (UDPPacket packet);
- [CCode (cname="SDLNet_UDP_SendV")]
- public int send_many(UDPPacket[] packets);
+ [CCode (cname = "SDLNet_UDP_SendV")]
+ public int send_many (UDPPacket[] packets);
- [CCode (cname="SDLNet_UDP_RecvV")]
- public int receive_many([CCode (array_length = false)] UDPPacket[] packets);
+ [CCode (cname = "SDLNet_UDP_RecvV")]
+ public int receive_many ([CCode (array_length = false)] UDPPacket[] packets);
}// UDPSocket
- [CCode (cname="struct _SDLNet_SocketSet", free_function="SDLNet_FreeSocketSet")]
+ [CCode (cname = "struct _SDLNet_SocketSet", free_function = "SDLNet_FreeSocketSet")]
[Compact]
public class SocketSet {
- [CCode (cname="SDLNet_AllocSocketSet")]
- public SocketSet(int maxsockets);
+ [CCode (cname = "SDLNet_AllocSocketSet")]
+ public SocketSet (int maxsockets);
- [CCode (cname="SDLNet_AddSocket")]
- public int add(Socket socket);
+ [CCode (cname = "SDLNet_AddSocket")]
+ public int add (Socket socket);
- [CCode (cname="SDLNet_DelSocket")]
- public int remove(Socket socket);
+ [CCode (cname = "SDLNet_DelSocket")]
+ public int remove (Socket socket);
- [CCode (cname="SDLNet_CheckSockets")]
- public int has_data(uint timeout);
+ [CCode (cname = "SDLNet_CheckSockets")]
+ public int has_data (uint timeout);
- [CCode (cname="SDLNet_SocketReady ")]
- public int is_ready();
+ [CCode (cname = "SDLNet_SocketReady ")]
+ public int is_ready ();
}// SocketSet
}// SDL
diff --git a/sdl2-ttf.vapi b/sdl2-ttf.vapi
index 840c6f9..620075e 100644
--- a/sdl2-ttf.vapi
+++ b/sdl2-ttf.vapi
@@ -1,7 +1,7 @@
/*
The MIT License (MIT)
-Copyright (c) <2013> <SDL2.0 vapi>
+Copyright (c) 2013-2016
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -24,122 +24,147 @@ THE SOFTWARE.
//FOR: SDL2.0 - This is not official, to be futurely changed for the official binding
//Maintainer: PedroHLC, Txasatonga, Desiderantes
-[CCode (cheader_filename="SDL2/SDL_ttf.h")]
+[CCode (cheader_filename = "SDL2/SDL_ttf.h")]
namespace SDLTTF {
- [CCode (cname="TTF_Linked_Version")]
- public static unowned SDL.Version linked();
+ [CCode (cname = "TTF_Linked_Version")]
+ public static unowned SDL.Version linked ();
- [CCode (cname="TTF_ByteSwappedUNICODE")]
- public static void byteswap_unicode(int swapped);
+ [CCode (cname = "TTF_ByteSwappedUNICODE")]
+ public static void byteswap_unicode (int swapped);
- [CCode (cname="TTF_Init")]
- public static int init();
+ [CCode (cname = "TTF_Init")]
+ public static int init ();
- [CCode (cname="TTF_WasInit")]
- public static int get_initialized();
+ [CCode (cname = "TTF_WasInit")]
+ public static bool is_initialized ();
- [CCode (cname="TTF_Quit")]
- public static void quit();
+ [CCode (cname = "TTF_Quit")]
+ public static void quit ();
- [CCode (cname="int", cprefix="TTF_STYLE_")]
+ [CCode (cname = "int", cprefix = "TTF_STYLE_")]
public enum FontStyle {
- NORMAL, BOLD, ITALIC, UNDERLINE
+ NORMAL, BOLD, ITALIC, STRIKETHROUGH, UNDERLINE
}// FontStyle
- [CCode (cname="TTF_Font", free_function="TTF_CloseFont")]
+ [CCode (cname = "int", cprefix = "TTF_HINTING_")]
+ public enum FontHinting{
+ NORMAL,
+ LIGHT,
+ MONO,
+ NONE,
+ }
+
+ [CCode (cname = "TTF_Font", free_function = "TTF_CloseFont")]
[Compact]
public class Font {
- [CCode (cname="TTF_OpenFont")]
- public Font(string file, int ptsize);
+ [CCode (cname = "TTF_OpenFont")]
+ public Font (string file, int ptsize);
+
+ [CCode (cname = "TTF_OpenFontIndex")]
+ public Font.index (string file, int ptsize, long index);
+
+ [CCode (cname = "TTF_OpenFontRW")]
+ public Font.RW (SDL.RWops src, int freesrc = 0, int ptsize);
+
+ [CCode (cname = "TTF_OpenFontIndexRW")]
+ public Font.RWindex (SDL.RWops src, int freesrc = 0, int ptsize, long index);
- [CCode (cname="TTF_OpenFontIndex")]
- public Font.index(string file, int ptsize, long index);
+ public FontStyle font_style {
+ [CCode (cname = "TTF_GetFontStyle")]get;
+ [CCode (cname = "TTF_SetFontStyle")]set;
+ }
- [CCode (cname="TTF_OpenFontRW")]
- public Font.RW(SDL.RWops src, int freesrc=0, int ptsize);
+ public bool kerning_allowed {
+ [CCode (cname = "TTF_GetFontKerning")]get;
+ [CCode (cname = "TTF_SetFontKerning")]set;
+ }
- [CCode (cname="TTF_OpenFontIndexRW")]
- public Font.RWindex(SDL.RWops src, int freesrc=0, int ptsize, long index);
+ public int outline{
+ [CCode (cname = "TTF_GetFontOutline")]get;
+ [CCode (cname = "TTF_SetFontOutline")]set;
+ }
- [CCode (cname="TTF_GetFontStyle")]
- public FontStyle get_style();
+ public FontHinting hinting{
+ [CCode (cname = "TTF_GetFontHinting")]get;
+ [CCode (cname = "TTF_SetFontHinting")]set;
+ }
- [CCode (cname="TTF_SetFontStyle")]
- public FontStyle set_style(FontStyle style);
+ [CCode (cname = "TTF_FontHeight")]
+ public int get_height ();
- [CCode (cname="TTF_FontHeight")]
- public int get_height();
+ [CCode (cname = "TTF_FontAscent")]
+ public int get_ascent ();
- [CCode (cname="TTF_FontAscent")]
- public int get_ascent();
+ [CCode (cname = "TTF_FontDescent")]
+ public int get_descent ();
- [CCode (cname="TTF_FontDescent")]
- public int get_descent();
+ [CCode (cname = "TTF_FontLineSkip")]
+ public int get_lineskip ();
- [CCode (cname="TTF_FontLineSkip")]
- public int get_lineskip();
+ [CCode (cname = "TTF_FontFaces")]
+ public long get_faces ();
- [CCode (cname="TTF_FontFaces")]
- public long get_faces();
+ [CCode (cname = "TTF_FontFaceIsFixedWidth")]
+ public bool is_fixed_width ();
- [CCode (cname="TTF_FontFaceIsFixedWidth")]
- public int is_fixed_width();
+ [CCode (cname = "TTF_FontFaceFamilyName")]
+ public unowned string? get_family_name ();
- [CCode (cname="TTF_FontFaceFamilyName")]
- public string get_family();
+ [CCode (cname = "TTF_FontFaceStyleName")]
+ public unowned string? get_style_name ();
- [CCode (cname="TTF_FontFaceStyleName")]
- public string get_style_name();
+ [CCode (cname = "TTF_GlyphMetrics")]
+ public bool provides_glyph(uint16 utf16_ch);
- [CCode (cname="TTF_GlyphMetrics")]
- public int get_metrics(uint16 ch, ref int minx, ref int maxx,
+ [CCode (cname = "TTF_GlyphMetrics")]
+ public int get_metrics (uint16 utf16_ch, ref int minx, ref int maxx,
ref int miny, ref int maxy, ref int advance);
- [CCode (cname="TTF_SizeText")]
- public int get_size(string text, ref int w, ref int h);
+ [CCode (cname = "TTF_SizeUTF8")]
+ public int get_size (string text, ref int w, ref int h);
+
+ [CCode (cname = "TTF_SizeText")]
+ public int get_size_latin1 ([CCode (array_length = false)]uint8[] text, ref int w, ref int h);
+
+ [CCode (cname = "TTF_SizeUNICODE")]
+ public int get_size_utf16 ([CCode (array_length = false)] uint16[] text, ref int w, ref int
h);
+
+ [CCode (cname = "TTF_RenderText_Solid")]
+ public SDL.Video.Surface? render_latin1 ([CCode (array_length = false)]uint8[] text,
SDL.Video.Color fg);
- [CCode (cname="TTF_SizeUTF8")]
- public int get_size_utf8(string text, ref int w, ref int h);
+ [CCode (cname = "TTF_RenderUTF8_Solid")]
+ public SDL.Video.Surface? render (string text, SDL.Video.Color fg);
- [CCode (cname="TTF_SizeUNICODE")]
- public int get_size_unicode([CCode (array_length = false)] uint16[] text, ref int w, ref int
h);
+ [CCode (cname = "TTF_RenderUNICODE_Solid")]
+ public SDL.Video.Surface? render_utf16 ([CCode (array_length = false)] uint16[] text,
SDL.Video.Color fg);
- [CCode (cname="TTF_RenderText_Solid")]
- public SDL.Video.Surface? render(string text, SDL.Video.Color fg);
+ [CCode (cname = "TTF_RenderText_Shaded")]
+ public SDL.Video.Surface? render_shaded_latin1 ([CCode (array_length = false)] uint8[] text,
SDL.Video.Color fg, SDL.Video.Color bg);
- [CCode (cname="TTF_RenderUTF8_Solid")]
- public SDL.Video.Surface? render_utf8(string text, SDL.Video.Color fg);
+ [CCode (cname = "TTF_RenderUTF8_Shaded")]
+ public SDL.Video.Surface? render_shaded (string text, SDL.Video.Color fg, SDL.Video.Color bg);
- [CCode (cname="TTF_RenderUNICODE_Solid")]
- public SDL.Video.Surface? render_unicode([CCode (array_length = false)] uint16[] text,
SDL.Video.Color fg);
+ [CCode (cname = "TTF_RenderUNICODE_Shaded")]
+ public SDL.Video.Surface? render_shaded_utf16 ([CCode (array_length = false)] uint16[] text,
SDL.Video.Color? fg, SDL.Video.Color bg);
- [CCode (cname="TTF_RenderText_Shaded")]
- public SDL.Video.Surface? render_shaded(string text, SDL.Video.Color fg, SDL.Video.Color bg);
+ [CCode (cname = "TTF_RenderText_Blended")]
+ public SDL.Video.Surface? render_blended_latin1 ([CCode (array_length = false)] uint8[] text,
SDL.Video.Color fg);
- [CCode (cname="TTF_RenderUTF8_Shaded")]
- public SDL.Video.Surface? render_shaded_utf8(string text, SDL.Video.Color fg, SDL.Video.Color
bg);
+ [CCode (cname = "TTF_RenderUTF8_Blended")]
+ public SDL.Video.Surface? render_blended (string text, SDL.Video.Color fg);
- [CCode (cname="TTF_RenderUNICODE_Shaded")]
- public SDL.Video.Surface? render_shaded_unicode([CCode (array_length = false)] uint16[] text,
SDL.Video.Color? fg, SDL.Video.Color bg);
+ [CCode (cname = "TTF_RenderUNICODE_Blended")]
+ public SDL.Video.Surface? render_blended_utf16 ([CCode (array_length = false)] uint16[] text,
SDL.Video.Color fg);
- [CCode (cname="TTF_RenderText_Blended")]
- public SDL.Video.Surface? render_blended(string text, SDL.Video.Color fg);
+ [CCode (cname = "TTF_RenderText_Blended_Wrapped")]
+ public SDL.Video.Surface? render_blended_wrapped_latin1 ([CCode (array_length = false)]
uint8[] text, SDL.Video.Color fg, uint32 wrap_length);
- [CCode (cname="TTF_RenderUTF8_Blended")]
- public SDL.Video.Surface? render_blended_utf8(string text, SDL.Video.Color fg);
+ [CCode (cname = "TTF_RenderUTF8_Blended_Wrapped")]
+ public SDL.Video.Surface? render_blended_wrapped (string text, SDL.Video.Color fg, uint32
wrap_length);
- [CCode (cname="TTF_RenderUNICODE_Blended")]
- public SDL.Video.Surface? render_blended_unicode([CCode (array_length = false)] uint16[]
text, SDL.Video.Color fg);
-
- [CCode (cname="TTF_RenderText_Blended_Wrapped")]
- public SDL.Video.Surface? render_blended_wrapped(string text, SDL.Video.Color fg, uint32
wrapLength);
+ [CCode (cname = "TTF_RenderUNICODE_Blended_Wrapped")]
+ public SDL.Video.Surface? render_blended_wrapped_utf16 ([CCode (array_length = false)]
uint16[] text, SDL.Video.Color fg, uint32 wrap_length);
- [CCode (cname="TTF_RenderUTF8_Blended_Wrapped")]
- public SDL.Video.Surface? render_blended_wrapped_utf8(string text, SDL.Video.Color fg, uint32
wrapLength);
- [CCode (cname="TTF_RenderUNICODE_Blended_Wrapped")]
- public SDL.Video.Surface? render_blended__wrapped_unicode([CCode (array_length = false)]
uint16[] text, SDL.Video.Color fg, uint32 wrapLength);
-
-
}// Font
}// SDLTTF
diff --git a/sdl2-windows.vapi b/sdl2-windows.vapi
index a5cdbd9..a5cf897 100644
--- a/sdl2-windows.vapi
+++ b/sdl2-windows.vapi
@@ -1,7 +1,7 @@
/*
The MIT License (MIT)
-Copyright (c) <2013> <SDL2.0 vapi>
+Copyright (c) 2013-2016
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -28,22 +28,27 @@ namespace SDL {
///
/// Windows
///
- [CCode (cname="IDirect3DDevice9", cheader="d3d9.h")]
+ [CCode (cname = "IDirect3DDevice9", cheader = "d3d9.h")]
[Compact]
public struct IDirect3DDevice9 {}
-
- [CCode (cheader="SDL2/SDL_system.h")]
+
+ [CCode (cheader = "SDL2/SDL_system.h")]
[Compact]
public class Direct3D9 {
- [CCode (cname="SDL_Direct3D9GetAdapterIndex")]
- public static int get_adapter_index(int display_index);
-
- [CCode (cname="SDL_RenderGetD3D9Device")]
- public static IDirect3DDevice9* get_render_device(Video.Renderer renderer);
-
- [CCode (cname="SDL_DXGIGetOutputInfo")]
- public static void dxgi_get_output_info(int display_index, out int adapter_index, out int
output_index);
+ [CCode (cname = "SDL_Direct3D9GetAdapterIndex")]
+ public static int get_adapter_index (int display_index);
+
+ [CCode (cname = "SDL_RenderGetD3D9Device")]
+ public static IDirect3DDevice9* get_render_device (Video.Renderer renderer);
+
+ [CCode (cname = "SDL_DXGIGetOutputInfo")]
+ public static void dxgi_get_output_info (int display_index, out int adapter_index, out int
output_index);
}// Direct3D9
-
-
+
+ [CCode (cname = "SDL_WindowsMessageHook", has_target= true, delegate_target_pos = 0.0, cheader =
"SDL2/SDL_system.h")]
+ public delegate void WindowsMessageHook (void* hWnd, uint message, uint64 w_param, int64 l_param);
+
+ [CCode (cname = "SDL_SetWindowsMessageHook", cheader = "SDL2/SDL_system.h") ]
+ public static void set_windows_message_hook (WindowsMessageHook hook);
+
}
diff --git a/sdl2.vapi b/sdl2.vapi
index c009ba1..2104118 100644
--- a/sdl2.vapi
+++ b/sdl2.vapi
@@ -1,7 +1,7 @@
/*
The MIT License (MIT)
-Copyright (c) <2013> <SDL2.0 vapi>
+Copyright (c) 2013-2016
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -24,7 +24,7 @@ THE SOFTWARE.
//FOR: SDL2.0.3 - This is not official, to be futurely changed for the official binding
//Maintainer: PedroHLC, Txasatonga, Desiderantes
-[CCode (cprefix="SDL_", cheader_filename="SDL2/SDL.h")]
+[CCode (cprefix = "SDL_", cheader_filename = "SDL2/SDL.h")]
namespace SDL {
///
/// Initialization
@@ -32,7 +32,7 @@ namespace SDL {
/**
* These flags can be OR'd together.
*/
- [Flags, CCode (cname="int", cprefix="SDL_INIT_")]
+ [Flags, CCode (cname = "int", cprefix = "SDL_INIT_")]
public enum InitFlag {
/**
* timer subsystem
@@ -79,8 +79,8 @@ namespace SDL {
*
* If you want to initialize subsystems separately you would call:
*
- * {{{
- * SDL.init(0);
+ * { {{
+ * SDL.init (0);
* }}}
*
* followed by {@link SDL.init_subsystem} with the desired subsystem flag.
@@ -89,8 +89,8 @@ namespace SDL {
*
* @return Returns 0 on success or a negative error code on failure; call {@link SDL.get_error} for
more information.
*/
- [CCode (cname="SDL_Init")]
- public static int init(uint32 flags = SDL.InitFlag.EVERYTHING);
+ [CCode (cname = "SDL_Init")]
+ public static int init (uint32 flags = SDL.InitFlag.EVERYTHING);
/**
* Use this function to initialize specific SDL subsystems.
@@ -106,28 +106,28 @@ namespace SDL {
*
* @return Returns 0 on success or a negative error code on failure; call {@link SDL.get_error} for
more information.
*/
- [CCode (cname="SDL_InitSubSystem")]
- public static int init_subsystem(uint32 flags);
+ [CCode (cname = "SDL_InitSubSystem")]
+ public static int init_subsystem (uint32 flags);
/**
* Use this function to return a mask of the specified subsystems which have previously been
initialized.
*
* Examples:
- * {{{
+ * { {{
* // Get init data on all the subsystems
- * uint32 subsystemInit = SDL.get_initialized(SDL.InitFlag.EVERYTHING);
- * if (subsystemInit & SDL.InitFlag.VIDEO)
+ * uint32 subsystem_init = SDL.get_initialized (SDL.InitFlag.EVERYTHING);
+ * if (subsystem_init & SDL.InitFlag.VIDEO)
* //Video is initalized
* }}}
- * {{{
+ * { {{
* // Just check for one specific subsystem
- * if (SDL.get_initialized(SDL.InitFlag.VIDEO) != 0)
+ * if (SDL.get_initialized (SDL.InitFlag.VIDEO) != 0)
* //Video is initialized
* }}}
- * {{{
+ * { {{
* // Check for two subsystems
* uint32 mask = SDL.InitFlag.VIDEO | SDL.InitFlag.AUDIO;
- * if (SDL.get_initialized(mask) == mask)
+ * if (SDL.get_initialized (mask) == mask)
* //Video and Audio is initialized
* }}}
*
@@ -136,8 +136,8 @@ namespace SDL {
* @return If flags is 0 it returns a mask of all initialized subsystems, otherwise it returns the
initialization status of the specified subsystems.
* The return value does not include {@link SDL.InitFlag.NOPARACHUTE}.
*/
- [CCode (cname="SDL_WasInit")]
- public static uint32 get_initialized(uint32 flags);
+ [CCode (cname = "SDL_WasInit")]
+ public static uint32 get_initialized (uint32 flags);
/**
@@ -150,89 +150,93 @@ namespace SDL {
* instead of {@link SDL.init} or {@link SDL.init_subsystem}, then you must use that subsystem's quit
function ({@link SDL.Video.quit})
* to shut it down before calling {@link SDL.quit}.
*/
- [CCode (cname="SDL_Quit")]
- public static void quit();
+ [CCode (cname = "SDL_Quit")]
+ public static void quit ();
/**
* Use this function to shut down specific SDL subsystems.
*
* @param flags any of the flags used by {@link SDL.init}.
*/
- [CCode (cname="SDL_QuitSubSystem")]
- public static void quit_subsystem(uint32 flags);
+ [CCode (cname = "SDL_QuitSubSystem")]
+ public static void quit_subsystem (uint32 flags);
//
// CPU Info
//
- [CCode (cheader_filename="SDL2/SDL_version.h")]
+ [CCode (cheader_filename = "SDL2/SDL_cpuinfo.h")]
[Compact]
- public class CPU{
- [CCode (cname ="SDL_GetCPUCacheLineSize", cheader_filename="SDL2/SDL_cpuinfo.h")]
- public static int get_cache_line_size();
- //Actual function name was misleading, you get logical core count, not physical CPU count
- [CCode (cname ="SDL_GetCPUCount", cheader_filename="SDL2/SDL_cpuinfo.h")]
- public static int get_num_cores();
-
- [CCode (cname ="SDL_GetSystemRAM", cheader_filename="SDL2/SDL_cpuinfo.h")]
- public static int get_system_ram();
-
- [CCode (cname ="SDL_Has3DNow", cheader_filename="SDL2/SDL_cpuinfo.h")]
- public static bool has_3dnow();
-
- [CCode (cname ="SDL_HasAVX", cheader_filename="SDL2/SDL_cpuinfo.h")]
- public static bool has_avx();
-
- [CCode (cname ="SDL_HasAVX2", cheader_filename="SDL2/SDL_cpuinfo.h")]
- public static bool has_avx2();
-
- [CCode (cname ="SDL_HasAltiVec", cheader_filename="SDL2/SDL_cpuinfo.h")]
- public static bool has_altivec();
-
- [CCode (cname ="SDL_HasMMX", cheader_filename="SDL2/SDL_cpuinfo.h")]
- public static bool has_mmx();
-
- [CCode (cname ="SDL_HasRDTSC", cheader_filename="SDL2/SDL_cpuinfo.h")]
- public static bool has_rdtsc();
-
- [CCode (cname ="SDL_HasSSE", cheader_filename="SDL2/SDL_cpuinfo.h")]
- public static bool has_sse();
-
- [CCode (cname ="SDL_HasSSE2", cheader_filename="SDL2/SDL_cpuinfo.h")]
- public static bool has_sse2();
-
- [CCode (cname ="SDL_HasSSE3", cheader_filename="SDL2/SDL_cpuinfo.h")]
- public static bool has_sse3();
-
- [CCode (cname ="SDL_HasSSE41", cheader_filename="SDL2/SDL_cpuinfo.h")]
- public static bool has_sse41();
-
- [CCode (cname ="SDL_HasSSE42", cheader_filename="SDL2/SDL_cpuinfo.h")]
- public static bool has_sse42();
+ public class CPU {
+ [CCode (cname ="SDL_GetCPUCacheLineSize")]
+ public static int get_cache_line_size ();
+ //Actual function name was misleading, you get logical core count, not physical CPU count
+ [Version (since = "2.0.0")]
+ [CCode (cname ="SDL_GetCPUCount")]
+ public static int get_num_cores ();
+
+ [Version (since = "2.0.1")]
+ [CCode (cname ="SDL_GetSystemRAM")]
+ public static int get_system_ram ();
+
+ [CCode (cname ="SDL_Has3DNow")]
+ public static bool has_3dnow ();
+
+ [Version (since = "2.0.2")]
+ [CCode (cname ="SDL_HasAVX")]
+ public static bool has_avx ();
+
+ [Version (since = "2.0.4")]
+ [CCode (cname ="SDL_HasAVX2")]
+ public static bool has_avx2 ();
+
+ [CCode (cname ="SDL_HasAltiVec")]
+ public static bool has_altivec ();
+
+ [CCode (cname ="SDL_HasMMX")]
+ public static bool has_mmx ();
+
+ [CCode (cname ="SDL_HasRDTSC")]
+ public static bool has_rdtsc ();
+
+ [CCode (cname ="SDL_HasSSE")]
+ public static bool has_sse ();
+
+ [CCode (cname ="SDL_HasSSE2")]
+ public static bool has_sse2 ();
+
+ [CCode (cname ="SDL_HasSSE3")]
+ public static bool has_sse3 ();
+
+ [CCode (cname ="SDL_HasSSE41")]
+ public static bool has_sse41 ();
+
+ [CCode (cname ="SDL_HasSSE42")]
+ public static bool has_sse42 ();
}
- [CCode (type_id="SDL_version", cheader_filename="SDL2/SDL_version.h", cname="SDL_version")]
+ [CCode (type_id = "SDL_version", cheader_filename = "SDL2/SDL_version.h", cname = "SDL_version")]
public class Version {
public uint8 major;
public uint8 minor;
public uint8 patch;
- [CCode (cname="SDL_GetVersion")]
- public static unowned Version get_version();
-
- [CCode (cname="SDL_GetRevision")]
- public static unowned string get_revision();
-
- [CCode (cname="SDL_GetRevisionNumber")]
- public static int get_revision_number();
+ [CCode (cname = "SDL_GetVersion")]
+ public static unowned Version get_version ();
+
+ [CCode (cname = "SDL_GetRevision")]
+ public static unowned string get_revision ();
+
+ [CCode (cname = "SDL_GetRevisionNumber")]
+ public static int get_revision_number ();
}// Version
///
/// Hints
///
- [CCode (cheader_filename="SDL2/SDL_hints.h")]
+ [CCode (cheader_filename = "SDL2/SDL_hints.h")]
[Compact]
- public class Hint{
+ public class Hint {
/**
* A variable controlling how 3D acceleration is used to accelerate the SDL screen surface.
*
@@ -244,12 +248,12 @@ namespace SDL {
*
* * "0" - Disable 3D acceleration
* * "1" - Enable 3D acceleration, using the default renderer.
- * * "X" - Enable 3D acceleration, using X where X is one of the valid rendering
drivers. (e.g. "direct3d", "opengl", etc.)
+ * * "X" - Enable 3D acceleration, using X where X is one of the valid rendering
drivers. (e.g. "direct3d", "opengl", etc.)
*
* By default SDL tries to make a best guess for each platform whether
* to use acceleration or not.
*/
- [CCode (cname="\"SDL_FRAMEBUFFER_ACCELERATION\"")]
+ [CCode (cname = "SDL_HINT_FRAMEBUFFER_ACCELERATION")]
public const string FRAMEBUFFER_ACCELERATION;
/**
@@ -270,7 +274,7 @@ namespace SDL {
* The default varies by platform, but it's the first one in the list that
* is available on the current platform.
*/
- [CCode (cname="\"SDL_RENDER_DRIVER\"")]
+ [CCode (cname = "SDL_HINT_RENDER_DRIVER")]
public const string RENDER_DRIVER;
/**
@@ -283,7 +287,7 @@ namespace SDL {
*
* By default shaders are used if OpenGL supports them.
*/
- [CCode (cname="\"SDL_RENDER_OPENGL_SHADERS\"")]
+ [CCode (cname = "SDL_HINT_RENDER_OPENGL_SHADERS")]
public const string RENDER_OPENGL_SHADERS;
/**
@@ -296,7 +300,8 @@ namespace SDL {
*
* By default the Direct3D device is created with thread-safety disabled.
*/
- [CCode (cname="\"SDL_RENDER_DIRECT3D_THREADSAFE\"")]
+ [Version (since = "2.0.1")]
+ [CCode (cname = "SDL_HINT_RENDER_DIRECT3D_THREADSAFE")]
public const string RENDER_DIRECT3D_THREADSAFE;
/**
@@ -311,7 +316,8 @@ namespace SDL {
*
* By default, SDL does not use Direct3D Debug Layer.
*/
- [CCode (cname="\"SDL_HINT_RENDER_DIRECT3D11_DEBUG\"")]
+ [Version (since = "2.0.3")]
+ [CCode (cname = "SDL_HINT_RENDER_DIRECT3D11_DEBUG")]
public const string RENDER_DIRECT3D11_DEBUG;
/**
@@ -325,7 +331,7 @@ namespace SDL {
*
* By default nearest pixel sampling is used
*/
- [CCode (cname="\"SDL_RENDER_SCALE_QUALITY\"")]
+ [CCode (cname = "SDL_HINT_RENDER_SCALE_QUALITY")]
public const string RENDER_SCALE_QUALITY;
/**
@@ -338,7 +344,7 @@ namespace SDL {
*
* By default SDL does not sync screen surface updates with vertical refresh.
*/
- [CCode (cname="\"SDL_RENDER_VSYNC\"")]
+ [CCode (cname = "SDL_HINT_RENDER_VSYNC")]
public const string RENDER_VSYNC;
/**
@@ -351,7 +357,8 @@ namespace SDL {
*
* By default SDL will disable the screensaver.
*/
- [CCode (cname="\"SDL_VIDEO_ALLOW_SCREENSAVER\"")]
+ [Version (since = "2.0.2")]
+ [CCode (cname = "SDL_HINT_VIDEO_ALLOW_SCREENSAVER")]
public const string VIDEO_ALLOW_SCREENSAVER;
/**
@@ -364,7 +371,7 @@ namespace SDL {
*
* By default SDL will use XVidMode if it is available.
*/
- [CCode (cname="\"SDL_VIDEO_X11_XVIDMODE\"")]
+ [CCode (cname = "SDL_HINT_VIDEO_X11_XVIDMODE")]
public const string VIDEO_X11_XVIDMODE;
/**
@@ -377,7 +384,7 @@ namespace SDL {
*
* By default SDL will use Xinerama if it is available.
*/
- [CCode (cname="\"SDL_VIDEO_X11_XINERAMA\"")]
+ [CCode (cname = "SDL_HINT_VIDEO_X11_XINERAMA")]
public const string VIDEO_X11_XINERAMA;
/**
@@ -390,7 +397,7 @@ namespace SDL {
*
* By default SDL will not use XRandR because of window manager issues.
*/
- [CCode (cname="\"SDL_VIDEO_X11_XRANDR\"")]
+ [CCode (cname = "SDL_HINT_VIDEO_X11_XRANDR")]
public const string VIDEO_X11_XRANDR;
/**
@@ -403,7 +410,7 @@ namespace SDL {
*
* By default SDL will not grab the keyboard so system shortcuts still work.
*/
- [CCode (cname="\"SDL_GRAB_KEYBOARD\"")]
+ [CCode (cname = "SDL_HINT_GRAB_KEYBOARD")]
public const string GRAB_KEYBOARD;
/**
@@ -416,13 +423,14 @@ namespace SDL {
*
* By default SDL will use raw input for relative mouse mode
*/
- [CCode (cname="\"SDL_MOUSE_RELATIVE_MODE_WARP\"")]
+ [Version (since = "2.0.2")]
+ [CCode (cname = "SDL_HINT_MOUSE_RELATIVE_MODE_WARP")]
public const string MOUSE_RELATIVE_MODE_WARP;
/**
* Minimize your SDL_Window if it loses key focus when in fullscreen mode. Defaults to true.
*/
- [CCode (cname="\"SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS\"")]
+ [CCode (cname = "SDL_HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS")]
public const string VIDEO_MINIMIZE_ON_FOCUS_LOSS;
/**
@@ -438,7 +446,7 @@ namespace SDL {
* * "0" - Enable idle timer
* * "1" - Disable idle timer
*/
- [CCode (cname="\"SDL_IOS_IDLE_TIMER_DISABLED\"")]
+ [CCode (cname = "SDL_HINT_IOS_IDLE_TIMER_DISABLED")]
public const string IOS_IDLE_TIMER_DISABLED;
/**
@@ -451,7 +459,7 @@ namespace SDL {
*
* "LandscapeLeft", "LandscapeRight", "Portrait" "PortraitUpsideDown"
*/
- [CCode (cname="\"SDL_IOS_ORIENTATIONS\"")]
+ [CCode (cname = "SDL_HINT_IOS_ORIENTATIONS")]
public const string IOS_ORIENTATIONS;
/**
@@ -463,7 +471,8 @@ namespace SDL {
* * "0" - List only real joysticks and accept input from them
* * "1" - List real joysticks along with the accelerometer as if it were a 3 axis
joystick (the default).
*/
- [CCode (cname="\"SDL_ACCELEROMETER_AS_JOYSTICK\"")]
+ [Version (since = "2.0.2")]
+ [CCode (cname = "SDL_HINT_ACCELEROMETER_AS_JOYSTICK")]
public const string ACCELEROMETER_AS_JOYSTICK;
/**
@@ -474,7 +483,7 @@ namespace SDL {
* * "0" - Disable XInput detection (only uses direct input)
* * "1" - Enable XInput detection (the default)
*/
- [CCode (cname="\"SDL_XINPUT_ENABLED\"")]
+ [CCode (cname = "SDL_HINT_XINPUT_ENABLED")]
public const string XINPUT_ENABLED;
/**
@@ -482,10 +491,10 @@ namespace SDL {
*
* The variable should be newline delimited rows of gamecontroller config data, see
SDL_gamecontroller.h
*
- * This hint must be set before calling SDL_Init(SDL_INIT_GAMECONTROLLER)
- * You can update mappings after the system is initialized with
SDL_GameControllerMappingForGUID() and SDL_GameControllerAddMapping()
+ * This hint must be set before calling SDL_Init (SDL_INIT_GAMECONTROLLER)
+ * You can update mappings after the system is initialized with
SDL_GameControllerMappingForGUID () and SDL_GameControllerAddMapping ()
*/
- [CCode (cname="\"SDL_GAMECONTROLLERCONFIG\"")]
+ [CCode (cname = "SDL_HINT_GAMECONTROLLERCONFIG")]
public const string GAMECONTROLLERCONFIG;
/**
@@ -500,7 +509,7 @@ namespace SDL {
*
* The default value is "0". This hint may be set at any time.
*/
- [CCode (cname="\"SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS\"")]
+ [CCode (cname = "SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS")]
public const string JOYSTICK_ALLOW_BACKGROUND_EVENTS;
/**
@@ -512,7 +521,7 @@ namespace SDL {
* * "0" - don't allow topmost
* * "1" - allow topmost
*/
- [CCode (cname = "\"SDL_ALLOW_TOPMOST\"")]
+ [CCode (cname = "SDL_HINT_ALLOW_TOPMOST")]
public const string ALLOW_TOPMOST;
/**
@@ -529,13 +538,16 @@ namespace SDL {
*
* The default value is "1". This hint may be set at any time.
*/
- [CCode (cname = "\"SDL_TIMER_RESOLUTION\"")]
+ [CCode (cname = "SDL_HINT_TIMER_RESOLUTION")]
public const string TIMER_RESOLUTION;
/**
- * If set to 1, then do not allow high-DPI windows. ("Retina" on Mac)
+ * If set to 1, then do not allow high-DPI windows. ("Retina" on Mac).
+ *
+ * Supported for iOS since SDL 2.0.4.
*/
- [CCode (cname = "\"SDL_VIDEO_HIGHDPI_DISABLED\"")]
+ [Version (since = "2.0.1")]
+ [CCode (cname = "SDL_HINT_VIDEO_HIGHDPI_DISABLED")]
public const string VIDEO_HIGHDPI_DISABLED;
/**
@@ -544,10 +556,25 @@ namespace SDL {
* If present, holding ctrl while left clicking will generate a right click
* event when on Mac.
*/
- [CCode (cname = "\"SDL_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK\"")]
+ [Version (since = "2.0.2")]
+ [CCode (cname = "SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK")]
public const string MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK;
/**
+ * A variable specifying if mouse click events are sent when clicking to focus an SDL window
on Apple Mac OS X.
+ *
+ * By default no mouse click events are sent when clicking to focus. Only on Mac OS X.
+ *
+ * The variable can be set to the following values:
+ *
+ * * "0" - No mouse click events are sent when clicking to focus
+ * * "1" - Mouse click events are sent when clicking to focus
+ */
+ [Version (experimental = true)]
+ [CCode (cname = "SDL_HINT_MAC_MOUSE_FOCUS_CLICKTHROUGH")]
+ public const string MAC_MOUSE_FOCUS_CLICKTHROUGH;
+
+ /**
* A variable specifying which shader compiler to preload when using the Chrome ANGLE binaries
*
* SDL has EGL and OpenGL ES2 support on Windows via the ANGLE project. It
@@ -561,28 +588,30 @@ namespace SDL {
* * "d3dcompiler_43.dll" - for XP support.
* * "none" - do not load any library, useful if you compiled ANGLE from source and included
the compiler in your binaries.
*/
- [CCode (cname = "\"SDL_VIDEO_WIN_D3DCOMPILER\"")]
+ [Version (since = "2.0.2")]
+ [CCode (cname = "SDL_HINT_VIDEO_WIN_D3DCOMPILER")]
public const string VIDEO_WIN_D3DCOMPILER;
/**
- * A variable that is the address of another SDL_Window* (as a hex string formatted with
"%p").
+ * A variable that is the address of another {@link SDL.Video.Window} (as a hex string
formatted with "%p"
*
- * If this hint is set before SDL_CreateWindowFrom() and the SDL_Window* it is set to has
- * SDL_WINDOW_OPENGL set (and running on WGL only, currently), then two things will occur on
the newly
+ * If this hint is set before SDL_CreateWindowFrom () and the SDL_Window* it is set to has
+ * WINDOW_OPENGL set (and running on WGL only, currently), then two things will occur on the
newly
* created SDL_Window:
*
* 1. Its pixel format will be set to the same pixel format as this SDL_Window. This is
* needed for example when sharing an OpenGL context across multiple windows.
*
- * 2. The flag SDL_WINDOW_OPENGL will be set on the new window so it can be used for
+ * 2. The flag WINDOW_OPENGL will be set on the new window so it can be used for
* OpenGL rendering.
*
* This variable can be set to the following values:
*
- * The address (as a string "%p") of the SDL_Window* that new windows created with
SDL_CreateWindowFrom() should
+ * The address (as a string "%p") of the SDL_Window that new windows created with
SDL_CreateWindowFrom () should
* share a pixel format with.
*/
- [CCode (cname = "\"SDL_VIDEO_WINDOW_SHARE_PIXEL_FORMAT\"")]
+ [Version (since = "2.0.2")]
+ [CCode (cname = "SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT")]
public const string VIDEO_WINDOW_SHARE_PIXEL_FORMAT;
/**
@@ -609,7 +638,8 @@ namespace SDL {
* will not get used on that platform. Network-enabled phone apps should display
* their privacy policy through some other, in-app means.
*/
- [CCode (cname = "\"SDL_HINT_WINRT_PRIVACY_POLICY_URL\"")]
+ [Version (since = "2.0.3")]
+ [CCode (cname = "SDL_HINT_WINRT_PRIVACY_POLICY_URL")]
public const string WINRT_PRIVACY_POLICY_URL;
/**
@@ -618,10 +648,10 @@ namespace SDL {
* Network-enabled WinRT apps must include a privacy policy. On Windows 8, 8.1, and RT,
* Microsoft mandates that this policy be available via the Windows Settings charm.
* SDL provides code to add a link there, with it's label text being set via the
- * optional hint, SDL_HINT_WINRT_PRIVACY_POLICY_LABEL.
+ * optional hint, WINRT_PRIVACY_POLICY_LABEL.
*
* Please note that a privacy policy's contents are not set via this hint. A separate
- * hint, SDL_HINT_WINRT_PRIVACY_POLICY_URL, is used to link to the actual text of the
+ * hint, WINRT_PRIVACY_POLICY_URL, is used to link to the actual text of the
* policy.
*
* The contents of this hint should be encoded as a UTF8 string.
@@ -630,9 +660,10 @@ namespace SDL {
* initialization, preferably before any calls to SDL_Init.
*
* For additional information on linking to a privacy policy, see the documentation for
- * SDL_HINT_WINRT_PRIVACY_POLICY_URL.
+ * {@link SDL.Hint.WINRT_PRIVACY_POLICY_URL}.
*/
- [CCode (cname = "\"SDL_HINT_WINRT_PRIVACY_POLICY_LABEL\"")]
+ [Version (since = "2.0.3")]
+ [CCode (cname = "SDL_HINT_WINRT_PRIVACY_POLICY_LABEL")]
public const string WINRT_PRIVACY_POLICY_LABEL;
/**
@@ -641,9 +672,10 @@ namespace SDL {
* TODO, WinRT: document SDL_HINT_WINRT_HANDLE_BACK_BUTTON need and use
* For now, more details on why this is needed can be found at the
* beginning of the following web page:
- * [[http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj247550(v=vs.105).aspx]]
+ * [[http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj247550 (v = vs.105).aspx]]
*/
- [CCode (cname = "\"SDL_HINT_WINRT_HANDLE_BACK_BUTTON\"")]
+ [Version (since = "2.0.3")]
+ [CCode (cname = "SDL_HINT_WINRT_HANDLE_BACK_BUTTON")]
public const string WINRT_HANDLE_BACK_BUTTON;
/**
@@ -664,9 +696,222 @@ namespace SDL {
* the OS isn't at least Mac OS X Lion (10.7). This hint must be set before
* any windows are created.
*/
- [CCode (cname = "\"SDL_VIDEO_MAC_FULLSCREEN_SPACES\"")]
+ [Version (since = "2.0.2")]
+ [CCode (cname = "SDL_HINT_VIDEO_MAC_FULLSCREEN_SPACES")]
public const string VIDEO_MAC_FULLSCREEN_SPACES;
+ //SDL 2.0.4 Hints
+
+ /**
+ * A hint that specifies a variable to control whether mouse and touch events are to be
treated together or separately.
+ *
+ * The value of this hint is used at runtime, so it can be changed at any time.
+ *
+ * The variable can be set to the following values:
+ *
+ * * "0" - mouse events will be handled as touch events and touch will
+ * raise fake mouse events
+ * * "1" - mouse events will be handled separately from pure touch events
+ *
+ * By default mouse events will be handled as touch events and touch will raise fake mouse
events.
+ */
+ [Version (since = "2.0.4")]
+ [CCode (cname = "SDL_HINT_ANDROID_SEPARATE_MOUSE_AND_TOUCH")]
+ public const string ANDROID_SEPARATE_MOUSE_AND_TOUCH;
+
+ /**
+ * A hint that specifies the Android APK expansion patch file version.
+ *
+ * This hint must be set together with the hint {@link
Hint.ANDROID_APK_EXPANSION_MAIN_FILE_VERSION}.
+ *
+ * If both hints were set then {@link RWops.from_file} will look into expansion files after a
given relative path was not found in the internal storage and assets.
+ *
+ * This hint should be set with the Android APK expansion patch file version (should be a
string number like "1", "2" etc.)
+ *
+ * By default this hint is not set and the APK expansion files are not searched.
+ */
+ [Version (since = "2.0.4")]
+ [CCode (cname = "SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION")]
+ public const string ANDROID_APK_EXPANSION_PATCH_FILE_VERSION;
+
+ /**
+ * A hint that specifies the Android APK expansion main file version.
+ *
+ * This hint must be set together with the hint {@link
Hint.ANDROID_APK_EXPANSION_PATCH_FILE_VERSION}.
+ *
+ * If both hints were set then {@link RWops.from_file} will look into expansion files after a
given relative path was not found in the internal storage and assets.
+ *
+ * This hint should be set with the Android APK expansion patch file version (should be a
string number like "1", "2" etc.)
+ *
+ * By default this hint is not set and the APK expansion files are not searched.
+ */
+ [Version (since = "2.0.4")]
+ [CCode (cname = "SDL_HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION")]
+ public const string ANDROID_APK_EXPANSION_MAIN_FILE_VERSION;
+
+ /**
+ * A hint that specifies not to catch the SIGINT or SIGTERM signals.
+ *
+ * The variable can be set to the following values:
+ *
+ * * "0" - SDL will install a SIGINT and SIGTERM handler, and when it
+ * catches a signal, convert it into an SDL_QUIT event
+ * * "1" - SDL will not install a signal handler at all
+ *
+ * By default SDL installs a SIGINT and SIGTERM handler, and when it catches a signal,
converts it into an SDL_QUIT event.
+ */
+ [Version (since = "2.0.4")]
+ [CCode (cname = "SDL_HINT_NO_SIGNAL_HANDLERS")]
+ public const string NO_SIGNAL_HANDLERS;
+
+ /**
+ * A hint that specifies whether certain IMEs should handle text editing internally instead
of sending SDL_TEXTEDITING events.
+ *
+ * The variable can be set to the following values:
+ *
+ * * "0" - SDL_TEXTEDITING events are sent, and it is the application's
+ * responsibility to render the text from these events and
+ * differentiate it somehow from committed text. (default)
+ * * "1" - If supported by the IME then SDL_TEXTEDITING events are
+ * not sent, and text that is being composed will be rendered
+ * in its own UI.
+ *
+ * By default SDL_TEXTEDITING events are sent, and it is the application's responsibility to
render the text from these events and differentiate it somehow from committed text.
+ */
+ [Version (since = "2.0.4")]
+ [CCode (cname = "SDL_HINT_IME_INTERNAL_EDITING")]
+ public const string IME_INTERNAL_EDITING;
+
+ /**
+ * A hint that specifies a value to override the binding element for keyboard inputs for
Emscripten builds.
+ *
+ * The variable can be set to the following values:
+ *
+ * * "#window" - the JavaScript window object (this is the default)
+ * * "#document" - the JavaScript document object
+ * * "#screen" - the JavaScript window.screen object
+ * * "#canvas" - the default WebGL canvas element
+ *
+ * Any other string without a leading # sign applies to the element on the page with that ID.
+ *
+ * By default SDL will use the JavaScript window object.
+ */
+ [Version (since = "2.0.4")]
+ [CCode (cname = "SDL_HINT_EMSCRIPTEN_KEYBOARD_ELEMENT")]
+ public const string EMSCRIPTEN_KEYBOARD_ELEMENT;
+
+ /**
+ * A hint that specifies a variable specifying SDL's threads stack size in bytes or "0" for
the backend's default size.
+ *
+ * Use this hint in case you need to set SDL's threads stack size to other than the default.
This is specially
+ * useful if you build SDL against a non glibc libc library (such as musl) which provides a
relatively small default
+ * thread stack size (a few kilobytes versus the default 8 MB glibc uses).
+ *
+ * Support for this hint is currently available only in the pthread backend.
+ *
+ * The variable can be set to the following values:
+ *
+ * * "0" - SDL will use the backend's default threads stack size
+ * * "X" - SDL will use the provided the X positive you provided as the threads stack
size
+ *
+ * By default the backend's default threads stack size is used.
+ */
+ [Version (since = "2.0.4")]
+ [CCode (cname = "SDL_HINT_THREAD_STACK_SIZE")]
+ public const string THREAD_STACK_SIZE;
+
+ /**
+ * A hint that specifies whether the window frame and title bar are interactive when the
cursor is hidden.
+ *
+ * The variable can be set to the following values:
+ *
+ * * "0" - The window frame is not interactive when the cursor is hidden (no move,
resize, etc)
+ * * "1" - The window frame is interactive when the cursor is hidden
+ *
+ * By default SDL will allow interaction with the window frame when the cursor is hidden.
+ */
+ [Version (since = "2.0.4")]
+ [CCode (cname = "SDL_HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN")]
+ public const string WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN;
+
+ /**
+ * A hint that specifies whether the windows message loop is processed by SDL.
+ *
+ * The variable can be set to the following values:
+ *
+ * * "0" - The window message loop is not run
+ * * "1" - The window message loop is processed in {@link SDL.Event.pump}
+ *
+ * By default SDL will process the windows message loop.
+ */
+ [Version (since = "2.0.4")]
+ [CCode (cname = "SDL_HINT_WINDOWS_ENABLE_MESSAGELOOP")]
+ public const string WINDOWS_ENABLE_MESSAGELOOP;
+
+ /**
+ * A hint that specifies that SDL should not to generate an {@link SDL.WindowEvent} of type
{@link SDL.WindowEventType.CLOSE} for Alt+F4 on Microsoft Windows.
+ *
+ * The variable can be set to the following values:
+ *
+ * * "0" - generate an {@link SDL.WindowEvent} of type {@link
SDL.WindowEventType.CLOSE} for Alt+F4 (default)
+ * * "1" - Do not generate event and only do normal key handling for Alt+F4
+ *
+ * By default SDL will process the windows message loop.
+ */
+ [Version (since = "2.0.4")]
+ [CCode (cname = "SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4")]
+ public const string WINDOWS_NO_CLOSE_ON_ALT_F4;
+
+ /**
+ * A hint that specifies that SDL should use the old axis and button mapping for XInput
devices.
+ *
+ * This hint is for backwards compatibility only and will be removed in SDL 2.1
+ *
+ * The default value is "0". This hint must be set before {@link SDL.init}.
+ *
+ * The variable can be set to the following values:
+ *
+ * * "0" - SDL will use the old axis and button mapping for XInput devices
+ * * "1" - SDL won't use old axis and button mapping for XInput devices
+ *
+ * By default SDL does not use the old axis and button mapping for XInput devices.
+ */
+ [Version (since = "2.0.4", deprecated_since = "2.1")]
+ [CCode (cname = "SDL_HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING")]
+ public const string XINPUT_USE_OLD_JOYSTICK_MAPPING;
+
+ /**
+ * A hint that specifies if the SDL app should not be forced to become a foreground process
on Mac OS X.
+ *
+ * The variable can be set to the following values:
+ *
+ * * "0" - SDL will force the app to become a foreground process (default)
+ * * "1" - SDL won't not force the SDL app to become a foreground process
+ *
+ * By default the SDL app will be forced to become a foreground process on Mac OS X.
+ */
+ [Version (since = "2.0.4")]
+ [CCode (cname = "SDL_HINT_MAC_BACKGROUND_APP")]
+ public const string MAC_BACKGROUND_APP;
+
+ /**
+ * A hint that specifies whether the X11 _NET_WM_PING protocol should be supported.
+ *
+ * The hint is checked in the {@link Video.Window} constructor
+ *
+ * The variable can be set to the following values:
+ *
+ * * "0" - disable _NET_WM_PING
+ * * "1" - enable _NET_WM_PING
+ *
+ * By default SDL will use _NET_WM_PING, but for applications that know they will not always
be able to
+ * respond to ping requests in a timely manner they can turn it off to avoid the window
manager thinking
+ * the app is hung.
+ */
+ [Version (since = "2.0.4")]
+ [CCode (cname = "SDL_HINT_VIDEO_X11_NET_WM_PING")]
+ public const string VIDEO_X11_NET_WM_PING;
+
/**
* A callback used to watch hints.
*
@@ -674,49 +919,51 @@ namespace SDL {
* @param old_value The old value.
* @param new_value The new value.
*/
- [CCode (cname ="SDL_HintCallback", has_target=true)]
- public delegate void Callback(string name, string old_value, string? new_value);
-
+ [CCode (cname ="SDL_HintCallback", has_target = true)]
+ public delegate void HintFunc (string name, string old_value, string? new_value);
+
/**
* An enumeration of hint priorities
*/
- [CCode (cname="SDL_HintPriority", cprefix="SDL_HINT_", has_type_id=false)]
+ [CCode (cname = "SDL_HintPriority", cprefix = "SDL_HINT_", has_type_id = false)]
public enum Priority {
/**
* Low priority, used for default values.
*/
DEFAULT,
-
+
/**
* Medium priority.
*/
NORMAL,
-
+
/**
* High priority.
*/
OVERRIDE;
- }
+ }
/**
* Use this function to add a function to watch a particular hint.
*
* @param name The hint to watch.
- * @param callback The delegate of {@link Hint.Callback} type to call when the hint value
changes.
+ * @param callback The delegate of {@link Hint.HintFunc} type to call when the hint value
changes.
*
* @since 2.0.0
*/
- [CCode (cname ="SDL_AddHintCallback", cheader_filename="SDL2/SDL_hints.h")]
- public static void add_callback(string name, Hint.Callback callback);
-
+ [Version (since = "2.0.0")]
+ [CCode (cname ="SDL_AddHintCallback", cheader_filename = "SDL2/SDL_hints.h")]
+ public static void add_callback (string name, HintFunc callback);
+
/**
* Use this function to remove a function watching a particular hint.
*
* @param name The hint being watched.
- * @param callback The delegate of {@link Hint.Callback} type being called when the hint
value changes.
+ * @param callback The delegate of {@link Hint.HintFunc} type being called when the hint
value changes.
*/
- [CCode (cname ="SDL_DelHintCallback", cheader_filename="SDL2/SDL_hints.h")]
- public static void del_callback (string name, Hint.Callback callback);
-
+ [Version (since = "2.0.0")]
+ [CCode (cname ="SDL_DelHintCallback", cheader_filename = "SDL2/SDL_hints.h")]
+ public static void del_callback (string name, HintFunc callback);
+
/**
* Use this function to set a hint with normal priority.
*
@@ -729,9 +976,9 @@ namespace SDL {
*
* @return true if the hint was set. false otherwise.
*/
- [CCode (cname ="SDL_SetHint", cheader_filename="SDL2/SDL_hints.h")]
+ [CCode (cname ="SDL_SetHint", cheader_filename = "SDL2/SDL_hints.h")]
public static bool set_hint (string name, string hint_value);
-
+
/**
* Use this function to get the value of a hint.
*
@@ -739,24 +986,24 @@ namespace SDL {
*
* @return Returns the string value of a hint or null if the hint isn't set.
*/
- [CCode (cname ="SDL_GetHint", cheader_filename="SDL2/SDL_hints.h")]
+ [CCode (cname ="SDL_GetHint", cheader_filename = "SDL2/SDL_hints.h")]
public static unowned string get_hint (string name);
-
+
/**
* Use this funcion on boolean hints to see if they are enabled.
*/
- public static bool hint_enabled(string name){
- return get_hint(name) == "0" ? true : false;
+ public static bool hint_enabled (string name) {
+ return get_hint (name) == "0" ? true : false;
}
-
+
/**
* Use this function to clear all hints.
*
* This function is automatically called during {@link SDL.quit}.
*/
- [CCode (cname ="SDL_ClearHints", cheader_filename="SDL2/SDL_hints.h")]
- public static void clear_all();
-
+ [CCode (cname ="SDL_ClearHints", cheader_filename = "SDL2/SDL_hints.h")]
+ public static void clear_all ();
+
/**
* Use this function to set a hint with a specific priority.
*
@@ -766,163 +1013,219 @@ namespace SDL {
*
* @return true if the hint was set. false otherwise.
*/
- [CCode (cname ="SDL_SetHintWithPriority", cheader_filename="SDL2/SDL_hints.h")]
- public static bool set_hint_with_priority(string name, string hint_value, Hint.Priority
priority);
-
+ [CCode (cname ="SDL_SetHintWithPriority", cheader_filename = "SDL2/SDL_hints.h")]
+ public static bool set_hint_with_priority (string name, string hint_value, Hint.Priority
priority);
+
}//Hints
-
-
+
+
///
/// Power
///
- [CCode (cname ="SDL_PowerState", cheader_filename="SDL2/SDL_power.h", cprefix="SDL_POWERSTATE_" )]
- public enum PowerState{
+ [CCode (cname ="SDL_PowerState", cheader_filename = "SDL2/SDL_power.h", cprefix = "SDL_POWERSTATE_")]
+ public enum PowerState {
ON_BATTERY, NO_BATTERY, CHARGING,
CHARGED, UNKNOWN
}
- [CCode (cname ="SDL_GetPowerInfo", cheader_filename="SDL2/SDL_power.h")]
- public static PowerState get_power_info(out int seconds_left, out int percentage_left);
+ [CCode (cname ="SDL_GetPowerInfo", cheader_filename = "SDL2/SDL_power.h")]
+ public static PowerState get_power_info (out int seconds_left, out int percentage_left);
//Power
-
+
///
/// Error
///
- [CCode (cname="SDL_errorcode", cprefix="SDL_")]
+ [CCode (cname = "SDL_errorcode", cprefix = "SDL_")]
public enum ErrorCode {
- ENOMEM, EFREAD, EFWRITE, EFSEEK,
+ ENOMEM, EFREAD, EFWRITE, EFSEEK,
UNSUPPORTED, LASTERROR
}
-
- [CCode (cname="SDL_SetError")]
- public static int set_error(string format, ...);
-
- [CCode (cname="SDL_GetError")]
- public static unowned string get_error();
-
- [CCode (cname="SDL_ClearError")]
- public static void clear_error();
-
- [CCode (cname="SDL_Error")]
- public static void emit_error(ErrorCode code);
- // Error
-
+
+ [CCode (cname = "SDL_SetError")]
+ [PrintfFunction]
+ public static int set_error (string format, ...);
+
+ [CCode (cname = "SDL_GetError")]
+ public static unowned string get_error ();
+
+ [CCode (cname = "SDL_ClearError")]
+ public static void clear_error ();
+
+ [CCode (cname = "SDL_Error")]
+ public static void emit_error (ErrorCode code);
+ // Error
+
///
/// RWops
///
-
- [Flags, CCode (cname="int", cprefix="RW_SEEK_", cheader_filename="SDL2/SDL_rwops.h")]
+
+ [Flags, CCode (cname = "int", cprefix = "RW_SEEK_", cheader_filename = "SDL2/SDL_rwops.h")]
public enum RWFlags {
- SET,CUR,END
+ SET, CUR, END
}// RWFlags
-
- [CCode (cname="SDL_RWops", free_function="SDL_FreeRW", cheader_filename="SDL2/SDL_rwops.h")]
+
+ [CCode (cname = "SDL_RWops", free_function = "SDL_FreeRW", cheader_filename = "SDL2/SDL_rwops.h")]
[Compact]
public class RWops {
-
+
public uint32 type;
-
- [CCode (cname="SDL_RWread")]
- public size_t read(void* ptr, size_t size,size_t maxnum);
-
- [CCode (cname="SDL_RWwrite")]
- public size_t write(void* ptr, size_t size,size_t num);
-
- [CCode (cname="SDL_RWseek")]
- public int64 seek(int64 offset, SDL.RWFlags flag);
-
- [CCode (cname="SDL_RWtell")]
- public int64 tell();
-
- [CCode (cname="SDL_RWclose")]
+
+ [CCode (cname = "SDL_RWread")]
+ public size_t read (void* ptr, size_t size, size_t maxnum);
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_ReadU8")]
+ public uint8 read_u8 ();
+
+ [CCode (cname = "SDL_ReadBE16")]
+ public uint16 read_be16 ();
+
+ [CCode (cname = "SDL_ReadLE16")]
+ public uint16 read_le16 ();
+
+ [CCode (cname = "SDL_ReadBE32")]
+ public uint32 read_be32 ();
+
+ [CCode (cname = "SDL_ReadLE32")]
+ public uint32 read_le32 ();
+
+ [CCode (cname = "SDL_ReadBE64")]
+ public uint64 read_be64 ();
+
+ [CCode (cname = "SDL_ReadLE64")]
+ public uint64 read_le64 ();
+
+ [CCode (cname = "SDL_RWwrite")]
+ public size_t write (void* ptr, size_t size, size_t num);
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_WriteU8")]
+ public size_t write_u8 (uint8 val);
+
+ [CCode (cname = "SDL_WriteBE16")]
+ public size_t write_be16 (uint16 val);
+
+ [CCode (cname = "SDL_WriteLE16")]
+ public size_t write_le16 (uint16 val);
+
+ [CCode (cname = "SDL_WriteBE32")]
+ public size_t write_be32 (uint32 val);
+
+ [CCode (cname = "SDL_WriteLE32")]
+ public size_t write_le32 (uint32 val);
+
+ [CCode (cname = "SDL_WriteBE64")]
+ public size_t write_be64 (uint64 val);
+
+ [CCode (cname = "SDL_WriteLE64")]
+ public size_t write_le64 (uint64 val);
+
+ [CCode (cname = "SDL_RWseek")]
+ public int64 seek (int64 offset, SDL.RWFlags flag);
+
+ [CCode (cname = "SDL_RWtell")]
+ public int64 tell ();
+
+ [CCode (cname = "SDL_RWclose")]
[DestroysInstance]
- public int64 close();
-
- [CCode (cname="SDL_RWFromFile")]
- public RWops.from_file(string file, string mode);
-
- [CCode (cname="SDL_RWFromMem")]
- public RWops.from_mem(void* mem, int size);
-
-
+ public int64 close ();
+
+ [CCode (cname = "SDL_RWFromFile")]
+ public RWops.from_file (string file, string mode);
+
+ [CCode (cname = "SDL_RWFromMem")]
+ public RWops.from_mem (void* mem, int size);
+
+ [Version (since = "2.0.0")]
+ public int64 size{
+ [CCode (cname = "SDL_RWsize")] get;
+ }
}// RWops
-
+
///
/// Events
///
- [CCode (cname="SDL_EventType", cprefix="SDL_", cheader_filename="SDL2/SDL_events.h")]
+ [CCode (cname = "SDL_EventType", cprefix = "SDL_", cheader_filename = "SDL2/SDL_events.h")]
public enum EventType {
// TODO: Review if updated
- FIRSTEVENT,QUIT,APP_TERMINATING,APP_LOWMEMORY,APP_WILLENTERBACKGROUND,APP_DIDENTERBACKGROUND,
- APP_WILLENTERFOREGROUND,
APP_DIDENTERFOREGROUND,WINDOWEVENT,SYSWMEVENT,KEYDOWN,KEYUP,TEXTEDITING,
- TEXTINPUT,MOUSEMOTION,MOUSEBUTTONDOWN,MOUSEBUTTONUP,MOUSEWHEEL,JOYAXISMOTION,JOYBALLMOTION,
- JOYHATMOTION,JOYBUTTONDOWN,JOYBUTTONUP,JOYDEVICEADDED,JOYDEVICEREMOVED,CONTROLLERAXISMOTION,
- CONTROLLERBUTTONDOWN,CONTROLLERBUTTONUP,CONTROLLERDEVICEADDED,CONTROLLERDEVICEREMOVED,
-
CONTROLLERDEVICEREMAPPED,FINGERDOWN,FINGERUP,FINGERMOTION,DOLLARGESTURE,DOLLARRECORD,MULTIGESTURE,
-
CLIPBOARDUPDATE,DROPFILE,AUDIODEVICEADDED,AUDIODEVICEREMOVED,RENDER_TARGETS_RESET,RENDER_DEVICE_RESET,
- USEREVENT,LASTEVENT;
+ FIRSTEVENT, QUIT, APP_TERMINATING, APP_LOWMEMORY, APP_WILLENTERBACKGROUND,
APP_DIDENTERBACKGROUND,
+ APP_WILLENTERFOREGROUND, APP_DIDENTERFOREGROUND, WINDOWEVENT, SYSWMEVENT, KEYDOWN, KEYUP,
TEXTEDITING,
+ TEXTINPUT, [Version (since = "2.0.4")] KEYMAPCHANGED, MOUSEMOTION, MOUSEBUTTONDOWN,
MOUSEBUTTONUP,
+ MOUSEWHEEL, JOYAXISMOTION, JOYBALLMOTION, JOYHATMOTION, JOYBUTTONDOWN, JOYBUTTONUP,
JOYDEVICEADDED,
+ JOYDEVICEREMOVED, CONTROLLERAXISMOTION, CONTROLLERBUTTONDOWN, CONTROLLERBUTTONUP,
CONTROLLERDEVICEADDED,
+ CONTROLLERDEVICEREMOVED, CONTROLLERDEVICEREMAPPED, FINGERDOWN, FINGERUP, FINGERMOTION,
DOLLARGESTURE,
+ DOLLARRECORD, MULTIGESTURE, CLIPBOARDUPDATE, DROPFILE, [Version (since = "2.0.4")]
AUDIODEVICEADDED,
+ [Version (since = "2.0.4")] AUDIODEVICEREMOVED, [Version (since = "2.0.2")]
RENDER_TARGETS_RESET,
+ [Version (since = "2.0.4")] RENDER_DEVICE_RESET, USEREVENT, LASTEVENT;
}// EventType
-
- [CCode (cname="SDL_CommonEvent", has_type_id=false, cheader_filename="SDL2/SDL_events.h")]
+
+ [CCode (cname = "SDL_WindowEventID", cprefix = "SDL_WINDOWEVENT_", cheader_filename =
"SDL2/SDL_events.h")]
+ public enum WindowEventType {
+ NONE, SHOWN, HIDDEN, EXPOSED, MOVED, RESIZED, SIZE_CHANGED, MINIMIZED, MAXIMIZED, RESTORED,
+ ENTER, LEAVE, FOCUS_GAINED, FOCUS_LOST, CLOSE;
+ }
+
+ [CCode (cname = "SDL_CommonEvent", has_type_id = false, cheader_filename = "SDL2/SDL_events.h")]
[Compact]
public struct CommonEvent {
SDL.EventType type;
uint32 timestamp;
}// CommonEvent
-
- [CCode (cname="SDL_WindowEvent", has_type_id=false, cheader_filename="SDL2/SDL_events.h")]
+
+ [CCode (cname = "SDL_WindowEvent", has_type_id = false, cheader_filename = "SDL2/SDL_events.h")]
[Compact]
public struct WindowEvent : CommonEvent {
- [CCode (cname="windowID")]
+ [CCode (cname = "windowID")]
uint32 window_id;
- uint8 event;
+ WindowEventType event;
int32 data1;
int32 data2;
}// WindowEvent
-
- [CCode (cname="SDL_AudioDeviceEvent", has_type_id=false, cheader_filename="SDL2/SDL_events.h")]
+
+ [Version (since = "2.0.4")]
+ [CCode (cname = "SDL_AudioDeviceEvent", has_type_id = false, cheader_filename = "SDL2/SDL_events.h")]
[Compact]
- public struct AudioDeviceEvent : CommonEvent{
+ public struct AudioDeviceEvent : CommonEvent {
uint32 which;
bool iscapture;
- }
-
- [CCode (cname="SDL_KeyboardEvent", has_type_id=false, cheader_filename="SDL2/SDL_events.h")]
+ }
+
+ [CCode (cname = "SDL_KeyboardEvent", has_type_id = false, cheader_filename = "SDL2/SDL_events.h")]
[Compact]
public struct KeyboardEvent : CommonEvent {
- [CCode (cname="windowID")] uint32 window_id;
+ [CCode (cname = "windowID")] uint32 window_id;
uint8 state;
uint8 repeat;
Input.Key keysym;
}// KeyboardEvent
-
- [CCode (cname="SDL_TextEditingEvent", has_type_id=false, cheader_filename="SDL2/SDL_events.h")]
+
+ [CCode (cname = "SDL_TextEditingEvent", has_type_id = false, cheader_filename = "SDL2/SDL_events.h")]
[Compact]
public struct TextEditingEvent : CommonEvent {
- [CCode (cname="SDL_TEXTEDITINGEVENT_TEXT_SIZE")]
+ [CCode (cname = "SDL_TEXTEDITINGEVENT_TEXT_SIZE")]
public static const uint8 TEXT_SIZE;
-
- [CCode (cname="windowID")]
+
+ [CCode (cname = "windowID")]
uint32 window_id;
string? text;
int32 start;
int32 length;
}// TextEditingEvent
-
- [CCode (cname="SDL_TextInputEvent", has_type_id=false, cheader_filename="SDL2/SDL_events.h")]
+
+ [CCode (cname = "SDL_TextInputEvent", has_type_id = false, cheader_filename = "SDL2/SDL_events.h")]
[Compact]
public struct TextInputEvent : CommonEvent {
- [CCode (cname="SDL_TEXTINPUTEVENT_TEXT_SIZE")]
+ [CCode (cname = "SDL_TEXTINPUTEVENT_TEXT_SIZE")]
public static const uint8 TEXT_SIZE;
-
- [CCode (cname="windowID")]
+
+ [CCode (cname = "windowID")]
uint32 window_id;
string? text;
}// TextInputEvent
-
- [CCode (cname="SDL_MouseMotionEvent", has_type_id=false, cheader_filename="SDL2/SDL_events.h")]
+
+ [CCode (cname = "SDL_MouseMotionEvent", has_type_id = false, cheader_filename = "SDL2/SDL_events.h")]
[Compact]
public struct MouseMotionEvent : CommonEvent {
- [CCode (cname="windowID")]
+ [CCode (cname = "windowID")]
uint32 window_id;
uint32 which;
uint8 state;
@@ -931,121 +1234,131 @@ namespace SDL {
int32 xrel;
int32 yrel;
}// MouseMotionEvent
-
- [CCode (cname="SDL_MouseButtonEvent", has_type_id=false, cheader_filename="SDL2/SDL_events.h")]
+
+ [CCode (cname = "SDL_MouseButtonEvent", has_type_id = false, cheader_filename = "SDL2/SDL_events.h")]
[Compact]
public struct MouseButtonEvent : CommonEvent {
- [CCode (cname="windowID")]
+ [CCode (cname = "windowID")]
uint32 window_id;
uint32 which;
uint8 button;
uint8 state;
+ [Version (since = "2.0.2")]
uint8 clicks;
int32 x;
int32 y;
}// MouseButtonEvent
-
- [CCode (cname="SDL_MouseWheelEvent", has_type_id=false, cheader_filename="SDL2/SDL_events.h")]
+
+ [CCode (cname = "Uint32", cprefix = "SDL_MOUSEWHEEL_", has_type_id = false, cheader_filename =
"SDL2/SDL_events.h")]
+ public enum MouseWheelDirection {
+ NORMAL,
+ FLIPPED
+ }
+
+ [CCode (cname = "SDL_MouseWheelEvent", has_type_id = false, cheader_filename = "SDL2/SDL_events.h")]
[Compact]
public struct MouseWheelEvent : CommonEvent {
- [CCode (cname="windowID")]
+ [CCode (cname = "windowID")]
uint32 window_id;
uint32 which;
int32 x;
int32 y;
+ [Version (since = "2.0.4")]
+ MouseWheelDirection direction;
+
}// MouseWheelEvent
-
- [CCode (cname="SDL_JoyAxisEvent", has_type_id=false, cheader_filename="SDL2/SDL_events.h")]
+
+ [CCode (cname = "SDL_JoyAxisEvent", has_type_id = false, cheader_filename = "SDL2/SDL_events.h")]
[Compact]
public struct JoyAxisEvent : CommonEvent {
- [CCode (cname="windowID")]
+ [CCode (cname = "windowID")]
uint32 window_id;
Input.JoystickID which;
uint8 axis;
int16 @value;
}// JoyAxisEvent
-
- [CCode (cname="SDL_JoyBallEvent", has_type_id=false, cheader_filename="SDL2/SDL_events.h")]
+
+ [CCode (cname = "SDL_JoyBallEvent", has_type_id = false, cheader_filename = "SDL2/SDL_events.h")]
[Compact]
public struct JoyBallEvent : CommonEvent {
- [CCode (cname="windowID")]
+ [CCode (cname = "windowID")]
uint32 window_id;
Input.JoystickID which;
uint8 ball;
int16 xrel;
int16 yrel;
}// JoyBallEvent
-
- [CCode (cname="Uint8", cprefix="SDL_HAT_", cheader_filename="SDL2/SDL_events.h")]
+
+ [CCode (cname = "Uint8", cprefix = "SDL_HAT_", cheader_filename = "SDL2/SDL_events.h")]
public enum HatValue {
LEFTU, UP, RIGHTUP,
LEFT, CENTERED, RIGHT,
LEFTDOWN, DOWN, RIGHTDOWN
}
-
- [CCode (cname="SDL_JoyHatEvent", has_type_id=false, cheader_filename="SDL2/SDL_events.h")]
+
+ [CCode (cname = "SDL_JoyHatEvent", has_type_id = false, cheader_filename = "SDL2/SDL_events.h")]
[Compact]
public struct JoyHatEvent : CommonEvent {
- [CCode (cname="windowID")]
+ [CCode (cname = "windowID")]
uint32 window_id;
Input.JoystickID which;
uint8 hat;
SDL.HatValue hat_value;
}// JoyHatEvent
-
- [CCode (cname="SDL_JoyButtonEvent", has_type_id=false, cheader_filename="SDL2/SDL_events.h")]
+
+ [CCode (cname = "SDL_JoyButtonEvent", has_type_id = false, cheader_filename = "SDL2/SDL_events.h")]
[Compact]
public struct JoyButtonEvent : CommonEvent {
- [CCode (cname="windowID")]
+ [CCode (cname = "windowID")]
uint32 window_id;
Input.JoystickID which;
uint8 button;
uint8 state;
}// JoyButtonEvent
-
- [CCode (cname="SDL_JoyDeviceEvent", has_type_id=false, cheader_filename="SDL2/SDL_events.h")]
+
+ [CCode (cname = "SDL_JoyDeviceEvent", has_type_id = false, cheader_filename = "SDL2/SDL_events.h")]
[Compact]
public struct JoyDeviceEvent : CommonEvent {
- [CCode (cname="windowID")]
+ [CCode (cname = "windowID")]
uint32 window_id;
Input.JoystickID which;
}// JoyDeviceEvent
-
- [CCode (cname="SDL_ControllerAxisEvent", has_type_id=false, cheader_filename="SDL2/SDL_events.h")]
+
+ [CCode (cname = "SDL_ControllerAxisEvent", has_type_id = false, cheader_filename =
"SDL2/SDL_events.h")]
[Compact]
public struct ControllerAxisEvent : CommonEvent {
- [CCode (cname="windowID")]
+ [CCode (cname = "windowID")]
uint32 window_id;
Input.JoystickID which;
uint8 axis;
int16 @value;
}// ControllerAxisEvent
-
- [CCode (cname="SDL_ControllerButtonEvent", has_type_id=false, cheader_filename="SDL2/SDL_events.h")]
+
+ [CCode (cname = "SDL_ControllerButtonEvent", has_type_id = false, cheader_filename =
"SDL2/SDL_events.h")]
[Compact]
public struct ControllerButtonEvent : CommonEvent {
- [CCode (cname="windowID")]
+ [CCode (cname = "windowID")]
uint32 window_id;
Input.JoystickID which;
uint8 button;
uint8 state;
}// ControllerButtonEvent
-
- [CCode (cname="SDL_ControllerDeviceEvent", has_type_id=false, cheader_filename="SDL2/SDL_events.h")]
+
+ [CCode (cname = "SDL_ControllerDeviceEvent", has_type_id = false, cheader_filename =
"SDL2/SDL_events.h")]
[Compact]
public struct ControllerDeviceEvent : CommonEvent {
- [CCode (cname="windowID")]
+ [CCode (cname = "windowID")]
uint32 window_id;
Input.JoystickID which;
}// ControllerDeviceEvent
-
- [CCode (cname="SDL_TouchFingerEvent", has_type_id=false, cheader_filename="SDL2/SDL_events.h")]
+
+ [CCode (cname = "SDL_TouchFingerEvent", has_type_id = false, cheader_filename = "SDL2/SDL_events.h")]
[Compact]
public struct TouchFingerEvent : CommonEvent {
- [CCode (cname="touchID")]
+ [CCode (cname = "touchID")]
Input.Touch.TouchID touch_id;
- [CCode (cname="fingerID")]
+ [CCode (cname = "fingerID")]
Input.Touch.FingerID finger_id;
float x;
float y;
@@ -1053,71 +1366,71 @@ namespace SDL {
float dy;
float pressure;
}// TouchFingerEvent
-
- [CCode (cname="SDL_MultiGestureEvent", has_type_id=false, cheader_filename="SDL2/SDL_events.h")]
+
+ [CCode (cname = "SDL_MultiGestureEvent", has_type_id = false, cheader_filename = "SDL2/SDL_events.h")]
[Compact]
public struct MultiGestureEvent : CommonEvent {
- [CCode (cname="touchID")]
+ [CCode (cname = "touchID")]
Input.Touch.TouchID touch_id;
- [CCode (cname="dTheta")]
+ [CCode (cname = "dTheta")]
float d_theta;
- [CCode (cname="dDist")]
+ [CCode (cname = "dDist")]
float d_dist;
float x;
float y;
float pressure;
- [CCode (cname="numFingers")]
+ [CCode (cname = "numFingers")]
uint16 num_fingers;
}// MultiGestureEvent
-
- [CCode (cname="SDL_DollarGestureEvent", has_type_id=false, cheader_filename="SDL2/SDL_events.h")]
+
+ [CCode (cname = "SDL_DollarGestureEvent", has_type_id = false, cheader_filename =
"SDL2/SDL_events.h")]
[Compact]
public struct DollarGestureEvent : CommonEvent {
- [CCode (cname="touchID")]
+ [CCode (cname = "touchID")]
Input.Touch.TouchID touch_id;
- [CCode (cname="gestureID")]
+ [CCode (cname = "gestureID")]
Input.Gesture.GestureID gesture_id;
- [CCode (cname="numFingers")]
+ [CCode (cname = "numFingers")]
uint32 num_fingers;
float error;
float x;
float y;
}// DollarGestureEvent
-
- [CCode (cname="SDL_DropEvent", has_type_id=false, cheader_filename="SDL2/SDL_events.h")]
+
+ [CCode (cname = "SDL_DropEvent", has_type_id = false, cheader_filename = "SDL2/SDL_events.h")]
[Compact]
public struct DropEvent : CommonEvent {
string file;
}// DropEvent
-
- [CCode (cname="SDL_UserEvent", has_type_id=false, cheader_filename="SDL2/SDL_events.h")]
+
+ [CCode (cname = "SDL_UserEvent", has_type_id = false, cheader_filename = "SDL2/SDL_events.h")]
[Compact]
public struct UserEvent : CommonEvent {
- [CCode (cname="windowID")]
+ [CCode (cname = "windowID")]
uint32 window_id;
int32 code;
void* data1;
void* data2;
}// UserEvent
-
- [CCode (cname="SDL_QuitEvent", has_type_id=false, cheader_filename="SDL2/SDL_events.h")]
+
+ [CCode (cname = "SDL_QuitEvent", has_type_id = false, cheader_filename = "SDL2/SDL_events.h")]
[Compact]
public struct QuitEvent : CommonEvent {}// QuitEvent
-
-
- [CCode (cname="SDL_OSEvent", has_type_id=false, cheader_filename="SDL2/SDL_events.h")]
+
+
+ [CCode (cname = "SDL_OSEvent", has_type_id = false, cheader_filename = "SDL2/SDL_events.h")]
[Compact]
public struct OSEvent : CommonEvent {}// OSEvent
- [CCode (cname="SDL_SysWMEvent", type_id="SDL_SysWMEvent", cheader_filename="SDL2/SDL_events.h")]
+ [CCode (cname = "SDL_SysWMEvent", type_id = "SDL_SysWMEvent", cheader_filename = "SDL2/SDL_events.h")]
public struct SysWMEvent {
public Video.SysWMmsg msg;
}// SysWMEvent
-
- [CCode (has_target = true)]
- public delegate int EventFilter (SDL.Event ev);
-
- [CCode (cname="SDL_Event", has_type_id=false, has_target=false, destroy_function="",
cheader_filename="SDL2/SDL_events.h")]
+
+ [CCode (has_target = true, instance_pos = 0)]
+ public delegate int EventFilter (ref SDL.Event ev);
+
+ [CCode (cname = "SDL_Event", has_type_id = false, has_target = false, destroy_function = "",
cheader_filename = "SDL2/SDL_events.h")]
[SimpleType]
public struct Event {
public SDL.EventType type;
@@ -1128,7 +1441,7 @@ namespace SDL {
public SDL.TextInputEvent text;
public SDL.MouseMotionEvent motion;
public SDL.MouseButtonEvent button;
- public SDL.MouseWheelEvent wheel;
+ public SDL.MouseWheelEvent wheel;
public SDL.JoyAxisEvent jaxis;
public SDL.JoyBallEvent jball;
public SDL.JoyHatEvent jhat;
@@ -1137,132 +1450,133 @@ namespace SDL {
public SDL.ControllerAxisEvent caxis;
public SDL.ControllerButtonEvent cbutton;
public SDL.ControllerDeviceEvent cdevice;
+ [Version (since = "2.0.4")]
public SDL.AudioDeviceEvent adevice;
- public SDL.QuitEvent quit;
+ public SDL.QuitEvent quit;
public SDL.UserEvent user;
public SDL.SysWMEvent syswm;
public SDL.TouchFingerEvent tfinger;
public SDL.MultiGestureEvent mgesture;
public SDL.DollarGestureEvent dgesture;
public SDL.DropEvent drop;
-
- [CCode (cname="SDL_PumpEvents")]
- public static void pump();
- [CCode (cname="SDL_PeepEvents")]
- public static void peep(SDL.Event[] events, EventAction action,
+ [CCode (cname = "SDL_PumpEvents")]
+ public static void pump ();
+
+ [CCode (cname = "SDL_PeepEvents")]
+ public static void peep (SDL.Event[] events, EventAction action,
uint32 min_type, uint32 max_type);
- [CCode (cname="SDL_HasEvent")]
- public static bool has_event(SDL.EventType type);
+ [CCode (cname = "SDL_HasEvent")]
+ public static bool has_event (SDL.EventType type);
+
+ [CCode (cname = "SDL_HasEvents")]
+ public static bool has_events (uint32 min_type, uint32 max_type);
+
+ [CCode (cname = "SDL_FlushEvent")]
+ public static void flush_event (SDL.EventType type);
- [CCode (cname="SDL_HasEvents")]
- public static bool has_events(uint32 min_type, uint32 max_type);
+ [CCode (cname = "SDL_FlushEvents")]
+ public static void flush_events (uint32 min_type, uint32 max_type);
- [CCode (cname="SDL_FlushEvent")]
- public static void flush_event(SDL.EventType type);
+ [CCode (cname = "SDL_PollEvent")]
+ public static int poll (out SDL.Event ev);
- [CCode (cname="SDL_FlushEvents")]
- public static void flush_events(uint32 min_type, uint32 max_type);
+ [CCode (cname = "SDL_WaitEvent")]
+ public static int wait (out SDL.Event ev);
- [CCode (cname="SDL_PollEvent")]
- public static int poll(out SDL.Event ev);
+ [CCode (cname = "SDL_WaitEventTimeout")]
+ public static int wait_inms (out SDL.Event ev, int timeout);
- [CCode (cname="SDL_WaitEvent")]
- public static int wait(out SDL.Event ev);
+ [CCode (cname = "SDL_PushEvent")]
+ public static int push (SDL.Event ev);
- [CCode (cname="SDL_WaitEventTimeout")]
- public static int wait_inms(out SDL.Event ev, int timeout);
+ [CCode (cname = "SDL_SetEventFilter")]
+ public static void set_eventfilter (SDL.EventFilter filter);
- [CCode (cname="SDL_PushEvent")]
- public static int push(SDL.Event ev);
-
- [CCode (cname="SDL_SetEventFilter")]
- public static void set_eventfilter(SDL.EventFilter filter);
+ [CCode (cname = "SDL_GetEventFilter")]
+ public static bool get_eventfilter (out SDL.EventFilter filter);
- [CCode (cname="SDL_GetEventFilter")]
- public static bool get_eventfilter(out SDL.EventFilter filter);
+ [CCode (cname = "SDL_AddEventWatch")]
+ public static void add_eventwatch (SDL.EventFilter filter);
- [CCode (cname="SDL_AddEventWatch")]
- public static void add_eventwatch(SDL.EventFilter filter);
+ [CCode (cname = "SDL_DelEventWatch")]
+ public static void del_eventwatch (SDL.EventFilter filter);
- [CCode (cname="SDL_DelEventWatch")]
- public static void del_eventwatch(SDL.EventFilter filter);
+ [CCode (cname = "SDL_FilterEvents")]
+ public static void filter_events (SDL.EventFilter filter);
- [CCode (cname="SDL_FilterEvents")]
- public static void filter_events(SDL.EventFilter filter);
+ [CCode (cname = "SDL_EventState")]
+ public static uint8 state (SDL.EventType type, SDL.EventState state);
- [CCode (cname="SDL_EventState")]
- public static uint8 state(SDL.EventType type, SDL.EventState state);
+ [CCode (cname = "SDL_RegisterEvents")]
+ public static uint32 register_events (int numevents);
+
+ [CCode (cname = "SDL_QuitRequested")]
+ public static bool quit_requested ();
- [CCode (cname="SDL_RegisterEvents")]
- public static uint32 register_events(int numevents);
-
- [CCode (cname="SDL_QuitRequested")]
- public static bool quit_requested();
-
}// Event
- [CCode (cname="int", cprefix="SDL_", cheader_filename="SDL2/SDL_events.h")]
+ [CCode (cname = "int", cprefix = "SDL_", cheader_filename = "SDL2/SDL_events.h")]
public enum EventState {
QUERY, IGNORE, DISABLE, ENABLE
}// EventState
-
- [CCode (cname="SDL_eventaction", cprefix="SDL_", cheader_filename="SDL2/SDL_events.h")]
+
+ [CCode (cname = "SDL_eventaction", cprefix = "SDL_", cheader_filename = "SDL2/SDL_events.h")]
public enum EventAction {
ADDEVENT, PEEKEVENT, GETEVENT
}// EventAction
-
-
+
+
///
/// Video
///
- [CCode (cheader_filename="SDL2/SDL_video.h")]
- namespace Video{
- [CCode (cprefix="SDL_ALPHA_", cheader_filename="SDL2/SDL_pixels.h")]
+ [CCode (cheader_filename = "SDL2/SDL_video.h")]
+ namespace Video {
+ [CCode (cprefix = "SDL_ALPHA_", cheader_filename = "SDL2/SDL_pixels.h")]
public enum Alpha {
OPAQUE,
TRANSPARENT
}// Alpha
-
- [CCode (cprefix="SDL_PIXELTYPE_", cheader_filename="SDL2/SDL_pixels.h")]
+
+ [CCode (cprefix = "SDL_PIXELTYPE_", cheader_filename = "SDL2/SDL_pixels.h")]
public enum PixelType {
UNKNOWN,
INDEX1, INDEX4, INDEX8, PACKED8, PACKED16, PACKED32,
ARRAYU8, ARRAYU16, ARRAYU32, ARRAYF16, ARRAYF32
}// PixelType
-
- [CCode (cprefix="SDL_BITMAPORDER", cheader_filename="SDL2/SDL_pixels.h")]
+
+ [CCode (cprefix = "SDL_BITMAPORDER", cheader_filename = "SDL2/SDL_pixels.h")]
public enum BitmapOrder {
- [CCode (cname="SDL_BITMAPORDER_NONE")]
- NONE,
- _4321, _1234
+ [CCode (cname = "SDL_BITMAPORDER_NONE")]
+ NONE,
+ _4321, _1234
}// BitmapOrder
-
- [CCode (cprefix="SDL_PACKEDORDER_", cheader_filename="SDL2/SDL_pixels.h")]
+
+ [CCode (cprefix = "SDL_PACKEDORDER_", cheader_filename = "SDL2/SDL_pixels.h")]
public enum PackedOrder {
NONE, XRGB, RGBX, ARGB, RGBA,
XBGR, BGRX, ABGR, BGRA
}// PackedOrder
-
- [CCode (cprefix="SDL_ARRAYORDER_", cheader_filename="SDL2/SDL_pixels.h")]
+
+ [CCode (cprefix = "SDL_ARRAYORDER_", cheader_filename = "SDL2/SDL_pixels.h")]
public enum ArrayOrder {
NONE, RGB, RGBA,
ARGB, BGR, BGRA, ABGR
}// ArrayOrder
-
- [CCode (cprefix="SDL_PACKEDLAYOUT", cheader_filename="SDL2/SDL_pixels.h")]
+
+ [CCode (cprefix = "SDL_PACKEDLAYOUT", cheader_filename = "SDL2/SDL_pixels.h")]
public enum PackedLayout {
- [CCode (cname="SDL_PACKEDLAYOUT_NONE")]
+ [CCode (cname = "SDL_PACKEDLAYOUT_NONE")]
NONE,
_332, _4444, _1555, _5551,
_565, _8888, _2101010, _1010102
}// PackedLayout
-
-
- [CCode (cname="Uint32", cprefix="SDL_PIXELFORMAT_", has_type_id = false,
cheader_filename="SDL2/SDL_pixels.h")]
+
+
+ [CCode (cname = "Uint32", cprefix = "SDL_PIXELFORMAT_", has_type_id = false, cheader_filename
= "SDL2/SDL_pixels.h")]
public enum PixelRAWFormat {
UNKNOWN, INDEX1LSB, INDEX1MSB, INDEX4LSB, INDEX4MSB,
INDEX8, RGB332, RGB444, RGB555, ARGB4444, RGBA4444,
@@ -1272,57 +1586,57 @@ namespace SDL {
ABGR8888, BGRA8888, ARGB2101010, YV12, IYUV, YUY2,
UYVY, YVYU;
- [CCode (cname="SDL_DEFINE_PIXELFOURCC")]
- public PixelRAWFormat define_from_four_cc(char a, char b, char c, char d);
-
- [CCode (cname="SDL_DEFINE_PIXELFORMAT")]
- public PixelRAWFormat define(Video.PixelType type, Video.BitmapOrder order,
Video.PackedLayout layout, uchar bits, uchar bytes);
-
- [CCode (cname="SDL_PIXELFLAG")]
- public uchar get_pixel_flag();
-
- [CCode (cname="SDL_PIXELTYPE")]
- public Video.PixelType get_pixel_type();
-
- [CCode (cname="SDL_PIXELORDER")]
- public Video.BitmapOrder get_pixel_order();
-
- [CCode (cname="SDL_PIXELLAYOUT")]
- public Video.PackedLayout get_pixel_layout();
-
- [CCode (cname="SDL_BITSPERPIXEL")]
- public uchar bits_per_pixel();
-
- [CCode (cname="SDL_BYTESPERPIXEL")]
- public uchar bytes_per_pixel();
-
- [CCode (cname="SDL_ISPIXELFORMAT_INDEXED")]
- public bool is_indexed();
-
- [CCode (cname="SDL_ISPIXELFORMAT_ALPHA")]
- public bool is_alpha();
-
+ [CCode (cname = "SDL_DEFINE_PIXELFOURCC")]
+ public PixelRAWFormat define_from_four_cc (char a, char b, char c, char d);
+
+ [CCode (cname = "SDL_DEFINE_PIXELFORMAT")]
+ public PixelRAWFormat define (Video.PixelType type, Video.BitmapOrder order,
Video.PackedLayout layout, uchar bits, uchar bytes);
+
+ [CCode (cname = "SDL_PIXELFLAG")]
+ public uchar get_pixel_flag ();
+
+ [CCode (cname = "SDL_PIXELTYPE")]
+ public Video.PixelType get_pixel_type ();
+
+ [CCode (cname = "SDL_PIXELORDER")]
+ public Video.BitmapOrder get_pixel_order ();
+
+ [CCode (cname = "SDL_PIXELLAYOUT")]
+ public Video.PackedLayout get_pixel_layout ();
+
+ [CCode (cname = "SDL_BITSPERPIXEL")]
+ public uchar bits_per_pixel ();
+
+ [CCode (cname = "SDL_BYTESPERPIXEL")]
+ public uchar bytes_per_pixel ();
+
+ [CCode (cname = "SDL_ISPIXELFORMAT_INDEXED")]
+ public bool is_indexed ();
+
+ [CCode (cname = "SDL_ISPIXELFORMAT_ALPHA")]
+ public bool is_alpha ();
+
}// PixelFormat
-
- [CCode (cname="SDL_BlendMode", cprefix="SDL_BLENDMODE_")]
+
+ [CCode (cname = "SDL_BlendMode", cprefix = "SDL_BLENDMODE_")]
public enum BlendMode {
NONE, BLEND, ADD, MOD
}// BlendMode
-
- [CCode (cname="SDL_Point", cheader_filename="SDL2/SDL_rect.h")]
+
+ [CCode (cname = "SDL_Point", cheader_filename = "SDL2/SDL_rect.h")]
[SimpleType]
public struct Point {
public int x;
public int y;
}// Point
-
- [CCode (cname="SDL_BlitMap")]
+
+ [CCode (cname = "SDL_BlitMap")]
[SimpleType]
public struct BlitMap {
// Private type, content should not be added
}// BlitMap
-
- [CCode (cname="SDL_Color", cheader_filename="SDL2/SDL_pixels.h")]
+
+ [CCode (cname = "SDL_Color", cheader_filename = "SDL2/SDL_pixels.h")]
[SimpleType]
public struct Color {
public uint8 r;
@@ -1330,77 +1644,76 @@ namespace SDL {
public uint8 b;
public uint8 a;
} // Color
-
- [CCode (cheader_filename="SDL2/SDL_rect.h", cname="SDL_Rect", has_type_id=false)]
+
+ [CCode (cheader_filename = "SDL2/SDL_rect.h", cname = "SDL_Rect", has_type_id = false)]
public struct Rect {
public int x;
public int y;
public uint w;
public uint h;
-
- public bool is_empty(){
- return(this.w<=0 || this.h<=0);
- }
-
- [CCode (cname="SDL_RectEquals")]
- public bool is_equal(Video.Rect other_rect);
-
- public bool contains (Video.Point p) {
- return p.x >= this.x && p.y >= this.y &&
- p.x < this.x + this.w && p.y < this.y + this.h;
+
+ public bool is_empty () {
+ return (this.w<=0 || this.h<=0);
}
- [CCode (cname="SDL_HasIntersection")]
- public bool is_intersecting(Video.Rect other_rect);
-
- [CCode (cname="SDL_IntersectRect")]
- public bool intersection_rect(Video.Rect other_rect, out Video.Rect result);
-
- [CCode (cname="SDL_UnionRect")]
- public void union_rect(Video.Rect other_rect, out Video.Rect result);
-
- [CCode (cname="SDL_EnclosePoints")]
- public bool enclose_points(int count, Video.Rect clip, out Video.Rect result);
-
- [CCode (cname="SDL_IntersectRectAndLine")]
- public bool intersects_withline(out int x1, out int y1, out int x2, out int y2);
+
+ [CCode (cname = "SDL_RectEquals")]
+ public bool is_equal (Video.Rect other_rect);
+
+ [Version (since = "2.0.4")]
+ [CCode (cname = "SDL_PointInRect", instance_pos = 1)]
+ public bool contains_point (Video.Point p);
+ [CCode (cname = "SDL_HasIntersection")]
+ public bool is_intersecting (Video.Rect other_rect);
+
+ [CCode (cname = "SDL_IntersectRect")]
+ public bool intersection_rect (Video.Rect other_rect, out Video.Rect result);
+
+ [CCode (cname = "SDL_UnionRect")]
+ public void union_rect (Video.Rect other_rect, out Video.Rect result);
+
+ [CCode (cname = "SDL_EnclosePoints")]
+ public bool enclose_points (int count, Video.Rect clip, out Video.Rect result);
+
+ [CCode (cname = "SDL_IntersectRectAndLine")]
+ public bool intersects_withline (out int x1, out int y1, out int x2, out int y2);
}// Rect
-
-
-
- [CCode (type_id="SDL_Palette", cname="SDL_Palette", cheader_filename="SDL2/SDL_pixels.h",
cprefix="SDL_", free_function="SDL_FreePalette", ref_function = "SDL_Palette_up", unref_function =
"SDL_FreePalette")]
+
+
+
+ [CCode (type_id = "SDL_Palette", cname = "SDL_Palette", cheader_filename =
"SDL2/SDL_pixels.h", cprefix = "SDL_", free_function = "SDL_FreePalette", ref_function = "SDL_Palette_up",
unref_function = "SDL_FreePalette")]
public class Palette {
[CCode (array_length_cexpr = "ncolors", array_length_type = "int")]
public Video.Color[] colors;
public uint32 version;
public int refcount;
public unowned Palette up () {
- GLib.AtomicInt.inc(ref this.refcount);
+ GLib.AtomicInt.inc (ref this.refcount);
return this;
}
-
- [CCode (cname="SDL_AllocPalette")]
- public Palette(int colors_num);
-
- [CCode (cname="SDL_SetPaletteColors", array_length_pos=2.1)]
- public int set_colors(Video.Color[] colors, int first_color);
+
+ [CCode (cname = "SDL_AllocPalette")]
+ public Palette (int colors_num);
+
+ [CCode (cname = "SDL_SetPaletteColors", array_length_pos = 2.1)]
+ public int set_colors (Video.Color[] colors, int first_color);
}
-
- [CCode (type_id="SDL_PixelFormat", cname="SDL_PixelFormat", cheader_filename="SDL2/SDL_
pixels.h", cprefix="SDL_", free_function="SDL_FreeFormat", ref_function = "SDL_PixelFormat_up",
unref_function = "SDL_FreeFormat")]
+
+ [CCode (type_id = "SDL_PixelFormat", cname = "SDL_PixelFormat", cheader_filename =
"SDL2/SDL_pixels.h", cprefix = "SDL_", free_function = "SDL_FreeFormat", ref_function = "SDL_PixelFormat_up",
unref_function = "SDL_FreeFormat")]
public class PixelFormat {
public Video.PixelRAWFormat format;
public Video.Palette palette;
- [CCode ( cname="BitsPerPixel")]
+ [CCode (cname = "BitsPerPixel")]
public uint8 bits_per_pixel;
- [CCode ( cname="BytesPerPixel")]
+ [CCode (cname = "BytesPerPixel")]
public uint8 bytes_per_pixel;
//public uint8 padding[2]; Is this even useful? We are binding a Struct, not
recreating one
- [CCode ( cname="Rmask")]
+ [CCode (cname = "Rmask")]
public uint32 r_mask;
- [CCode ( cname="Gmask")]
+ [CCode (cname = "Gmask")]
public uint32 g_mask;
- [CCode ( cname="Bmask")]
+ [CCode (cname = "Bmask")]
public uint32 b_mask;
- [CCode ( cname="Amask")]
+ [CCode (cname = "Amask")]
public uint32 a_mask;
public uint8 r_loss;
public uint8 g_loss;
@@ -1410,53 +1723,53 @@ namespace SDL {
public uint8 g_shift;
public uint8 b_shift;
public uint8 a_shift;
-
+
public int refcount;
public Video.PixelFormat next;
-
+
public unowned PixelFormat up () {
- GLib.AtomicInt.inc(ref this.refcount);
+ GLib.AtomicInt.inc (ref this.refcount);
return this;
}
-
- [CCode (cname="SDL_AllocFormat")]
- public PixelFormat(uint32 pixel_format);
-
- [CCode (cname="SDL_SetPixelFormatPalette")]
- public int set_palette(Video.Palette palette);
-
- [CCode (cname="SDL_MapRGB")]
- public uint32 map_rgb(uint8 r, uint8 g, uint8 b);
-
- [CCode (cname="SDL_MapRGBA")]
- public uint32 map_rgba(uint8 r, uint8 g, uint8 b, uint8 a);
-
- [CCode (cname="SDL_GetRGB", instance_pos=1.2)]
- public void get_rgb(uint32 pixel, ref uint8 r, ref uint8 g, ref uint8 b);
-
- [CCode (cname="SDL_GetRGBA", instance_pos=1.2)]
- public void get_rgba(uint32 pixel, ref uint8 r, ref uint8 g, ref uint8 b, ref uint8
a);
-
- [CCode (cname="SDL_CalculateGammaRamp")]
- public static void calc_gamma_ramp(float gamma, out uint16 ramp);
-
- [CCode (cname="SDL_GetPixelFormatName")]
- public static unowned string? get_pixelformatname(Video.PixelRAWFormat format);
-
- [CCode (cname="SDL_PixelFormatEnumToMasks")]
- public static bool enum_tomasks(Video.PixelRAWFormat format,
+
+ [CCode (cname = "SDL_AllocFormat")]
+ public PixelFormat (uint32 pixel_format);
+
+ [CCode (cname = "SDL_SetPixelFormatPalette")]
+ public int set_palette (Video.Palette palette);
+
+ [CCode (cname = "SDL_MapRGB")]
+ public uint32 map_rgb (uint8 r, uint8 g, uint8 b);
+
+ [CCode (cname = "SDL_MapRGBA")]
+ public uint32 map_rgba (uint8 r, uint8 g, uint8 b, uint8 a);
+
+ [CCode (cname = "SDL_GetRGB", instance_pos = 1.2)]
+ public void get_rgb (uint32 pixel, ref uint8 r, ref uint8 g, ref uint8 b);
+
+ [CCode (cname = "SDL_GetRGBA", instance_pos = 1.2)]
+ public void get_rgba (uint32 pixel, ref uint8 r, ref uint8 g, ref uint8 b, ref uint8
a);
+
+ [CCode (cname = "SDL_CalculateGammaRamp")]
+ public static void calc_gamma_ramp (float gamma, out uint16 ramp);
+
+ [CCode (cname = "SDL_GetPixelFormatName")]
+ public static unowned string? get_pixelformatname (Video.PixelRAWFormat format);
+
+ [CCode (cname = "SDL_PixelFormatEnumToMasks")]
+ public static bool enum_tomasks (Video.PixelRAWFormat format,
out int bpp, out uint32 r_mask, out uint32 g_mask, out uint32 b_mask, out
uint32 a_mask);
-
- [CCode (cname="SDL_MasksToPixelFormatEnum")]
- public static uint32 masks_toenum(
+
+ [CCode (cname = "SDL_MasksToPixelFormatEnum")]
+ public static uint32 masks_toenum (
int bpp, uint32 r_mask, uint32 g_mask, uint32 b_mask, uint32 a_mask);
}// PixelFormat
-
- [CCode (cname="SDL_blit", cheader_filename="SDL2/SDL_surface.h")]
+
+ [CCode (cname = "SDL_blit", cheader_filename = "SDL2/SDL_surface.h")]
public delegate int BlitFunc (Video.Surface src, Video.Rect? srcrect,
Video.Surface dst, Video.Rect? dstrect);
-
- [CCode (type_id="SDL_Surface", cname="SDL_Surface", ref_function="SDL_Surface_up",
unref_function="SDL_FreeSurface", cheader_filename="SDL2/SDL_surface.h")]
+
+ [CCode (type_id = "SDL_Surface", cname = "SDL_Surface", ref_function = "SDL_Surface_up",
unref_function = "SDL_FreeSurface", cheader_filename = "SDL2/SDL_surface.h")]
[Compact]
public class Surface {
public uint32 flags;
@@ -1464,632 +1777,868 @@ namespace SDL {
public int w;
public int h;
public int pitch;
- public void *pixels;
- public void *userdata; //maybe this could be binded as Simple Generics?
+ public void* pixels;
+ public void* userdata; //maybe this could be binded as Simple Generics?
public int locked;
- public void *lock_data;
+ public void* lock_data;
public Video.Rect clip_rect;
public Video.BlitMap map;
public int refcount;
-
+
public unowned Surface up () {
- GLib.AtomicInt.inc(ref this.refcount);
+ GLib.AtomicInt.inc (ref this.refcount);
return this;
}
-
- [CCode (cname="SDL_CreateRGBSurface")]
- public Surface.rgb(uint32 flags, int width, int height, int depth,
+
+ [CCode (cname = "SDL_CreateRGBSurface")]
+ public Surface.rgb (uint32 flags, int width, int height, int depth,
uint32 rmask, uint32 gmask, uint32 bmask, uint32 amask);
-
- [CCode (cname="SDL_CreateRGBSurfaceFrom")]
- public Surface.from_rgb(void* pixels, int width, int height, int depth,
+
+ [CCode (cname = "SDL_CreateRGBSurfaceFrom")]
+ public Surface.from_rgb (void* pixels, int width, int height, int depth,
int pitch, uint32 rmask, uint32 gmask, uint32 bmask, uint32 amask);
-
- [CCode (cname="SDL_LoadBMP_RW")]
- public Surface.from_bmp_rw(SDL.RWops src, int freesrc=0);
-
- [CCode (cname="SDL_LoadBMP")]
- public Surface.from_bmp(string file);
-
- [CCode (cname="SDL_SetSurfacePalette")]
+
+ [CCode (cname = "SDL_LoadBMP_RW")]
+ public Surface.from_bmp_rw (SDL.RWops src, int freesrc = 0);
+
+ [CCode (cname = "SDL_LoadBMP")]
+ public Surface.from_bmp (string file);
+
+ [CCode (cname = "SDL_SetSurfacePalette")]
public int set_palette (Video.Palette palette);
-
- [CCode(cname= "SDL_MUSTLOCK")]
- public bool must_lock();
-
- [CCode (cname="SDL_LockSurface")]
- public int do_lock();
-
- [CCode (cname="SDL_UnlockSurface")]
- public void unlock();
-
- [CCode (cname="SDL_SaveBMP_RW")]
- public int save_bmp_rw(RWops dst, int freedst=0);
-
- public int save_bmp(string file){
- return save_bmp_rw(new SDL.RWops.from_file(file, "wb"), 1);
+
+ [CCode (cname= "SDL_MUSTLOCK")]
+ public bool must_lock ();
+
+ [CCode (cname = "SDL_LockSurface")]
+ public int do_lock ();
+
+ [CCode (cname = "SDL_UnlockSurface")]
+ public void unlock ();
+
+ [CCode (cname = "SDL_SaveBMP_RW")]
+ public int save_bmp_rw (RWops dst, int freedst = 0);
+
+ public int save_bmp (string file) {
+ return save_bmp_rw (new SDL.RWops.from_file (file, "wb"), 1);
}
- [CCode (cname="SDL_SetSurfaceRLE")]
- public int set_rle(int flag);
-
- [CCode (cname="SDL_SetColorKey")]
- public int set_colorkey(int flag, uint32 key);
-
- [CCode (cname="SDL_GetColorKey")]
- public int get_colorkey(out uint32 key);
-
- [CCode (cname="SDL_SetSurfaceColorMod")]
- public int set_colormod(uint8 r, uint8 g, uint8 b);
-
- [CCode (cname="SDL_GetSurfaceColorMod")]
- public int get_colormod(out uint8 r, out int8 g, out uint8 b);
-
- [CCode (cname="SDL_SetSurfaceAlphaMod")]
- public int set_alphamod(uint8 alpha);
-
- [CCode (cname="SDL_GetSurfaceAlphaMod")]
- public int get_alphamod(out uint8 alpha);
-
- [CCode (cname="SDL_SetSurfaceBlendMode")]
- public int set_blendmode(Video.BlendMode blend_mode);
-
- [CCode (cname="SDL_GetSurfaceBlendMode")]
- public int get_blendmode(out Video.BlendMode blend_mode);
-
- [CCode (cname="SDL_SetClipRect")]
- public bool set_cliprect(Video.Rect? rect);
-
- [CCode (cname="SDL_GetClipRect")]
- public int get_cliprect(out Video.Rect rect);
-
- [CCode (cname="SDL_ConvertSurface")]
- public Surface? convert(Video.PixelFormat? fmt, uint32 flags);
-
- [CCode (cname="SDL_ConvertSurfaceFormat")]
- public Surface? convert_format(uint32 pixel_fmt, uint32 flags);
-
- [CCode (cname="SDL_ConvertPixels")]
- public static int convert_pixels(int width, int height, Video.PixelRAWFormat
src_format, void *src, int src_pitch, Video.PixelRAWFormat dst_format, void * dst, int dst_pitch);
-
- [CCode (cname="SDL_FillRect")]
- public int fill_rect(Video.Rect? rect, uint32 color);
-
- [CCode (cname="SDL_FillRects")]
- public int fill_rects(Video.Rect[] rects, uint32 color);
-
- [CCode (cname="SDL_BlitSurface")]
- public int blit(Video.Rect? srcrect, Video.Surface dst, Video.Rect? dstrect);
-
- [CCode (cname="SDL_LowerBlit")]
- public int lowerblit(Video.Rect? srcrect, Video.Surface dst, Video.Rect? dstrect);
-
- [CCode (cname="SDL_BlitScaled")]
- public int blit_scaled(Video.Rect? srcrect, Video.Surface dst, Video.Rect? dstrect);
-
- [CCode (cname="SDL_LowerBlitScaled")]
- public int lowerblit_scaled(Video.Rect? srcrect, Video.Surface dst, Video.Rect?
dstrect);
-
- [CCode (cname="SDL_SoftStretch")]
- public int softstretch(Video.Rect? srcrect, Video.Surface dst, Video.Rect? dstrect);
+ [CCode (cname = "SDL_SetSurfaceRLE")]
+ public int set_rle (int flag);
+
+ [CCode (cname = "SDL_SetColorKey")]
+ public int set_colorkey (int flag, uint32 key);
+
+ [CCode (cname = "SDL_GetColorKey")]
+ public int get_colorkey (out uint32 key);
+
+ [CCode (cname = "SDL_SetSurfaceColorMod")]
+ public int set_colormod (uint8 r, uint8 g, uint8 b);
+
+ [CCode (cname = "SDL_GetSurfaceColorMod")]
+ public int get_colormod (out uint8 r, out int8 g, out uint8 b);
+
+ [CCode (cname = "SDL_SetSurfaceAlphaMod")]
+ public int set_alphamod (uint8 alpha);
+
+ [CCode (cname = "SDL_GetSurfaceAlphaMod")]
+ public int get_alphamod (out uint8 alpha);
+
+ [CCode (cname = "SDL_SetSurfaceBlendMode")]
+ public int set_blend_mode (Video.BlendMode blend_mode);
+
+ [CCode (cname = "SDL_GetSurfaceBlendMode")]
+ public int get_blend_mode (out Video.BlendMode blend_mode);
+
+ [CCode (cname = "SDL_SetClipRect")]
+ public bool set_cliprect (Video.Rect? rect);
+
+ [CCode (cname = "SDL_GetClipRect")]
+ public int get_cliprect (out Video.Rect rect);
+
+ [CCode (cname = "SDL_ConvertSurface")]
+ public Surface? convert (Video.PixelFormat? fmt, uint32 flags);
+
+ [CCode (cname = "SDL_ConvertSurfaceFormat")]
+ public Surface? convert_format (uint32 pixel_fmt, uint32 flags);
+
+ [CCode (cname = "SDL_ConvertPixels")]
+ public static int convert_pixels (int width, int height, Video.PixelRAWFormat
src_format, void* src, int src_pitch, Video.PixelRAWFormat dst_format, void* dst, int dst_pitch);
+
+ [CCode (cname = "SDL_FillRect")]
+ public int fill_rect (Video.Rect? rect, uint32 color);
+
+ [CCode (cname = "SDL_FillRects")]
+ public int fill_rects (Video.Rect[] rects, uint32 color);
+
+ [CCode (cname = "SDL_BlitSurface")]
+ public int blit (Video.Rect? srcrect, Video.Surface dst, Video.Rect? dstrect);
+
+ [CCode (cname = "SDL_LowerBlit")]
+ public int lowerblit (Video.Rect? srcrect, Video.Surface dst, Video.Rect? dstrect);
+
+ [CCode (cname = "SDL_BlitScaled")]
+ public int blit_scaled (Video.Rect? srcrect, Video.Surface dst, Video.Rect? dstrect);
+
+ [CCode (cname = "SDL_LowerBlitScaled")]
+ public int lowerblit_scaled (Video.Rect? srcrect, Video.Surface dst, Video.Rect?
dstrect);
+
+ [CCode (cname = "SDL_SoftStretch")]
+ public int softstretch (Video.Rect? srcrect, Video.Surface dst, Video.Rect? dstrect);
} //Surface
-
+
///
/// Render
///
- [CCode (cname="SDL_RendererFlags", cprefix="SDL_RENDERER_",
cheader_filename="SDL2/SDL_render.h")]
+ [CCode (cname = "SDL_RendererFlags", cprefix = "SDL_RENDERER_", cheader_filename =
"SDL2/SDL_render.h")]
public enum RendererFlags {
SOFTWARE, ACCELERATED,
PRESENTVSYNC, TARGETTEXTURE
}// RendererFlags
-
- [CCode (cprefix="SDL_", cname = "SDL_RendererInfo", cheader_filename="SDL2/SDL_render.h")]
+
+ [CCode (cprefix = "SDL_", cname = "SDL_RendererInfo", cheader_filename = "SDL2/SDL_render.h")]
[Compact]
public class RendererInfo {
-
- public const string name;
+
+ public const string name;
public uint32 flags;
-
- [CCode (cname="num_texture_formats")]
+
+ [CCode (cname = "num_texture_formats")]
public uint32 num_texture_formats;
-
- [CCode (cname="texture_formats")]
+
+ [CCode (cname = "texture_formats")]
public Video.PixelFormat texture_formats[16];
-
- [CCode (cname="max_texture_width")]
+
+ [CCode (cname = "max_texture_width")]
public int max_texture_width;
-
- [CCode (cname="texture_formats")]
+
+ [CCode (cname = "texture_formats")]
public int max_texture_height;
}// RendererInfo
-
- [Flags, CCode (cname="SDL_TextureAccess", cprefix="SDL_TEXTUREACCESS_",
cheader_filename="SDL2/SDL_render.h")]
+
+ [Flags, CCode (cname = "SDL_TextureAccess", cprefix = "SDL_TEXTUREACCESS_", cheader_filename
= "SDL2/SDL_render.h")]
public enum TextureAccess {
STATIC, STREAMING, TARGET
}// TextureAccess
-
- [Flags, CCode (cname="SDL_TextureModulate", cprefix="SDL_TEXTUREMODULATE_",
cheader_filename="SDL2/SDL_render.h")]
+
+ [Flags, CCode (cname = "SDL_TextureModulate", cprefix = "SDL_TEXTUREMODULATE_",
cheader_filename = "SDL2/SDL_render.h")]
public enum TextureModulate {
NONE, COLOR, ALPHA
}// TextureModulate
-
- [Flags, CCode (cname="SDL_RendererFlip", cprefix="SDL_FLIP_",
cheader_filename="SDL2/SDL_render.h")]
+
+ [Flags, CCode (cname = "SDL_RendererFlip", cprefix = "SDL_FLIP_", cheader_filename =
"SDL2/SDL_render.h")]
public enum RendererFlip {
NONE, HORIZONTAL, VERTICAL
}// RendererFlip
-
- [CCode (cprefix="SDL_", cname = "SDL_Renderer", free_function = "SDL_DestroyRenderer",
cheader_filename="SDL2/SDL_render.h")]
+
+ [CCode (cprefix = "SDL_", cname = "SDL_Renderer", free_function = "SDL_DestroyRenderer",
cheader_filename = "SDL2/SDL_render.h")]
[Compact]
public class Renderer {
- [CCode (cname="SDL_GetNumRenderDrivers")]
- public static int num_drivers();
-
- [CCode (cname="SDL_GetRenderDriverInfo")]
- public static int get_driver_info(int index, Video.RendererInfo info);
-
- [CCode (cname="SDL_CreateWindowAndRenderer")]
- public static int create_with_window(int width, int height, Video.WindowFlags
window_flags, out Video.Window window, out Video.Renderer renderer);
-
- [CCode (cname="SDL_CreateRenderer")]
- public static Renderer? create(Video.Window window, int index, uint32 flags);
-
- [CCode (cname="SDL_CreateSoftwareRenderer")]
- public static Renderer? create_from_surface(Video.Surface surface);
-
- [CCode (cname="SDL_GetRendererInfo")]
- public int get_info(out Video.RendererInfo info);
-
- [CCode (cname="SDL_RenderTargetSupported")]
- public bool is_supported();
-
- [CCode (cname="SDL_SetRenderTarget")]
- public int set_render_target(Video.Texture texture);
-
- [CCode (cname="SDL_GetRenderTarget")]
- public Video.Texture get_render_target(out Video.Texture? texture);
-
- [CCode (cname="SDL_RenderSetLogicalSize")]
- public int set_logical_size(int w, int h);
-
- [CCode (cname="SDL_RenderGetLogicalSize")]
- public void get_logical_size(out int w, out int h);
-
- [CCode (cname="SDL_RenderSetViewport")]
- public int set_viewport(Video.Rect rect);
-
- [CCode (cname="SDL_RenderGetViewport")]
- public void get_viewport(out Video.Rect rect);
-
- [CCode (cname="SDL_RenderSetScale")]
- public int set_scale(float scale_x, float scale_y);
-
- [CCode (cname="SDL_RenderGetScale")]
- public void get_scale(out float scale_x, out float scale_y);
-
- [CCode (cname="SDL_SetRenderDrawColor")]
- public int set_draw_color(uint8 r, uint8 g, uint8 b, uint8 a);
-
- [CCode (cname="SDL_GetRenderDrawColor")]
- public int get_draw_color(out uint8 r, out uint8 g, out uint8 b, out uint8 a);
-
- [CCode (cname="SDL_SetRenderDrawBlendMode")]
- public int set_draw_blend_mod(Video.BlendMode blend_mode);
-
- [CCode (cname="SDL_GetRenderDrawBlendMode")]
- public int get_draw_blend_mod(out Video.BlendMode blend_mode);
-
- [CCode (cname="SDL_RenderClear")]
- public int clear();
-
- [CCode (cname="SDL_RenderDrawPoint")]
- public int draw_point(int x, int y);
-
- [CCode (cname="SDL_RenderDrawPoints")]
- public int draw_points(Video.Point[] points);
-
- [CCode (cname="SDL_RenderDrawLine")]
- public int draw_line(int x1, int y1, int x2, int y2);
-
- [CCode (cname="SDL_RenderDrawLines")]
- public int draw_lines(Video.Point[] points);
-
- [CCode (cname="SDL_RenderDrawRect")]
- public int draw_rect(Video.Rect? rect);
-
- [CCode (cname="SDL_RenderDrawLines")]
- public int draw_rects(Video.Rect[] points, int count);
-
- [CCode (cname="SDL_RenderFillRect")]
- public int fill_rect(Video.Rect? rect);
-
- [CCode (cname="SDL_RenderFillRects")]
- public int fill_rects(Video.Rect[] points, int count);
-
- [CCode (cname="SDL_RenderCopy")]
- public int copy(Video.Texture texture, Video.Rect? srcrect, Video.Rect? dstrect);
-
- [CCode (cname="SDL_RenderCopyEx")]
- public int copyex(Video.Texture texture, Video.Rect? srcrect, Video.Rect? dstrect,
double angle, Video.Point? center, Video.RendererFlip flip);
-
- [CCode (cname="SDL_RenderReadPixels")]
- public int read_pixels(Video.Rect? rect, Video.PixelRAWFormat format, out void*
pixels, int pitch);
-
- [CCode (cname="SDL_RenderPresent")]
- public void present();
+ [CCode (cname = "SDL_GetNumRenderDrivers")]
+ public static int num_drivers ();
+
+ [CCode (cname = "SDL_GetRenderDriverInfo")]
+ public static int get_driver_info (int index, Video.RendererInfo info);
+
+ [CCode (cname = "SDL_CreateWindowAndRenderer")]
+ public static int create_with_window (int width, int height, Video.WindowFlags
window_flags, out Video.Window window, out Video.Renderer renderer);
+
+ [CCode (cname = "SDL_CreateRenderer")]
+ public static Renderer? create (Video.Window window, int index, uint32 flags);
+
+ [CCode (cname = "SDL_CreateSoftwareRenderer")]
+ public static Renderer? create_from_surface (Video.Surface surface);
+
+ [CCode (cname = "SDL_GetRendererInfo")]
+ public int get_info (out Video.RendererInfo info);
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_RenderTargetSupported")]
+ public bool is_supported ();
+
+ [Version (since = "2.0.0")]
+ public Video.Texture? render_target{
+ [CCode (cname = "SDL_GetRenderTarget")]get;
+ [CCode (cname = "SDL_SetRenderTarget")]set;
+ }
+
+ [Version (since = "2.0.4")]
+ [CCode (cname = "SDL_RenderIsClipEnabled")]
+ public bool is_clip_enabled ();
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_RenderSetLogicalSize")]
+ public int set_logical_size (int w, int h);
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_RenderGetLogicalSize")]
+ public void get_logical_size (out int w, out int h);
+
+ [CCode (cname = "SDL_RenderSetViewport")]
+ public int set_viewport (Video.Rect? rect);
+
+ [CCode (cname = "SDL_RenderGetViewport")]
+ public void get_viewport (out Video.Rect rect);
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_RenderSetScale")]
+ public int set_scale (float scale_x, float scale_y);
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_RenderGetScale")]
+ public void get_scale (out float scale_x, out float scale_y);
+
+ [Version (experimental = true)]
+ [CCode (cname = "SDL_RenderSetIntegerScale")]
+ public int set_int_scale (bool enable);
+
+ [Version (experimental = true)]
+ [CCode (cname = "SDL_RenderGetIntegerScale")]
+ public bool get_int_scale ();
+
+ [CCode (cname = "SDL_SetRenderDrawColor")]
+ public int set_draw_color (uint8 r, uint8 g, uint8 b, uint8 a);
+
+ [CCode (cname = "SDL_GetRenderDrawColor")]
+ public int get_draw_color (out uint8 r, out uint8 g, out uint8 b, out uint8 a);
+
+ [CCode (cname = "SDL_SetRenderDrawBlendMode")]
+ public int set_draw_blend_mode (Video.BlendMode blend_mode);
+
+ [CCode (cname = "SDL_GetRenderDrawBlendMode")]
+ public int get_draw_blend_mode (out Video.BlendMode blend_mode);
+
+ [CCode (cname = "SDL_RenderClear")]
+ public int clear ();
+
+ [CCode (cname = "SDL_RenderDrawPoint")]
+ public int draw_point (int x, int y);
+
+ [CCode (cname = "SDL_RenderDrawPoints")]
+ public int draw_points (Video.Point[] points);
+
+ [CCode (cname = "SDL_RenderDrawLine")]
+ public int draw_line (int x1, int y1, int x2, int y2);
+
+ [CCode (cname = "SDL_RenderDrawLines")]
+ public int draw_lines (Video.Point[] points);
+
+ [CCode (cname = "SDL_RenderDrawRect")]
+ public int draw_rect (Video.Rect? rect);
+
+ [CCode (cname = "SDL_RenderDrawLines")]
+ public int draw_rects (Video.Rect[] points, int count);
+
+ [CCode (cname = "SDL_RenderFillRect")]
+ public int fill_rect (Video.Rect? rect);
+
+ [CCode (cname = "SDL_RenderFillRects")]
+ public int fill_rects (Video.Rect[] points, int count);
+
+ [CCode (cname = "SDL_RenderCopy")]
+ public int copy (Video.Texture texture, Video.Rect? srcrect, Video.Rect? dstrect);
+
+ [CCode (cname = "SDL_RenderCopyEx")]
+ public int copyex (Video.Texture texture, Video.Rect? srcrect, Video.Rect? dstrect,
double angle, Video.Point? center, Video.RendererFlip flip);
+
+ [CCode (cname = "SDL_RenderReadPixels")]
+ public int read_pixels (Video.Rect? rect, Video.PixelRAWFormat format, out void*
pixels, int pitch);
+
+ [CCode (cname = "SDL_RenderPresent")]
+ public void present ();
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_GetRendererOutputSize")]
+ public void get_output_size (out int w, out int h);
}// Renderer
-
- [CCode (cprefix="SDL_", cname = "SDL_Texture", free_function="SDL_DestroyTexture",
cheader_filename="SDL2/SDL_render.h")]
+
+ [CCode (cprefix = "SDL_", cname = "SDL_Texture", free_function = "SDL_DestroyTexture",
cheader_filename = "SDL2/SDL_render.h")]
[Compact]
public class Texture {
- [CCode (cname="SDL_CreateTexture")]
- public static Texture? create(Video.Renderer renderer, Video.PixelRAWFormat format,
int access, int w, int h);
-
- [CCode (cname="SDL_CreateTextureFromSurface")]
- public static Texture? create_from_surface(Video.Renderer renderer, Video.Surface
surface);
-
- [CCode (cname="SDL_QueryTexture")]
- public int query(out Video.PixelRAWFormat format, out int access, out int w, out int
h);
-
- [CCode (cname="SDL_SetTextureColorMod")]
- public int set_color_mod(uint8 r, uint8 g, uint8 b);
-
- [CCode (cname="SDL_GetTextureColorMod")]
- public int get_color_mod(out uint8 r, out uint8 g, out uint8 b);
-
- [CCode (cname="SDL_SetTextureAlphaMod")]
- public int set_alpha_mod(uint8 alpha);
-
- [CCode (cname="SDL_GetTextureColorMod")]
- public int get_alpha_mod(out uint8 alpha);
-
- [CCode (cname="SDL_SetTextureBlendMode")]
- public int set_blend_mod(Video.BlendMode blend_mode);
-
- [CCode (cname="SDL_GetTextureBlendMode")]
- public int get_blend_mod(out Video.BlendMode blend_mode);
-
- [CCode (cname="SDL_UpdateTexture")]
- public int update(Video.Rect? rect, void* pixels, int pitch);
-
- [CCode (cname="SDL_LockTexture")]
- public int do_lock(Video.Rect? rect, void* pixels, int pitch);
-
- [CCode (cname="SDL_UnlockTexture")]
- public void unlock();
-
- [CCode (cname="SDL_GL_BindTexture")]
- public void gl_bind(ref float texw, ref float texh);
-
- [CCode (cname="SDL_GL_UnbindTexture")]
- public int gl_unbind();
+ [CCode (cname = "SDL_CreateTexture")]
+ public static Texture? create (Video.Renderer renderer, Video.PixelRAWFormat format,
int access, int w, int h);
+
+ [CCode (cname = "SDL_CreateTextureFromSurface")]
+ public static Texture? create_from_surface (Video.Renderer renderer, Video.Surface
surface);
+
+ [CCode (cname = "SDL_QueryTexture")]
+ public int query (out Video.PixelRAWFormat format, out int access, out int w, out int
h);
+
+ [CCode (cname = "SDL_SetTextureColorMod")]
+ public int set_color_mod (uint8 r, uint8 g, uint8 b);
+
+ [CCode (cname = "SDL_GetTextureColorMod")]
+ public int get_color_mod (out uint8 r, out uint8 g, out uint8 b);
+
+ [CCode (cname = "SDL_SetTextureAlphaMod")]
+ public int set_alpha_mod (uint8 alpha);
+
+ [CCode (cname = "SDL_GetTextureColorMod")]
+ public int get_alpha_mod (out uint8 alpha);
+
+ [CCode (cname = "SDL_SetTextureBlendMode")]
+ public int set_blend_mode (Video.BlendMode blend_mode);
+
+ [CCode (cname = "SDL_GetTextureBlendMode")]
+ public int get_blend_mode (out Video.BlendMode blend_mode);
+
+ [CCode (cname = "SDL_UpdateTexture")]
+ public int update (Video.Rect? rect, void* pixels, int pitch);
+
+ [Version (since = "2.0.1")]
+ [CCode (cname = "SDL_UpdateYUVTexture")]
+ public int update_yuv (Video.Rect? rect, uint8[] yplane, int ypitch, uint8[] uplane,
int upitch, uint8[] vplane, int vpitch);
+
+ [CCode (cname = "SDL_LockTexture")]
+ public int do_lock (Video.Rect? rect, out void* pixels, out int pitch);
+
+ [CCode (cname = "SDL_UnlockTexture")]
+ public void unlock ();
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_GL_BindTexture")]
+ public void gl_bind (ref float texw, ref float texh);
+
+ [CCode (cname = "SDL_GL_UnbindTexture")]
+ public int gl_unbind ();
}// Texture
-
-
+
+
///
/// Video
///
-
- [CCode (cname="SDL_DisplayMode", destroy_function="", cheader_filename="SDL2/SDL_video.h")]
+
+ [CCode (cname = "SDL_DisplayMode", destroy_function = "", cheader_filename =
"SDL2/SDL_video.h")]
public struct DisplayMode {
public Video.PixelRAWFormat format;
public int w;
public int h;
public int refresh_rate;
- public void *driverdata; //Please, initialize as NULL
+ public void* driverdata; //Please, initialize as NULL
}// DisplayMode
-
- [Flags, CCode (cname="SDL_WindowFlags", cprefix="SDL_WINDOW_",
cheader_filename="SDL2/SDL_video.h")]
+
+ [Version (since = "2.0.0")]
+ [Flags, CCode (cname = "SDL_WindowFlags", cprefix = "SDL_WINDOW_", cheader_filename =
"SDL2/SDL_video.h")]
public enum WindowFlags {
- FULLSCREEN, OPENGL, SHOWN, HIDDEN, BORDERLESS, RESIZABLE,
- MINIMIZED, MAXIMIZED, INPUT_GRABBED, INPUT_FOCUS, MOUSE_FOCUS,
- FULLSCREEN_DESKTOP, FOREIGN, ALLOW_HIGHDPI, MOUSE_CAPTURE
+ FULLSCREEN, FULLSCREEN_DESKTOP, OPENGL, SHOWN, HIDDEN, BORDERLESS,
+ RESIZABLE, MINIMIZED, MAXIMIZED, INPUT_GRABBED, INPUT_FOCUS, MOUSE_FOCUS,
+ FOREIGN, [Version (since = "2.0.1")] ALLOW_HIGHDPI,
+ [Version (since = "2.0.4")] MOUSE_CAPTURE
}// WindowFlags
-
- [Flags, CCode (cname="SDL_WindowEventID", cprefix="SDL_WINDOWEVENT_",
cheader_filename="SDL2/SDL_video.h")]
+
+ [Flags, CCode (cname = "SDL_WindowEventID", cprefix = "SDL_WINDOWEVENT_", cheader_filename =
"SDL2/SDL_video.h")]
public enum WindowEventID {
NONE, SHOWN, HIDDEN, EXPOSED, MOVED, RESIZED,
SIZE_CHANGED, MINIMIZED, MAXIMIZED, RESTORED,
ENTER, LEAVE, FOCUS_GAINED, FOCUS_LOST, CLOSE
}// WindowEventID
-
-
-
- [CCode (cname="SDL_GetNumVideoDrivers")]
- public static int num_drivers();
-
- [CCode (cname="SDL_GetVideoDriver")]
- public static unowned string? get_driver(int driver_index);
-
- [CCode (cname="SDL_VideoInit")]
- public static int init(string driver_name);
-
- [CCode (cname="SDL_VideoQuit")]
- public static void quit();
-
- [CCode (cname="SDL_GetCurrentVideoDriver")]
- public static unowned string? get_current_driver();
-
- [CCode (cname="SDL_GetNumVideoDisplays")]
- public static int num_displays();
-
- [CCode (cname="SDL_IsScreenSaverEnabled")]
- public static bool is_screensaver_enabled();
-
- [CCode (cname="SDL_EnableScreenSaver")]
- public static void enable_screensaver();
-
- [CCode (cname="SDL_DisableScreenSaver")]
- public static void disable_screensaver();
-
-
- [CCode (cprefix="SDL_", cheader_filename="SDL2/SDL_video.h")]
- [Compact]
- public class Display { //Considering to put it out class Video
- [CCode (cname="SDL_GetDisplayName")]
- public static unowned string? get_name(int index);
-
- [CCode (cname="SDL_GetDisplayBounds")]
- public static int get_bounds(int index, out Video.Rect rect);
-
- [CCode (cname="SDL_GetNumDisplayModes")]
- public static int num_modes(int index);
-
- [CCode (cname="SDL_GetDisplayMode")]
- public static int get_mode(int display_index, int mode_index, out Video.DisplayMode
mode);
-
- [CCode (cname="SDL_GetDesktopDisplayMode")]
- public static int get_desktop_mode(int index, out Video.DisplayMode mode);
-
- [CCode (cname="SDL_GetCurrentDisplayMode")]
- public static int get_current_mode(int index, out Video.DisplayMode mode);
-
- [CCode (cname="SDL_GetClosestDisplayMode")]
- public static Video.DisplayMode? get_closest_mode(int index, Video.DisplayMode mode,
out Video.DisplayMode closest);
+
+
+
+ [CCode (cname = "SDL_GetNumVideoDrivers")]
+ public static int num_drivers ();
+
+ [CCode (cname = "SDL_GetVideoDriver")]
+ public static unowned string? get_driver (int driver_index);
+
+ [CCode (cname = "SDL_VideoInit")]
+ public static int init (string driver_name);
+
+ [CCode (cname = "SDL_VideoQuit")]
+ public static void quit ();
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_GetCurrentVideoDriver")]
+ public static unowned string? get_current_driver ();
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_GetNumVideoDisplays")]
+ public static int num_displays ();
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_IsScreenSaverEnabled")]
+ public static bool is_screensaver_enabled ();
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_EnableScreenSaver")]
+ public static void enable_screensaver ();
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_DisableScreenSaver")]
+ public static void disable_screensaver ();
+
+
+ [CCode (cname = "int", has_type_id = false, cheader_filename = "SDL2/SDL_video.h")]
+ [SimpleType]
+ [IntegerType (rank = 6)]
+ public struct Display : int {
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_GetDisplayName")]
+ public unowned string? get_name ();
+
+ [CCode (cname = "SDL_GetDisplayBounds")]
+ public int get_bounds (out Video.Rect rect);
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_GetNumDisplayModes")]
+ public int num_modes ();
+
+ [CCode (cname = "SDL_GetDisplayMode")]
+ public int get_mode (int mode_index, out Video.DisplayMode mode);
+
+ [Version (since = "2.0.4")]
+ [CCode (cname = "SDL_GetDisplayDPI")]
+ public int get_dpi (out float ddpi, out float hdpi, out float vdpi);
+
+ [CCode (cname = "SDL_GetDesktopDisplayMode")]
+ public int get_desktop_mode (out Video.DisplayMode mode);
+
+ [CCode (cname = "SDL_GetCurrentDisplayMode")]
+ public int get_current_mode (out Video.DisplayMode mode);
+
+ [CCode (cname = "SDL_GetClosestDisplayMode")]
+ public Video.DisplayMode? get_closest_mode (Video.DisplayMode mode, out
Video.DisplayMode closest);
+
+ [Version (experimental = true)]
+ [CCode (cname = "SDL_GetDisplayUsableBounds")]
+ public int get_usable_bounds (out Video.Rect? rect);
}// Display
-
- [CCode (cname=" SDL_SYSWM_TYPE", cprefix="SDL_SYSWM_", cheader_filename="SDL2/ SDL_syswm.h")]
- public enum SysWMType{
- UNKNOWN,WINDOWS,X11,DIRECTFB,COCOA,UIKIT;
+
+ [CCode (cname = " SDL_SYSWM_TYPE", cprefix = "SDL_SYSWM_", cheader_filename =
"SDL2/SDL_syswm.h")]
+ public enum SysWMType {
+ UNKNOWN, WINDOWS, X11, DIRECTFB, COCOA, UIKIT,
+ [Version (since = "2.0.2")] WAYLAND,
+ [Version (since = "2.0.2")]MIR,
+ [Version (since = "2.0.3")]WINRT,
+ [Version (since = "2.0.4")]ANDROID
}
- [CCode (cname="SDL_SysWMmsg", cheader_filename="SDL2/SDL_syswm.h")]
+ [CCode (cname = "SDL_SysWMmsg", cheader_filename = "SDL2/SDL_syswm.h")]
public struct SysWMmsg {
- [CCode (cname="msg.dummy")]
- int msg;
- SysWMType type;
- SDL.Version version;
+ SDL.Version version;
+ SysWMType subsystem;
+ int dummy;
+
+ //if SDL_SYSWM_WINDOWS
+ [CCode (cname = "win.hwnd")]
+ void* win_hwnd;
+ [CCode (cname = "win.msg")]
+ uint win_msg;
+ [CCode (cname = "win.wParam")]
+ void* win_wparam;
+ [CCode (cname = "win.lParam")]
+ void* win_lparam;
+
+ //if SDL_SYSWM_X11
+ [CCode (cname = "x11.event")]
+ void* x11_event;
+
+ //if SDL_SYSWM_DIRECTFB
+ [CCode (cname = "dfb.event")]
+ void* dfb_event;
+
+ //if SDL_SYSWM_COCOA
+ [Version (since = "2.0.4")]
+ [CCode (cname = "cocoa.dummy")]
+ int cocoa_dummy;
+
+ //if SDL_SYSWM_UIKIT
+ [Version (since = "2.0.4")]
+ [CCode (cname = "uikit.dummy")]
+ int uikit_dummy;
}// SysWMmsg
-
- [CCode (cname="SDL_SysWMinfo", cheader_filename="SDL2/SDL_syswm.h")]
+
+ /**
+ * Remember to always check the {@link SysWMType} before accesing any field
+ */
+ [CCode (cname = "SDL_SysWMinfo", cheader_filename = "SDL2/SDL_syswm.h")]
public struct SysWMInfo {
- [CCode (cname="info.dummy")]
- int info;
- SysWMType type;
- SDL.Version version;
+ SDL.Version version;
+ SysWMType subsystem;
+ int dummy;
+
+ //if SDL_SYSWM_WINDOWS
+
+ /*the window handle*/
+ [CCode (cname = "win.window")]
+ void* win_window;
+ [Version (since = "2.0.4")]
+ [CCode (cname = "win.hdc")]
+ void* win_hdc;
+
+ //if SDL_SYSWM_WINRT (>= SDL 2.0.3)
+
+ /*the WinRT CoreWindow*/
+ [Version (since = "2.0.3")]
+ [CCode (cname= "win.window")]
+ void* winrt_window;
+
+ //if SDL_SYSWM_X11
+
+ /*the X11 display*/
+ [CCode (cname ="x11.display")]
+ void* x11_display;
+
+ /*the X11 window*/
+ [CCode (cname = "x11.window")]
+ void* x11_window;
+
+ //if SDL_SYSWM_DIRECTFB
+
+ /*the DirectFB main interface*/
+ [CCode (cname = "dfb.dfb")]
+ void* dfb_dfb;
+
+ /*the DirectFB window handle*/
+ [CCode (cname = "dfb.window")]
+ void* dfb_window;
+
+ /*the DirectFB client surface*/
+ [CCode (cname ="dfb.surface")]
+ void* dfb_surface;
+
+ //if SDL_SYSWM_COCOA
+
+ /*the Cocoa window*/
+ [CCode (cname = "cocoa.window")]
+ void* cocoa_window;
+
+ //if SDL_SYSWM_UIKIT
+
+ /*the UIKit window*/
+ [CCode (cname = "uikit.window")]
+ void* uikit_window;
+
+ /*the GL view's Framebuffer Object; it must be bound when rendering to the screen
using GL (>= SDL 2.0.4)*/
+ [Version (since = "2.0.4")]
+ [CCode (cname = "uikit.framebuffer")]
+ uint uikit_framebuffer;
+
+ /**
+ *the GL view's color Renderbuffer Object; it must be bound when {@link
SDL.GL.swap_window} is called (>= SDL 2.0.4)*/
+ [Version (since = "2.0.4")]
+ [CCode (cname = "uikit.colorbuffer")]
+ uint uikit_colorbuffer;
+
+ /*the Framebuffer Object which holds the resolve color Renderbuffer, when MSAA is
used (>= SDL 2.0.4)*/
+ [Version (since = "2.0.4")]
+ [CCode (cname = "uikit.resolveFramebuffer")]
+ uint uikit_resolve_framebuffer;
+
+ //if SDL_SYSWM_WAYLAND (>= SDL 2.0.2)
+
+ /*the Wayland display*/
+ [Version (since = "2.0.2")]
+ [CCode (cname = "wl.display")]
+ void* wl_display;
+
+ /*the Wayland surface*/
+ [Version (since = "2.0.2")]
+ [CCode (cname = "wl.surface")]
+ void* wl_surface;
+
+ /*the Wayland shell_surface (window manager handle)*/
+ [Version (since = "2.0.2")]
+ [CCode (cname = "wl.shell_surface")]
+ void* wl_shell_surface;
+
+ //if SDL_SYSWM_MIR (>= SDL 2.0.2)
+
+ /*the Mir display server connection*/
+ [Version (since = "2.0.2")]
+ [CCode (cname = "mir.connection")]
+ void* mir_connection;
+
+ /*the Mir surface*/
+ [Version (since = "2.0.2")]
+ [CCode (cname = "mir.surface")]
+ void* mir_surface;
+
+ //if SDL_SYSWM_ANDROID (>= SDL 2.0.4)
+
+ /*the Android native window*/
+ [Version (since = "2.0.4")]
+ [CCode (cname = "android.window")]
+ void* android_window;
+
+ /*the Android EGL surface*/
+ [Version (since = "2.0.4")]
+ [CCode (cname = "android.surface")]
+ void* android_surface;
}// SysWMmsg
-
- [CCode (cname=" SDL_HitTestResult", cprefix="SDL_HITTEST_",
cheader_filename="SDL2/SDL_video.h")]
- public enum HitTestResult{
- NORMAL, DRAGGABLE, RESIZE_TOPLEFT, RESIZE_TOP, RESIZE_TOPRIGHT,
+
+ [Version (since = "2.0.4")]
+ [CCode (cname = " SDL_HitTestResult", cprefix = "SDL_HITTEST_", cheader_filename =
"SDL2/SDL_video.h")]
+ public enum HitTestResult {
+ NORMAL, DRAGGABLE, RESIZE_TOPLEFT, RESIZE_TOP, RESIZE_TOPRIGHT,
RESIZE_RIGHT, RESIZE_BOTTOMRIGHT, RESIZE_BOTTOM, RESIZE_BOTTOMLEFT,
RESIZE_LEFT;
}
-
+
[CCode (cname = "SDL_HitTest", has_target= true, delegate_target_pos = 1.1)]
- public delegate HitTestResult HitTestFunc(Video.Window window, Video.Point area);
-
-
- [CCode (cprefix="SDL_", cname = "SDL_Window", free_function = "SDL_DestroyWindow",
cheader_filename="SDL2/SDL_video.h")]
+ public delegate HitTestResult HitTestFunc (Video.Window window, Video.Point area);
+
+
+ [CCode (cprefix = "SDL_", cname = "SDL_Window", free_function = "SDL_DestroyWindow",
cheader_filename = "SDL2/SDL_video.h")]
[Compact]
public class Window {
- [CCode (cname="SDL_WINDOWPOS_UNDEFINED_MASK")]
+ [CCode (cname = "SDL_WINDOWPOS_UNDEFINED_MASK")]
public static const uint8 POS_UNDEFINED;
-
- [CCode (cname="SDL_WINDOWPOS_CENTERED_MASK")]
+
+ [CCode (cname = "SDL_WINDOWPOS_CENTERED_MASK")]
public static const uint8 POS_CENTERED;
-
- [CCode (cname="SDL_CreateWindow")]
- public Window(string title, int x, int y, int w, int h, uint32 flags);
-
+
+ [Version (since = "2.0.4")]
+ [CCode (cname = "SDL_GetGrabbedWindow")]
+ public static Window? get_grabbed ();
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_CreateWindow")]
+ public Window (string title, int x, int y, int w, int h, uint32 flags);
+
// Param data is a "pointer to driver-dependent window creation data"
- [CCode (cname="SDL_CreateWindowFrom")]
- public Window.from_native(void *data);
-
- [CCode (cname="SDL_GetWindowFromID")]
- public Window.from_id(uint32 id);
-
- [CCode (cname="SDL_GetWindowDisplayIndex")]
- public int get_display();
-
- [CCode (cname="SDL_SetWindowDisplayMode")]
- public int set_display_mode(Video.DisplayMode mode);
-
- [CCode (cname="SDL_GetWindowDisplayMode")]
- public int get_display_mode(out Video.DisplayMode mode);
-
- [CCode (cname="SDL_SetWindowHitTest")]
- public int set_hit_test(HitTestFunc callback);
-
- [CCode (cname="SDL_GetWindowPixelFormat")]
- public Video.PixelRAWFormat get_pixelformat();
-
- [CCode (cname="SDL_GetWindowID")]
- public uint32 get_id();
-
- [CCode (cname="SDL_GetWindowFlags")]
- public uint32 get_flags();
-
- public string title{
- [CCode (cname="SDL_GetWindowTitle")]get;
- [CCode (cname="SDL_SetWindowTitle")]set;
+ [CCode (cname = "SDL_CreateWindowFrom")]
+ public Window.from_native (void* data);
+
+ [CCode (cname = "SDL_GetWindowFromID")]
+ public Window.from_id (uint32 id);
+
+ [CCode (cname = "SDL_GetWindowDisplayIndex")]
+ public int get_display ();
+
+ [CCode (cname = "SDL_SetWindowDisplayMode")]
+ public int set_display_mode (Video.DisplayMode mode);
+
+ [CCode (cname = "SDL_GetWindowDisplayMode")]
+ public int get_display_mode (out Video.DisplayMode mode);
+
+ [Version (since = "2.0.4")]
+ [CCode (cname = "SDL_SetWindowHitTest")]
+ public int set_hit_test (HitTestFunc callback);
+
+
+ [CCode (cname = "SDL_GetWindowPixelFormat")]
+ public Video.PixelRAWFormat get_pixelformat ();
+
+ [CCode (cname = "SDL_GetWindowID")]
+ public uint32 get_id ();
+
+ [CCode (cname = "SDL_GetWindowFlags")]
+ public uint32 get_flags ();
+
+ public string title {
+ [CCode (cname = "SDL_GetWindowTitle")]get;
+ [CCode (cname = "SDL_SetWindowTitle")]set;
}
-
- [CCode (cname="SDL_SetWindowIcon")]
- public void set_icon(Video.Surface icon);
-
+
+ [CCode (cname = "SDL_SetWindowIcon")]
+ public void set_icon (Video.Surface icon);
+
//Maybe this can be binded as a Simple Generics?
- [CCode (cname="SDL_SetWindowData", sinple_generics = true)]
- public void set_data<T>(string key, owned T data);
-
- [CCode (cname="SDL_GetWindowData", simple_generics = true)]
- public unowned T get_data<T>(string key);
-
- [CCode (cname="SDL_SetWindowPosition")]
- public void set_position(int x, int y);
-
- [CCode (cname="SDL_GetWindowPosition")]
- public void get_position(out int x, out int y); //TODO: create a beautilful method
-
- [CCode (cname="SDL_SetWindowSize")]
- public void set_size(int w, int h);
-
- [CCode (cname="SDL_GetWindowSize")]
- public void get_size(out int w, out int x); //TODO: create a beautilful method
-
- [CCode (cname="SDL_SetWindowMinimumSize")]
- public void set_minsize(int w, int h);
-
- [CCode (cname="SDL_GetWindowMinimumSize")]
- public void get_minsize(out int w, out int x); //TODO: create a beautilful method
-
- [CCode (cname="SDL_SetWindowMaximumSize")]
- public void set_maxsize(int w, int h);
-
- [CCode (cname="SDL_GetWindowMaximumSize")]
- public void get_maxsize(out int w, out int x); //TODO: create a beautilful method
-
- [CCode (cname="SDL_SetWindowBordered")]
- public void set_bordered(bool bordered);
-
- [CCode (cname="SDL_ShowWindow")]
- public void show();
-
- [CCode (cname="SDL_HideWindow")]
- public void hide();
-
- [CCode (cname="SDL_RaiseWindow")]
- public void raise();
-
- [CCode (cname="SDL_MaximizeWindow")]
- public void maximize();
-
- [CCode (cname="SDL_MinimizeWindow")]
- public void minimize();
-
- [CCode (cname="SDL_RestoreWindow")]
- public void restore();
-
- [CCode (cname="SDL_SetWindowFullscreen")]
- public int set_fullscreen(uint32 flags);
-
- [CCode (cname="SDL_GetWindowSurface")]
- public Video.Surface get_surface();
-
- [CCode (cname="SDL_UpdateWindowSurface")]
- public int update_surface();
-
- [CCode (cname="SDL_UpdateWindowSurfaceRects")]
- public int update_surface_rects(Video.Rect[] rects);
-
- public bool grab{
- [CCode (cname="SDL_GetWindowGrab")]get;
- [CCode (cname="SDL_SetWindowGrab")]set;
+ [CCode (cname = "SDL_SetWindowData", sinple_generics = true)]
+ public void set_data<T> (string key, owned T data);
+
+ [CCode (cname = "SDL_GetWindowData", simple_generics = true)]
+ public unowned T get_data<T> (string key);
+
+ [CCode (cname = "SDL_SetWindowPosition")]
+ public void set_position (int x, int y);
+
+ [CCode (cname = "SDL_GetWindowPosition")]
+ public void get_position (out int x, out int y); //TODO: create a beautilful method
+
+ [CCode (cname = "SDL_SetWindowSize")]
+ public void set_size (int w, int h);
+
+ [CCode (cname = "SDL_GetWindowSize")]
+ public void get_size (out int w, out int x); //TODO: create a beautilful method
+
+ [CCode (cname = "SDL_SetWindowMinimumSize")]
+ public void set_minsize (int w, int h);
+
+ [CCode (cname = "SDL_GetWindowMinimumSize")]
+ public void get_minsize (out int w, out int x); //TODO: create a beautilful method
+
+ [CCode (cname = "SDL_SetWindowMaximumSize")]
+ public void set_maxsize (int w, int h);
+
+ [CCode (cname = "SDL_GetWindowMaximumSize")]
+ public void get_maxsize (out int w, out int x); //TODO: create a beautilful method
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_SetWindowBordered")]
+ public void set_bordered (bool bordered);
+
+ [CCode (cname = "SDL_ShowWindow")]
+ public void show ();
+
+ [CCode (cname = "SDL_HideWindow")]
+ public void hide ();
+
+ [CCode (cname = "SDL_RaiseWindow")]
+ public void raise ();
+
+ [CCode (cname = "SDL_MaximizeWindow")]
+ public void maximize ();
+
+ [CCode (cname = "SDL_MinimizeWindow")]
+ public void minimize ();
+
+ [CCode (cname = "SDL_RestoreWindow")]
+ public void restore ();
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_SetWindowFullscreen")]
+ public int set_fullscreen (uint32 flags);
+
+ [CCode (cname = "SDL_GetWindowSurface")]
+ public Video.Surface get_surface ();
+
+ [CCode (cname = "SDL_UpdateWindowSurface")]
+ public int update_surface ();
+
+ [CCode (cname = "SDL_UpdateWindowSurfaceRects")]
+ public int update_surface_rects (Video.Rect[] rects);
+
+ public bool grab {
+ [CCode (cname = "SDL_GetWindowGrab")]get;
+ [CCode (cname = "SDL_SetWindowGrab")]set;
}
-
- [CCode (cname="SDL_SetWindowBrightness")]
- public int set_brightness(float brightness);
-
- [CCode (cname="SDL_GetWindowBrightness")]
- public float get_brightness();
-
- [CCode (cname="SDL_SetWindowGammaRamp")]
- public int set_gammaramp(uint16[]? red, uint16[]? green, uint16[]? blue);
-
- [CCode (cname="SDL_GetWindowGammaRamp")]
- public int get_gammaramp(out uint16[]? red,out uint16[]? green, out uint16[]? blue);
-
- [CCode (cname="SDL_GetWindowWMInfo", cheader_filename="SDL2/SDL_syswm.h")]
- public bool get_wm_info(out Video.SysWMInfo info);
-
- [CCode (cname="SDL_DestroyWindow")]
- public void destroy();
+
+ [CCode (cname = "SDL_SetWindowBrightness")]
+ public int set_brightness (float brightness);
+
+ [CCode (cname = "SDL_GetWindowBrightness")]
+ public float get_brightness ();
+
+ [CCode (cname = "SDL_SetWindowGammaRamp")]
+ public int set_gammaramp (uint16[]? red, uint16[]? green, uint16[]? blue);
+
+ [CCode (cname = "SDL_GetWindowGammaRamp")]
+ public int get_gammaramp (out uint16[]? red, out uint16[]? green, out uint16[]? blue);
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_GetWindowWMInfo", cheader_filename = "SDL2/SDL_syswm.h")]
+ public bool get_wm_info (out Video.SysWMInfo info);
+
+ [Version (since = "2.0.1")]
+ [CCode (cname = "SDL_GL_GetDrawableSize")]
+ public void get_gl_drawable_size (out int? w, out int? h);
+
+ [Version (experimental = true)]
+ [CCode (cname = "SDL_GetWindowBorderSize")]
+ public int get_border_size (out int? top, out int? left, out int? bottom, out int?
right);
+
+ [Version (experimental = true)]
+ [CCode (cname = "SDL_SetWindowOpacity")]
+ public int set_opacity (float opacity);
+
+ [Version (experimental = true)]
+ [CCode (cname = "SDL_GetWindowOpacity")]
+ public int get_opacity (out float? opacity);
+
+ [Version (experimental = true)]
+ [CCode (cname = "SDL_SetWindowInputFocus")]
+ public int set_input_focus ();
+
+ [Version (experimental = true)]
+ [CCode (cname = "SDL_SetWindowModalFor")]
+ public int set_modal (Video.Window parent);
+
+ [CCode (cname = "SDL_DestroyWindow")]
+ public void destroy ();
}//Window
-
+
///
/// OpenGL
///
- [CCode (cprefix="SDL_GL_", cheader_filename="SDL2/SDL_video.h")]
+ [CCode (cprefix = "SDL_GL_", cheader_filename = "SDL2/SDL_video.h")]
namespace GL {
-
- [CCode (type_id="SDL_GLContext", cname="SDL_GLContext",
free_function="SDL_GL_DeleteContext", cheader_filename="SDL2/SDL_video.h")]
+
+ [CCode (type_id = "SDL_GLContext", cname = "SDL_GLContext", free_function =
"SDL_GL_DeleteContext", cheader_filename = "SDL2/SDL_video.h")]
[Compact]
- public class Context{
- [CCode (cname="SDL_GL_CreateContext")]
- public static Context? create(Video.Window window);
+ public class Context {
+ [CCode (cname = "SDL_GL_CreateContext")]
+ public static Context? create (Video.Window window);
}// GLContext
-
- [CCode (cname="SDL_GLattr", cprefix="SDL_GL_", cheader_filename="SDL2/SDL_video.h")]
- public enum Attributes{
- RED_SIZE, GREEN_SIZE, BLUE_SIZE, ALPHA_SIZE,
- BUFFER_SIZE, DOUBLEBUFFER, DEPTH_SIZE, STENCIL_SIZE,
- ACCUM_RED_SIZE, ACCUM_GREEN_SIZE, ACCUM_BLUE_SIZE,
- ACCUM_ALPHA_SIZE, STEREO, MULTISAMPLEBUFFERS,
- MULTISAMPLESAMPLES, ACCELERATED_VISUAL, RETAINED_BACKING,
+
+ [CCode (cname = "SDL_GLattr", cprefix = "SDL_GL_", cheader_filename =
"SDL2/SDL_video.h")]
+ public enum Attributes {
+ RED_SIZE, GREEN_SIZE, BLUE_SIZE, ALPHA_SIZE,
+ BUFFER_SIZE, DOUBLEBUFFER, DEPTH_SIZE, STENCIL_SIZE,
+ ACCUM_RED_SIZE, ACCUM_GREEN_SIZE, ACCUM_BLUE_SIZE,
+ ACCUM_ALPHA_SIZE, STEREO, MULTISAMPLEBUFFERS,
+ MULTISAMPLESAMPLES, ACCELERATED_VISUAL,
+ [Version (deprecated = true)] RETAINED_BACKING,
CONTEXT_MAJOR_VERSION, CONTEXT_MINOR_VERSION,
- CONTEXT_EGL, CONTEXT_FLAGS, CONTEXT_PROFILE_MASK,
- SHARE_WITH_CURRENT_CONTEXT, FRAMEBUFFER_SRGB_CAPABLE,
- CONTEXT_RELEASE_BEHAVIOR
+ CONTEXT_FLAGS, CONTEXT_PROFILE_MASK,
+ SHARE_WITH_CURRENT_CONTEXT,
+ [Version (since = "2.0.1")] FRAMEBUFFER_SRGB_CAPABLE,
+ [Version (since = "2.0.4")] CONTEXT_RELEASE_BEHAVIOR,
+ [Version (deprecated = true)] CONTEXT_EGL
}// GLattr
-
- [CCode (cname="SDL_GLprofile", cprefix="SDL_GL_CONTEXT_PROFILE_",
cheader_filename="SDL2/SDL_video.h")]
- public enum ProfileType{
+
+ [CCode (cname = "SDL_GLprofile", cprefix = "SDL_GL_CONTEXT_PROFILE_",
cheader_filename = "SDL2/SDL_video.h")]
+ public enum ProfileType {
CORE, COMPATIBILITY, ES;
}// GLprofile
-
- [CCode (cname="SDL_GLcontextFlag", cprefix="SDL_GL_CONTEXT_",
lower_case_csuffix="flag", cheader_filename="SDL2/SDL_video.h")]
- public enum ContextFlag{
+
+ [CCode (cname = "SDL_GLcontextFlag", cprefix = "SDL_GL_CONTEXT_", lower_case_csuffix
= "flag", cheader_filename = "SDL2/SDL_video.h")]
+ public enum ContextFlag {
DEBUG, FORWARD_COMPATIBLE, ROBUST_ACCESS, RESET_ISOLATION
}
- [CCode (cname="SDL_GL_LoadLibrary")]
- public static int load_library(string path);
-
- [CCode (cname="SDL_GL_GetProcAddress")]
- public static void* get_proc_address(string proc);
-
- [CCode (cname="SDL_GL_UnloadLibrary")]
- public static void unload_library();
-
- [CCode (cname="SDL_GL_ExtensionSupported")]
- public static bool is_extension_supported(string extension);
-
- [CCode (cname="SDL_GL_ResetAttributes")]
- public static void reset_attribute();
-
- [CCode (cname="SDL_GL_SetAttribute")]
- public static int set_attribute(Video.GL.Attributes attr, int val);
-
- [CCode (cname="SDL_GL_GetAttribute")]
- public static int get_attribute(Video.GL.Attributes attr, out int val);
-
- [CCode (cname="SDL_GL_MakeCurrent")]
- public static int make_current(Video.Window window, Video.GL.Context context);
- [CCode (cname="SDL_GL_SetSwapInterval")]
- public static int set_swapinterval(int interval);
-
- [CCode (cname="SDL_GL_GetSwapInterval")]
- public static int get_swapinterval();
-
- [CCode (cname="SDL_GL_SwapWindow")]
- public static void swap_window(Video.Window window);
-
+ [CCode (cname = "SDL_GL_LoadLibrary")]
+ public static int load_library (string path);
+
+ [CCode (cname = "SDL_GL_GetProcAddress")]
+ public static void* get_proc_address (string proc);
+
+ [CCode (cname = "SDL_GL_UnloadLibrary")]
+ public static void unload_library ();
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_GL_ExtensionSupported")]
+ public static bool is_extension_supported (string extension);
+
+ [Version (since = "2.0.2")]
+ [CCode (cname = "SDL_GL_ResetAttributes")]
+ public static void reset_attributes ();
+
+ [CCode (cname = "SDL_GL_SetAttribute")]
+ public static int set_attribute (Video.GL.Attributes attr, int val);
+
+ [CCode (cname = "SDL_GL_GetAttribute")]
+ public static int get_attribute (Video.GL.Attributes attr, out int val);
+
+ [CCode (cname = "SDL_GL_MakeCurrent")]
+ public static int make_current (Video.Window window, Video.GL.Context context);
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_GL_SetSwapInterval")]
+ public static int set_swapinterval (int interval);
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_GL_GetSwapInterval")]
+ public static int get_swapinterval ();
+
+ [CCode (cname = "SDL_GL_SwapWindow")]
+ public static void swap_window (Video.Window window);
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_GL_GetCurrentContext")]
+ public static Video.GL.Context? get_current_context ();
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_GL_GetCurrentWindow")]
+ public static Video.Window? get_current_window ();
}// GL
-
+
///
/// MessageBox
///
- [CCode (cprefix="SDL_", cheader_filename="SDL2/SDL_messagebox.h")]
+ [CCode (cprefix = "SDL_", cheader_filename = "SDL2/SDL_messagebox.h")]
[Compact]
- public class MessageBox{
- [Flags, CCode (cname="SDL_MessageBoxFlags", cprefix="SDL_MESSAGEBOX_",
cheader_filename="SDL2/SDL_messagebox.h")]
+ public class MessageBox {
+ [Flags, CCode (cname = "SDL_MessageBoxFlags", cprefix = "SDL_MESSAGEBOX_",
cheader_filename = "SDL2/SDL_messagebox.h")]
public enum Flags {
/**
* error dialog
@@ -2104,8 +2653,8 @@ namespace SDL {
*/
INFORMATION
} // MessageBoxFlags;
- [Flags, CCode (cname="SDL_MessageBoxButtonFlags", cprefix="SDL_MESSAGEBOX_BUTTON_",
cheader_filename="SDL2/SDL_messagebox.h")]
- public enum ButtonFlags{
+ [Flags, CCode (cname = "SDL_MessageBoxButtonFlags", cprefix =
"SDL_MESSAGEBOX_BUTTON_", cheader_filename = "SDL2/SDL_messagebox.h")]
+ public enum ButtonFlags {
/**
* Marks the default button when return is hit
*/
@@ -2115,8 +2664,8 @@ namespace SDL {
*/
ESCAPEKEY_DEFAULT
} //MessageBoxButtonFlags;
- [CCode (cname="SDL_MessageBoxColorType", cprefix="SDL_MESSAGEBOX_COLOR_",
cheader_filename="SDL2/SDL_messagebox.h")]
- public enum ColorType{
+ [CCode (cname = "SDL_MessageBoxColorType", cprefix = "SDL_MESSAGEBOX_COLOR_",
cheader_filename = "SDL2/SDL_messagebox.h")]
+ public enum ColorType {
BACKGROUND,
TEXT,
BUTTON_BORDER,
@@ -2124,37 +2673,37 @@ namespace SDL {
BUTTON_SELECTED,
MAX
} //MessageBoxColorType;
- [CCode (cname="SDL_MessageBoxButtonData", destroy_function="",
cheader_filename="SDL2/SDL_messagebox.h")]
- public struct ButtonData{
+ [CCode (cname = "SDL_MessageBoxButtonData", destroy_function = "", cheader_filename =
"SDL2/SDL_messagebox.h")]
+ public struct ButtonData {
/**
* ::SDL_MessageBoxButtonFlags
*/
MessageBox.ButtonFlags flags;
- int buttonid; /**< User defined button id (value returned via
SDL_ShowMessageBox) */
+ int buttonid; /**< User defined button id (value returned via
SDL_ShowMessageBox) */
/**
* The UTF-8 button text
*/
string text;
} //MessageBoxButtonData;
- [CCode (cname="SDL_MessageBoxColor", destroy_function="",
cheader_filename="SDL2/SDL_messagebox.h")]
- public struct Color{
+ [CCode (cname = "SDL_MessageBoxColor", destroy_function = "", cheader_filename =
"SDL2/SDL_messagebox.h")]
+ public struct Color {
uint8 r;
uint8 g;
uint8 b;
} // MessageBoxColor;
- [CCode (cname="SDL_MessageBoxColorScheme", destroy_function="",
cheader_filename="SDL2/SDL_messagebox.h")]
- public struct ColorScheme{
- [CCode (array_length_cexpr="SDL_MessageBoxColorType.MAX",
array_length_type="int")]
- Video.MessageBox.Color colors [];
+ [CCode (cname = "SDL_MessageBoxColorScheme", destroy_function = "", cheader_filename
= "SDL2/SDL_messagebox.h")]
+ public struct ColorScheme {
+ [CCode (array_length_cexpr = "SDL_MessageBoxColorType.MAX", array_length_type
= "int")]
+ Video.MessageBox.Color colors[];
} // MessageBoxColorScheme;
- [CCode (cname="SDL_MessageBoxData", destroy_function="",
cheader_filename="SDL2/SDL_messagebox.h")]
+ [CCode (cname = "SDL_MessageBoxData", destroy_function = "", cheader_filename =
"SDL2/SDL_messagebox.h")]
public struct Data {
MessageBox.Flags flags; /**< ::SDL_MessageBoxFlags */
/**
* Parent window, can be null
*/
- [CCode (cname="window")]
+ [CCode (cname = "window")]
Video.Window? parent_window;
string title; /**< UTF-8 title */
/**
@@ -2166,55 +2715,83 @@ namespace SDL {
/**
* ::SDL_MessageBoxColorScheme, can be NULL to use system settings
*/
- [CCode (cname="colorScheme")]
+ [CCode (cname = "colorScheme")]
Video.MessageBox.ColorScheme? color_scheme;
} //MessageBoxData;
-
- [CCode (cname="SDL_ShowSimpleMessageBox")]
- public static int simple_show(MessageBox.Flags flags, string title, string message,
Video.Window? parent = null);
- [CCode (cname="SDL_ShowMessageBox")]
- public static int show(MessageBox.Data data, int buttonid);
-
+ [CCode (cname = "SDL_ShowSimpleMessageBox")]
+ public static int simple_show (MessageBox.Flags flags, string title, string message,
Video.Window? parent = null);
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_ShowMessageBox")]
+ public static int show (MessageBox.Data data, out int buttonid);
+
}// MessageBox
-
+
}
///
/// Input
///
- namespace Input{
+ namespace Input {
- [CCode (cheader_filename="SDL2/SDL_gesture.h")]
- namespace Gesture{
- [CCode (cname="SDL_GestureID", cheader_filename="SDL2/SDL_gesture.h")]
+ [CCode (cheader_filename = "SDL2/SDL_gesture.h")]
+ namespace Gesture {
+ [CCode (cname = "SDL_GestureID", cheader_filename = "SDL2/SDL_gesture.h")]
public struct GestureID : int {}// GestureID
-
- [CCode (cname="SDL_RecordGesture")]
- public static int record_gesture(Touch.TouchID touch_id);
-
- [CCode (cname="SDL_LoadDollarTemplate")]
- public static int load_dollar_template_rw(Touch.TouchID touch_id, SDL.RWops src);
-
- public static int load_dollar_template(Touch.TouchID touch_id, string file){
- return load_dollar_template_rw(touch_id,new SDL.RWops.from_file(file, "rb"));
+
+ [CCode (cname = "SDL_RecordGesture")]
+ public static int record_gesture (Touch.TouchID touch_id);
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_LoadDollarTemplates")]
+ public static int load_dollar_templates_rw (Touch.TouchID touch_id, SDL.RWops src);
+
+ [Version (since = "2.0.0")]
+ public static int load_dollar_templates (Touch.TouchID touch_id, string file) {
+ return load_dollar_templates_rw (touch_id, new SDL.RWops.from_file (file,
"rb"));
}
-
- [CCode (cname="SDL_SaveDollarTemplate")]
- public static bool save_dollar_template_rw(GestureID gesture_id, SDL.RWops dst);
- public static bool save_dollar_template(GestureID gesture_id, string file){
- return save_dollar_template_rw(gesture_id,new SDL.RWops.from_file(file,
"wb"));
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_SaveDollarTemplate")]
+ public static int save_dollar_template_rw (GestureID gesture_id, SDL.RWops dst);
+
+ public static int save_dollar_template (GestureID gesture_id, string file) {
+ return save_dollar_template_rw (gesture_id, new SDL.RWops.from_file (file,
"wb"));
}
-
- }
-
-
- [CCode (cname="int", cprefix="SDL_")]
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_SaveAllDollarTemplates")]
+ public static int save_all_dollar_templates_rw (SDL.RWops dst);
+
+ public static int save_all_dollar_templates (string file) {
+ return save_all_dollar_templates_rw (new SDL.RWops.from_file (file, "wb"));
+ }
+ }
+
+ [CCode (cheader_filename="SDL2/SDL_clipboard.h")]
+ [Compact]
+ public class Clipboard {
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_GetClipboardText")]
+ public static string? get_text();
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_SetClipboardText")]
+ public static int set_text(string text);
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_HasClipboardText")]
+ public static bool has_text();
+ }
+
+
+ [CCode (cname = "int", cprefix = "SDL_")]
public enum ButtonState {
RELEASED, PRESSED;
}// ButtonState
-
- [CCode (cname="SDL_Keycode", cprefix="SDLK_", cheader_filename="SDL2/SDL_keyboard.h")]
+
+ [CCode (cname = "SDL_Keycode", cprefix = "SDLK_", cheader_filename = "SDL2/SDL_keyboard.h")]
public enum Keycode {
UNKNOWN, RETURN, ESCAPE, BACKSPACE, TAB, SPACE, EXCLAIM,
QUOTEDBL, HASH, PERCENT, DOLLAR, AMPERSAND, QUOTE,
@@ -2250,15 +2827,15 @@ namespace SDL {
AC_BOOKMARKS, BRIGHTNESSDOWN, BRIGHTNESSUP, DISPLAYSWITCH,
KBDILLUMTOGGLE, KBDILLUMDOWN, KBDILLUMUP, EJECT, SLEEP
}// Keycode
-
- [CCode (cname="SDL_Keymod", cprefix="KMOD_", cheader_filename="SDL2/SDL_keyboard.h")]
+
+ [CCode (cname = "SDL_Keymod", cprefix = "KMOD_", cheader_filename = "SDL2/SDL_keyboard.h")]
public enum Keymod {
NONE, LSHIFT, RSHIFT, LCTRL, RCTRL, LALT, RALT,
LGUI, RGUI, NUM, CAPS, MODE, RESERVED,
CTRL, SHIFT, ALT, GUI
}// Keymod
-
- [CCode (cname="SDL_Scancode", cprefix="SDL_SCANCODE_",
cheader_filename="SDL2/SDL_scancode.h")]
+
+ [CCode (cname = "SDL_Scancode", cprefix = "SDL_SCANCODE_", cheader_filename =
"SDL2/SDL_scancode.h")]
public enum Scancode {
UNKNOWN, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R,
S, T, U, V, W, X, Y, Z,
@@ -2303,8 +2880,8 @@ namespace SDL {
AC_BOOKMARKS, BRIGHTNESSDOWN, BRIGHTNESSUP, DISPLAYSWITCH,
KBDILLUMTOGGLE, KBDILLUMDOWN, KBDILLUMUP, EJECT, SLEEP, APP1, APP2
}// Scancode
-
- [CCode (cname="SDL_Keysym", cheader_filename="SDL2/SDL_keyboard.h")]
+
+ [CCode (cname = "SDL_Keysym", cheader_filename = "SDL2/SDL_keyboard.h")]
[SimpleType]
public struct Key {
Input.Scancode scancode;
@@ -2312,394 +2889,447 @@ namespace SDL {
uint16 mod;
uint32 unicode;
}// Key
-
- [CCode (cheader_filename="SDL2/SDL_keyboard.h")]
+
+ [CCode (cheader_filename = "SDL2/SDL_keyboard.h")]
public class Keyboard {
- [CCode (cname="SDL_GetKeyboardFocus")]
- public static Video.Window get_focus();
-
- [CCode (cname="SDL_GetKeyboardState")]
- public static uint8[] get_state();
-
- [CCode (cname="SDL_GetModState")]
- public static Input.Keymod get_modifierstate();
-
- [CCode (cname="SDL_SetModState")]
- public static void set_modifierstate(Input.Keymod modstate);
-
- [CCode (cname="SDL_GetKeyFromScancode")]
- public static Input.Keycode key_fromscancode(Input.Scancode scancode);
-
- [CCode (cname="SDL_GetScancodeFromKey")]
- public static Input.Scancode scancode_fromkey(Input.Keycode key);
-
- [CCode (cname="SDL_GetScancodeName")]
- public static unowned string get_scancodename(Input.Scancode scancode);
-
- [CCode (cname="SDL_GetScancodeFromName")]
- public static Input.Scancode scancode_fromname(string name);
-
- [CCode (cname="SDL_GetKeyName")]
- public static unowned string get_keyname(Input.Keycode key);
-
- [CCode (cname="SDL_GetKeyFromName")]
- public static Input.Keycode keycode_fromname(string name);
+ [CCode (cname = "SDL_GetKeyboardFocus")]
+ public static Video.Window get_focus ();
+
+ [CCode (cname = "SDL_GetKeyboardState")]
+ public static unowned uint8* get_raw_state (out size_t length = null);
+
+ [CCode (cname = "vala_get_keyboard_state")]
+ public static unowned bool[] get_state(){
+ size_t len;
+ uint8* raw = get_raw_state(out len);
+ unowned bool[] retval = (bool[])raw;
+ retval.length = (int)len;
+ return retval;
+ }
+
+ [CCode (cname = "SDL_GetModState")]
+ public static Input.Keymod get_modifierstate ();
+
+ [CCode (cname = "SDL_SetModState")]
+ public static void set_modifierstate (Input.Keymod modstate);
+
+ [CCode (cname = "SDL_GetKeyFromScancode")]
+ public static Input.Keycode key_fromscancode (Input.Scancode scancode);
+
+ [CCode (cname = "SDL_GetScancodeFromKey")]
+ public static Input.Scancode scancode_fromkey (Input.Keycode key);
+
+ [CCode (cname = "SDL_GetScancodeName")]
+ public static unowned string get_scancodename (Input.Scancode scancode);
+
+ [CCode (cname = "SDL_GetScancodeFromName")]
+ public static Input.Scancode scancode_fromname (string name);
+
+ [CCode (cname = "SDL_GetKeyName")]
+ public static unowned string get_keyname (Input.Keycode key);
+
+ [CCode (cname = "SDL_GetKeyFromName")]
+ public static Input.Keycode keycode_fromname (string name);
}// Keyboard
-
- [CCode (cheader_filename="SDL2/SDL_keyboard.h")]
+
+ [CCode (cheader_filename = "SDL2/SDL_keyboard.h")]
public class TextInput {
- [CCode (cname="SDL_StartTextInput")]
- public static void start();
-
- [CCode (cname="SDL_IsTextInputActive")]
- public static bool is_active();
-
- [CCode (cname="SDL_StopTextInput")]
- public static void stop();
-
- [CCode (cname="SDL_SetTextInputRect")]
- public static void set_rect(Video.Rect rect);
+ [CCode (cname = "SDL_StartTextInput")]
+ public static void start ();
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_IsTextInputActive")]
+ public static bool is_active ();
+
+ [CCode (cname = "SDL_StopTextInput")]
+ public static void stop ();
+
+ [CCode (cname = "SDL_SetTextInputRect")]
+ public static void set_rect (Video.Rect rect);
}// TextInput
-
- [CCode (cheader_filename="SDL2/SDL_keyboard.h")]
+
+ [CCode (cheader_filename = "SDL2/SDL_keyboard.h")]
public class ScreenKeyboard {
- [CCode (cname="SDL_HasScreenKeyboardSupport")]
- public static bool has_support();
-
- [CCode (cname="SDL_IsScreenKeyboardShown")]
- public static bool is_shown(Video.Window window);
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_HasScreenKeyboardSupport")]
+ public static bool has_support ();
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_IsScreenKeyboardShown")]
+ public static bool is_shown (Video.Window window);
}
-
- [CCode (cname="SDL_SystemCursor", cprefix="SDL_SYSTEM_CURSOR_",
cheader_filename="SDL2/SDL_mouse.h")]
+
+ [CCode (cname = "SDL_SystemCursor", cprefix = "SDL_SYSTEM_CURSOR_", cheader_filename =
"SDL2/SDL_mouse.h")]
public enum SystemCursor {
ARROW, IBEAM, WAIT, CROSSHAIR, WAITARROW, SIZENWSE,
SIZENESW, SIZEWE, SIZENS, SIZEALL, NO, HAND,
- [CCode(cname="SDL_NUM_SYSTEM_CURSORS")]
+ [CCode (cname = "SDL_NUM_SYSTEM_CURSORS")]
NUM
}// SystemCursor
- [CCode (cname="Uint8", cprefix="SDL_BUTTON_")]
+ [CCode (cname = "Uint8", cprefix = "SDL_BUTTON_")]
public enum MouseButton {
LEFT, MIDDLE, RIGHT, X1, X2,
- LMASK, MMASK, RMASK,
- X1MASK, X2MASK
+ LMASK, MMASK, RMASK,
+ X1MASK, X2MASK
}// Buttons
-
- [CCode (type_id="SDL_Cursor", free_function="SDL_FreeCursor",
cheader_filename="SDL2/SDL_mouse.h")]
+
+ [CCode (type_id = "SDL_Cursor", free_function = "SDL_FreeCursor", cheader_filename =
"SDL2/SDL_mouse.h")]
[Compact]
public class Cursor {
- [CCode (cname="SDL_GetMouseFocus")]
- public static Video.Window get_focus();
-
- [CCode (cname="SDL_MouseIsHaptic", cheader_filename="SDL2/SDL_haptic.h")]
- public static int is_haptic();
-
- [CCode (cname="SDL_GetMouseState")]
- public static uint32 get_state(ref int x, ref int y);
-
- [CCode (cname="SDL_GetGlobalMouseState")]
- public static uint32 get_global_state(ref int? x, ref int? y);
-
-
- [CCode (cname="SDL_GetRelativeMouseState")]
- public static uint32 get_relative_state(ref int x, ref int y);
-
- [CCode (cname="SDL_CaptureMouse")]
+ [CCode (cname = "SDL_GetMouseFocus")]
+ public static Video.Window get_focus ();
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_MouseIsHaptic", cheader_filename = "SDL2/SDL_haptic.h")]
+ public static int is_haptic ();
+
+ [CCode (cname = "SDL_GetMouseState")]
+ public static uint32 get_state (ref int x, ref int y);
+
+ [Version (since = "2.0.4")]
+ [CCode (cname = "SDL_GetGlobalMouseState")]
+ public static uint32 get_global_state (ref int? x, ref int? y);
+
+ [CCode (cname = "SDL_GetRelativeMouseState")]
+ public static uint32 get_relative_state (ref int x, ref int y);
+
+ [Version (since = "2.0.4")]
+ [CCode (cname = "SDL_CaptureMouse")]
public static int toggle_capture (bool active);
- [CCode (cname="SDL_WarpMouse")]
- public static void warp_inwindow(Video.Window window, int x, int y);
-
- [CCode (cname="SDL_SetRelativeMouseMode")]
- public static int set_relative_mode(bool enabled);
-
- [CCode (cname="SDL_GetRelativeMouseMode")]
- public static bool get_relative_mode();
-
- [CCode (cname="SDL_CreateCursor")]
- public Cursor(uint8* data, uint8* mask, int w, int h, int hot_x, int hot_y);
-
- [CCode (cname="SDL_CreateColorCursor")]
- public Cursor.from_color(Video.Surface surface, int hot_x, int hot_y);
-
- [CCode (cname="SDL_SystemCursor")]
- public Cursor.from_system(Input.SystemCursor id);
-
- [CCode (cname="SDL_SetCursor")]
- public void set_active();
-
- [CCode (cname="SDL_GetCursor")]
- public static Input.Cursor get_active();
-
- [CCode (cname="SDL_GetDefaultCursor")]
- public static Input.Cursor get_default();
-
- [CCode (cname="SDL_ShowCursor")]
- public static int show(int toggle);
+ [CCode (cname = "SDL_WarpMouseInWindow")]
+ public static void warp_inwindow (Video.Window window, int x, int y);
+
+ [Version (since = "2.0.4")]
+ [CCode (cname = "SDL_WarpMouseGlobal")]
+ public static int warp_global (int x, int y);
+
+ [CCode (cname = "SDL_SetRelativeMouseMode")]
+ public static int set_relative_mode (bool enabled);
+
+ [CCode (cname = "SDL_GetRelativeMouseMode")]
+ public static bool get_relative_mode ();
+
+ [CCode (cname = "SDL_CreateCursor")]
+ public Cursor ([CCode (array_length = false)]uint8[] data, [CCode (array_length =
false)]uint8[] mask, int w, int h, int hot_x, int hot_y);
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_CreateColorCursor")]
+ public Cursor.from_color (Video.Surface surface, int hot_x, int hot_y);
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_SystemCursor")]
+ public Cursor.from_system (Input.SystemCursor id);
+
+ [CCode (cname = "SDL_SetCursor")]
+ public void set_active ();
+
+ [CCode (cname = "SDL_GetCursor")]
+ public static Input.Cursor get_active ();
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_GetDefaultCursor")]
+ public static Input.Cursor get_default ();
+
+ [CCode (cname = "SDL_ShowCursor")]
+ public static int show (int toggle);
}// Cursor
-
- [CCode (cname="SDL_JoystickGUID", cheader_filename="SDL2/SDL_joystick.h")]
- public struct JoystickGUID{
+
+ [CCode (cname = "SDL_JoystickGUID", cheader_filename = "SDL2/SDL_joystick.h")]
+ public struct JoystickGUID {
uint8 data[16];
}
-
- [CCode (cname="SDL_JoystickID", cheader_filename="SDL2/SDL_joystick.h")]
+
+ [CCode (cname = "SDL_JoystickID", cheader_filename = "SDL2/SDL_joystick.h")]
public struct JoystickID : int {}// JoystickID
-
- [CCode (cname="SDL_Joystick", free_function="SDL_JoystickClose",
cheader_filename="SDL2/SDL_joystick.h")]
+ [Version (since = "2.0.4")]
+ [CCode (cname = "SDL_JoystickPowerLevel", cprefix = "SDL_JOYSTICK_POWER_", cheader_filename =
"SDL2/SDL_joystick.h")]
+ public enum JoystickPowerLevel {
+ UNKNOWN, EMPTY, LOW, MEDIUM, FULL, WIRED, MAX;
+ }
+
+ [CCode (cname = "SDL_Joystick", free_function = "SDL_JoystickClose", cheader_filename =
"SDL2/SDL_joystick.h")]
[Compact]
public class Joystick {
- [CCode (cname="SDL_NumJoysticks")]
- public static int count();
-
- [CCode (cname="SDL_JoystickNameForIndex")]
- public static unowned string get_name_for_index(int device_index);
-
- [CCode (cname="SDL_JoystickOpen")]
- public Joystick(int device_index);
-
- [CCode (cname="SDL_JoystickName")]
- public unowned string get_name();
-
- [CCode (cname="SDL_JoystickGetDeviceGUID")]
- public static Input.JoystickGUID get_guid_from_device(int device_index);
-
- [CCode (cname="SDL_JoystickGetGUID")]
- public Input.JoystickGUID get_guid();
-
- [CCode (cname="SDL_JoystickGetGUIDString")]
- public static void guid_buffer(Input.JoystickGUID guid, out uint8[] ps);
-
+ [CCode (cname = "SDL_NumJoysticks")]
+ public static int count ();
+
+ [CCode (cname = "SDL_JoystickNameForIndex")]
+ public static unowned string get_name_for_index (int device_index);
+
+ [CCode (cname = "SDL_JoystickOpen")]
+ public Joystick (int device_index);
+
+ [Version (since = "2.0.4")]
+ [CCode (cname = "SDL_JoystickFromInstanceID")]
+ public static Joystick? create_from_instance_id (Input.JoystickID id);
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_JoystickName")]
+ public unowned string get_name ();
+
+ [Version (since = "2.0.4")]
+ [CCode (cname = "SDL_JoystickCurrentPowerLevel")]
+ public Input.JoystickPowerLevel get_current_powerlevel ();
+
+ [CCode (cname = "SDL_JoystickGetDeviceGUID")]
+ public static Input.JoystickGUID get_guid_from_device (int device_index);
+
+ [CCode (cname = "SDL_JoystickGetGUID")]
+ public Input.JoystickGUID get_guid ();
+
+ [CCode (cname = "SDL_JoystickGetGUIDString")]
+ public static void get_guid_buffer (Input.JoystickGUID guid, out uint8[] ps);
+
//Convenience method, use guid_buffer if the GUID is truncated here
- public static string guid_string(Input.JoystickGUID guid){
- uint8[16] buf;
- guid_buffer(guid, out buf);
+ public static string get_guid_string (Input.JoystickGUID guid) {
+ uint8[1024] buf;
+ get_guid_buffer (guid, out buf);
return (string)buf;
}
-
- [CCode (cname="SDL_JoystickGetGUIDFromString")]
- public static Input.JoystickGUID get_guid_from_string(string pch);
-
- [CCode (cname="SDL_JoystickGetAttached")]
- public bool get_attached();
-
- [CCode (cname="SDL_JoystickInstanceID")]
- public Input.JoystickID get_instance_id();
-
- [CCode (cname="SDL_JoystickNumAxes")]
- public int num_axes();
-
- [CCode (cname="SDL_JoystickNumBalls")]
- public int num_balls();
-
- [CCode (cname="SDL_JoystickNumHats")]
- public int num_hats();
-
- [CCode (cname="SDL_JoystickNumButtons")]
- public int num_buttons();
-
- [CCode (cname="SDL_JoystickUpdate")]
- public static void update();
-
- [CCode (cname="SDL_JoystickGetAxis")]
- public int16 get_axis(int axis);
-
- [CCode (cname="SDL_JoystickIsHaptic", cheader_filename="SDL2/SDL_haptic.h")]
- public int is_haptic();
-
- [CCode (cname="SDL_JoystickGetHat")]
- public HatValue get_hat(int hat);
-
- [CCode (cname="SDL_JoystickGetBall")]
- public int get_ball(int ball, out int dx, out int dy);
-
- [CCode (cname="SDL_JoystickGetButton")]
- public Input.ButtonState get_button(int button);
+
+ [CCode (cname = "SDL_JoystickGetGUIDFromString")]
+ public static Input.JoystickGUID get_guid_from_string (string pch);
+
+ [CCode (cname = "SDL_JoystickGetAttached")]
+ public bool get_attached ();
+
+ [CCode (cname = "SDL_JoystickInstanceID")]
+ public Input.JoystickID get_instance_id ();
+
+ [CCode (cname = "SDL_JoystickNumAxes")]
+ public int num_axes ();
+
+ [CCode (cname = "SDL_JoystickNumBalls")]
+ public int num_balls ();
+
+ [CCode (cname = "SDL_JoystickNumHats")]
+ public int num_hats ();
+
+ [CCode (cname = "SDL_JoystickNumButtons")]
+ public int num_buttons ();
+
+ [CCode (cname = "SDL_JoystickUpdate")]
+ public static void update ();
+
+ [CCode (cname = "SDL_JoystickGetAxis")]
+ public int16 get_axis (int axis);
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_JoystickIsHaptic", cheader_filename = "SDL2/SDL_haptic.h")]
+ public int is_haptic ();
+
+ [CCode (cname = "SDL_JoystickGetHat")]
+ public HatValue get_hat (int hat);
+
+ [CCode (cname = "SDL_JoystickGetBall")]
+ public int get_ball (int ball, out int dx, out int dy);
+
+ [CCode (cname = "SDL_JoystickGetButton")]
+ public Input.ButtonState get_button (int button);
}// Joystick
-
- [CCode(cheader_filename="SDL2/SDL_touch.h")]
- namespace Touch{
- [CCode (cname="SDL_TouchID")]
+
+ [CCode (cheader_filename = "SDL2/SDL_touch.h")]
+ namespace Touch {
+ [CCode (cname = "SDL_TouchID")]
public struct TouchID : int {}// TouchID
-
- [CCode (cname="SDL_FingerID", cheader_filename="SDL2/SDL_touch.h")]
- public struct FingerID : int {}// FingerID
-
- [CCode (cname="SDL_TOUCH_MOUSEID")]
+
+ [CCode (cname = "SDL_FingerID", cheader_filename = "SDL2/SDL_touch.h")]
+ public struct FingerID : int {}// FingerID
+
+ [CCode (cname = "SDL_TOUCH_MOUSEID")]
public struct TouchMouseID : uint32 {}
-
-
- [CCode (cname="SDL_Finger", type_id="SDL_Finger",
cheader_filename="SDL2/SDL_touch.h")]
+
+
+ [CCode (cname = "SDL_Finger", type_id = "SDL_Finger", cheader_filename =
"SDL2/SDL_touch.h")]
[Compact]
public class Finger {
FingerID id;
float x;
float y;
float pressure;
-
- [CCode (cname="SDL_GetNumTouchDevices")]
- public static int num_devices();
-
- [CCode (cname="SDL_GetTouchDevice")]
- public static TouchID get_touch_device(int index);
-
- [CCode (cname="SDL_GetNumTouchFingers")]
- public static int num_fingers(TouchID touch_id);
-
- [CCode (cname="SDL_GetTouchFinger")]
- public Finger(TouchID touch_id, int index);
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_GetNumTouchDevices")]
+ public static int num_devices ();
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_GetTouchDevice")]
+ public static TouchID get_touch_device (int index);
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_GetNumTouchFingers")]
+ public static int num_fingers (TouchID touch_id);
+
+ [CCode (cname = "SDL_GetTouchFinger")]
+ public Finger (TouchID touch_id, int index);
}// Finger
}
///
/// Game Controller
///
- [CCode (cname="SDL_GameController", free_function="SDL_GameControllerClose",
cheader_filename="SDL2/SDL_gamecontroller.h.h")]
+ [CCode (cname = "SDL_GameController", free_function = "SDL_GameControllerClose",
cheader_filename = "SDL2/SDL_gamecontroller.h.h")]
[Compact]
- public class GameController{
-
+ public class GameController {
+
+ [Version (since = "2.0.0")]
[CCode (cname = "SDL_GameControllerOpen")]
- public GameController(int device_index);
-
-
- public string? name{
+ public GameController (int device_index);
+
+ [Version (since = "2.0.4")]
+ [CCode (cname = "SDL_GameControllerFromInstanceID")]
+ public static GameController? create_from_instance_id (Input.JoystickID id);
+
+ [Version (since = "2.0.0")]
+ public string? name {
[CCode (cname= "SDL_GameControllerName")] get;
}
-
- [CCode (cname="SDL_GameControllerMapping")]
- public string get_mapping();
-
- [CCode (cname="SDL_GameControllerGetJoystick")]
- public Input.Joystick to_joystick();
-
- [CCode (cname="SDL_GameControllerGetAttached")]
- public bool is_attached();
-
- [CCode (cname="SDL_GameControllerGetAxis")]
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_GameControllerMapping")]
+ public string get_mapping ();
+
+ [CCode (cname = "SDL_GameControllerGetJoystick")]
+ public Input.Joystick to_joystick ();
+
+ [CCode (cname = "SDL_GameControllerGetAttached")]
+ public bool is_attached ();
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_GameControllerGetAxis")]
public int16 get_axis_status (GameController.Axis axis);
-
- [CCode (cname="SDL_GameControllerGetButton")]
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_GameControllerGetButton")]
public uint8 get_button_status (GameController.Button button);
-
- [CCode (cname="SDL_GameControllerGetBindForAxis")]
- public Input.GameController.ButtonBind get_axis_bind(GameController.Axis axis);
-
- [CCode (cname="SDL_GameControllerGetBindForButton")]
- public Input.GameController.ButtonBind get_button_bind(GameController.Button button);
-
-
-
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_GameControllerGetBindForAxis")]
+ public Input.GameController.ButtonBind get_axis_bind (GameController.Axis axis);
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_GameControllerGetBindForButton")]
+ public Input.GameController.ButtonBind get_button_bind (GameController.Button button);
+
+ [Version (since = "2.0.0")]
[CCode (cname= "SDL_GameControllerEventState")]
- public static void set_event_state(SDL.EventState state);
-
+ public static void set_event_state (SDL.EventState state);
+
+ [Version (since = "2.0.0")]
[CCode (cname= "SDL_IsGameController")]
- public static bool is_game_controller(int device_index);
-
- [CCode (cname="SDL_GameControllerNameForIndex")]
- public static string? name_for_index(int device_index);
-
- [CCode (cname="SDL_GameControllerAddMapping")]
- public static int load_mapping(string mapping);
-
- [CCode (cname="SDL_GameControllerAddMappingsFromFile")]
- public static int load_mapping_file(string path);
-
- [CCode (cname="SDL_GameControllerAddMappingsFromFile")]
- public static int load_mapping_rw(SDL.RWops rw, bool freerw = true);
-
- [CCode (cname="SDL_GameControllerMappingForGUID")]
- public static string mapping_for_guid(Input.JoystickGUID guid);
-
+ public static bool is_game_controller (int device_index);
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_GameControllerNameForIndex")]
+ public static string? name_for_index (int device_index);
+
+ [CCode (cname = "SDL_GameControllerAddMapping")]
+ public static int load_mapping (string mapping);
+
+ [Version (since = "2.0.2")]
+ [CCode (cname = "SDL_GameControllerAddMappingsFromFile")]
+ public static int load_mapping_file (string path);
+
+ [Version (since = "2.0.2")]
+ [CCode (cname = "SDL_GameControllerAddMappingsFromRW")]
+ public static int load_mapping_rw (SDL.RWops rw, int freerw = 1);
+
+ [CCode (cname = "SDL_GameControllerMappingForGUID")]
+ public static string mapping_for_guid (Input.JoystickGUID guid);
+
//Convenience method to get the amount of Controllers available
- public static int count(){
+ public static int count () {
int controllernum = 0;
- for ( int i = 0; i < Input.Joystick.count(); i++ ) {
- if ( is_game_controller(i) ){
+ for (int i = 0; i < Input.Joystick.count (); i++) {
+ if (is_game_controller (i)) {
controllernum++;
}
}
return controllernum;
}
-
- [CCode (cname="SDL_GameControllerUpdate")]
- public static void update_controls();
-
- [CCode (cprefix="SDL_CONTROLLER_AXIS_", cheader_filename="SDL2/SDL_gamecontroller.h")]
- public enum Axis{
+
+ [CCode (cname = "SDL_GameControllerUpdate")]
+ public static void update_controls ();
+
+ [CCode (cprefix = "SDL_CONTROLLER_AXIS_", cheader_filename =
"SDL2/SDL_gamecontroller.h")]
+ public enum Axis {
INVALID, LEFTX, LEFTY, RIGHTX, RIGHTY, TRIGGERLEFT, TRIGGERRIGHT, MAX;
- [CCode (cname="SDL_GameControllerGetStringForAxis")]
- private string? _to_string();
-
- public string to_string(){
- string? val = _to_string();
+ [CCode (cname = "SDL_GameControllerGetStringForAxis")]
+ private string? _to_string ();
+
+ public string to_string () {
+ string? val = _to_string ();
return val ?? "INVALID";
}
- [CCode(cname="SDL_GameControllerGetAxisFromString")]
- public static GameController.Axis from_string(string axis_string);
+ [CCode (cname = "SDL_GameControllerGetAxisFromString")]
+ public static GameController.Axis from_string (string axis_string);
}
-
- [CCode (cprefix="SDL_CONTROLLER_BUTTON_",
cheader_filename="SDL2/SDL_gamecontroller.h")]
- public enum Button{
- INVALID, A, B, X, Y, BACK, GUIDE, START, LEFTSTICK, RIGHTSTICK,
+
+ [Version (since = "2.0.0")]
+ [CCode (cprefix = "SDL_CONTROLLER_BUTTON_", cheader_filename =
"SDL2/SDL_gamecontroller.h")]
+ public enum Button {
+ INVALID, A, B, X, Y, BACK, GUIDE, START, LEFTSTICK, RIGHTSTICK,
LEFTSHOULDER, RIGHTSHOULDER, DPAD_UP, DPAD_DOWN, DPAD_LEFT, DPAD_RIGHT, MAX;
- [CCode (cname="SDL_GameControllerGetStringForButton")]
- private string? _to_string();
-
- public string to_string(){
- string? val = _to_string();
+ [CCode (cname = "SDL_GameControllerGetStringForButton")]
+ private string? _to_string ();
+
+ public string to_string () {
+ string? val = _to_string ();
return val ?? "INVALID";
}
- [CCode (cname="SDL_GameControllerGetButtonFromString")]
- public static GameController.Button from_string(string button_string);
+ [CCode (cname = "SDL_GameControllerGetButtonFromString")]
+ public static GameController.Button from_string (string button_string);
}
- [CCode (cprefix="SDL_CONTROLLER_BINDTYPE_",
cheader_filename="SDL2/SDL_gamecontroller.h")]
- public enum BindType{
- NONE, BUTTON, AXIS, HAT
+ [CCode (cprefix = "SDL_CONTROLLER_BINDTYPE_", cheader_filename =
"SDL2/SDL_gamecontroller.h")]
+ public enum BindType {
+ NONE, BUTTON, AXIS, HAT
}
-
+
[CCode (cname= "SDL_GameControllerButtonBind")]
- public struct ButtonBind{
- [CCode(cname="bindType")]
+ public struct ButtonBind {
+ [CCode (cname = "bindType")]
BindType bind_type;
-
- [CCode (cname="value.button")]
+
+ [CCode (cname = "value.button")]
int button;
- [CCode (cname="value.axis")]
+ [CCode (cname = "value.axis")]
int axis;
- [CCode (cname="value.hat.hat")]
+ [CCode (cname = "value.hat.hat")]
int hat;
- [CCode (cname="value.hat.hat_mask")]
+ [CCode (cname = "value.hat.hat_mask")]
int hat_mask;
}
}
- }
-
+ }
+
///
/// Force Feedback
///
- [CCode (cname="SDL_Haptic", destroy_function="SDL_HapticClose", cheader_filename="SDL2/SDL_haptic.h")]
+ [CCode (cname = "SDL_Haptic", destroy_function = "SDL_HapticClose", cheader_filename =
"SDL2/SDL_haptic.h")]
[Compact]
- public class Haptic{
- [CCode (cname="Uint8", cprefix="SDL_HAPTIC_", cheader_filename="SDL2/SDL_haptic.h")]
- public enum DirectionType{
+ public class Haptic {
+ [CCode (cname = "Uint8", cprefix = "SDL_HAPTIC_", cheader_filename = "SDL2/SDL_haptic.h")]
+ public enum DirectionType {
POLAR, CARTESIAN, SPHERICAL
}
- [Flags, CCode (cname="Uint16", cprefix="SDL_HAPTIC_", cheader_filename="SDL2/SDL_haptic.h")]
- public enum EffectType{
- SINE, SQUARE, TRIANGLE, SAWTOOTHUP, SAWTOOTHDOWN, CONSTANT,
+ [Flags, CCode (cname = "Uint16", cprefix = "SDL_HAPTIC_", cheader_filename =
"SDL2/SDL_haptic.h")]
+ public enum EffectType {
+ SINE, SQUARE, TRIANGLE, SAWTOOTHUP, SAWTOOTHDOWN, CONSTANT,
CUSTOM, LEFTRIGHT, SPRING, DAMPER, INERTIA, FRICTION, RAMP
}
- [CCode (cname="SDL_HapticDirection", cheader_filename="SDL2/SDL_haptic.h")]
+ [CCode (cname = "SDL_HapticDirection", cheader_filename = "SDL2/SDL_haptic.h")]
[SimpleType]
- public struct HapticDirection{
+ public struct HapticDirection {
public DirectionType type;
public int32 dir;
}
- [CCode (cname="SDL_HapticPeriodic", cheader_filename="SDL2/SDL_haptic.h")]
- public struct HapticPeriodic{
+ [CCode (cname = "SDL_HapticPeriodic", cheader_filename = "SDL2/SDL_haptic.h")]
+ public struct HapticPeriodic {
//Header
public EffectType type;
- public HapticDirection direction;
+ public HapticDirection direction;
//Replay
public uint32 length;
public uint16 delay;
@@ -2717,12 +3347,12 @@ namespace SDL {
public uint16 fade_langth;
public uint16 fade_level;
}
-
- [CCode (cname="SDL_HapticConstant", cheader_filename="SDL2/SDL_haptic.h")]
- public struct HapticConstant{
+
+ [CCode (cname = "SDL_HapticConstant", cheader_filename = "SDL2/SDL_haptic.h")]
+ public struct HapticConstant {
//Header
public EffectType type;
- public HapticDirection direction;
+ public HapticDirection direction;
//Replay
public uint32 length;
public uint16 delay;
@@ -2737,12 +3367,12 @@ namespace SDL {
public uint16 fade_langth;
public uint16 fade_level;
}
-
- [CCode (cname="SDL_HapticCondition", cheader_filename="SDL2/SDL_haptic.h")]
- public struct HapticCondition{
+
+ [CCode (cname = "SDL_HapticCondition", cheader_filename = "SDL2/SDL_haptic.h")]
+ public struct HapticCondition {
//Header
public EffectType type;
- public HapticDirection direction;
+ public HapticDirection direction;
//Replay
public uint32 length;
public uint16 delay;
@@ -2762,11 +3392,11 @@ namespace SDL {
public uint16 fade_langth;
public uint16 fade_level;
}
- [CCode (cname="SDL_HapticRamp", cheader_filename="SDL2/SDL_haptic.h")]
- public struct HapticRamp{
+ [CCode (cname = "SDL_HapticRamp", cheader_filename = "SDL2/SDL_haptic.h")]
+ public struct HapticRamp {
//Header
public EffectType type;
- public HapticDirection direction;
+ public HapticDirection direction;
//Replay
public uint32 length;
public uint16 delay;
@@ -2782,8 +3412,8 @@ namespace SDL {
public uint16 fade_langth;
public uint16 fade_level;
}
- [CCode (cname="SDL_HapticLeftRight", cheader_filename="SDL2/SDL_haptic.h")]
- public struct HapticLeftRight{
+ [CCode (cname = "SDL_HapticLeftRight", cheader_filename = "SDL2/SDL_haptic.h")]
+ public struct HapticLeftRight {
//Header
public EffectType type;
//Replay
@@ -2792,11 +3422,11 @@ namespace SDL {
public uint16 large_magnitude;
public uint16 small_magnitude;
}
- [CCode (cname="SDL_HapticCustom", cheader_filename="SDL2/SDL_haptic.h")]
- public struct HapticCustom{
+ [CCode (cname = "SDL_HapticCustom", cheader_filename = "SDL2/SDL_haptic.h")]
+ public struct HapticCustom {
//Header
public EffectType type;
- public HapticDirection direction;
+ public HapticDirection direction;
//Replay
public uint32 length;
public uint16 delay;
@@ -2814,10 +3444,10 @@ namespace SDL {
public uint16 fade_langth;
public uint16 fade_level;
}
-
- [CCode (cname= "SDL_HapticEffect", has_type_id=false, has_target=false, destroy_function="",
cheader_filename="SDL2/SDL_haptic.h")]
+
+ [CCode (cname= "SDL_HapticEffect", has_type_id = false, has_target = false, destroy_function
= "", cheader_filename = "SDL2/SDL_haptic.h")]
[SimpleType]
- public struct HapticEffect{
+ public struct HapticEffect {
public EffectType type;
public HapticConstant constant;
public HapticPeriodic periodic;
@@ -2826,86 +3456,99 @@ namespace SDL {
public HapticLeftRight leftright;
public HapticCustom custom;
}
-
-
- [CCode (cname="SDL_HapticOpen")]
- public Haptic(int device_index);
- [CCode (cname="SDL_HapticOpenfromJoystick")]
- public Haptic.from_joystick(Input.Joystick joystick);
- [CCode (cname="SDL_HapticOpenfromMouse")]
- public Haptic.from_mouse();
- [CCode (cname="SDL_NumHaptics")]
- public static int num_devices();
- [CCode (cname="SDL_HapticName")]
- public static unowned string device_name(int device_index);
- [CCode (cname="SDL_HapticNewEffect")]
- public int upload_effect(HapticEffect effect);
- [CCode (cname="SDL_HapticRunEffect")]
- public int run_effect(int effect_id);
- [CCode (cname="SDl_HapticUpdateEffect")]
- public int update_effect(int effect_id, HapticEffect new_effect);
- [CCode (cname="SDL_HapticDestroyEffect")]
- public int destroy_effect(int effect_id);
- [CCode (cname="SDL_HapticGetEffectStatus")]
- public int get_effect_status(int effect_id);
+
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_HapticOpen")]
+ public Haptic (int device_index);
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_HapticOpenfromJoystick")]
+ public Haptic.from_joystick (Input.Joystick joystick);
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_HapticOpenfromMouse")]
+ public Haptic.from_mouse ();
+ [CCode (cname = "SDL_NumHaptics")]
+ public static int num_devices ();
+ [CCode (cname = "SDL_HapticName")]
+ public static unowned string device_name (int device_index);
+ [CCode (cname = "SDL_HapticNewEffect")]
+ public int upload_effect (HapticEffect effect);
+ [CCode (cname = "SDL_HapticRunEffect")]
+ public int run_effect (int effect_id);
+ [CCode (cname = "SDl_HapticUpdateEffect")]
+ public int update_effect (int effect_id, HapticEffect new_effect);
+ [CCode (cname = "SDL_HapticDestroyEffect")]
+ public int destroy_effect (int effect_id);
+ [CCode (cname = "SDL_HapticGetEffectStatus")]
+ public int get_effect_status (int effect_id);
//Returns negative on error, that's why it's not a bool
- [CCode (cname="SDL_HapticEffectSupported")]
- public int supports_effect(HapticEffect effect);
- [CCode (cname="SDL_HapticNumEffects")]
- public int effects_capacity();
- [CCode (cname="SDL_HapticNumEffectsPlaying")]
- public int effects_playing();
- [CCode (cname="SDL_HapticNumAxes")]
- public int num_axes();
- [CCode (cname="SDL_HapticIndex")]
- public int get_index();
- [CCode (cname="SDL_HapticSetGain")]
- public int set_gain(int gain);
- [CCode (cname="SDL_HapticsetAutocenter")]
- public int set_autocenter(int percentage);
- [CCode (cname="SDL_HapticRumbleInit")]
- public int rumble_init();
- [CCode (cname="SDL_HapticRumblePlay")]
- public int rumble_play();
- [CCode (cname="SDL_HapticRumbleStop")]
- public int rumble_stop();
- [CCode (cname="SDL_HapticRumbleSupported")]
- public int rumble_supported();
- [CCode (cname="SDL_HapticOpened")]
- public bool is_open();
- [CCode (cname="SDL_HapticQuery")]
- public uint query();
- [CCode (cname="SDL_HapticPause")]
- public int pause();
- [CCode (cname="SDL_HapticUnpause")]
- public int resume();
- [CCode (cname="SDL_HapticStopAll")]
- public int stop();
- [CCode (cname="SDL_HapticStopEffect")]
- public int stop_effect(int effect_id);
-
+ [CCode (cname = "SDL_HapticEffectSupported")]
+ public int supports_effect (HapticEffect effect);
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_HapticNumEffects")]
+ public int effects_capacity ();
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_HapticNumEffectsPlaying")]
+ public int effects_playing ();
+ [CCode (cname = "SDL_HapticNumAxes")]
+ public int num_axes ();
+ [CCode (cname = "SDL_HapticIndex")]
+ public int get_index ();
+ [CCode (cname = "SDL_HapticSetGain")]
+ public int set_gain (int gain);
+ [CCode (cname = "SDL_HapticsetAutocenter")]
+ public int set_autocenter (int percentage);
+ [CCode (cname = "SDL_HapticRumbleInit")]
+ public int rumble_init ();
+ [CCode (cname = "SDL_HapticRumblePlay")]
+ public int rumble_play ();
+ [CCode (cname = "SDL_HapticRumbleStop")]
+ public int rumble_stop ();
+ [CCode (cname = "SDL_HapticRumbleSupported")]
+ public int rumble_supported ();
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_HapticOpened")]
+ public bool is_open ();
+ [CCode (cname = "SDL_HapticQuery")]
+ public uint query ();
+ [CCode (cname = "SDL_HapticPause")]
+ public int pause ();
+ [CCode (cname = "SDL_HapticUnpause")]
+ public int resume ();
+ [CCode (cname = "SDL_HapticStopAll")]
+ public int stop ();
+ [CCode (cname = "SDL_HapticStopEffect")]
+ public int stop_effect (int effect_id);
+
}//Force Feedback
-
-
+
+
///
/// Audio
///
-
- [CCode (cheader_filename="SDL2/SDL_audio.h")]
+
+ [CCode (cheader_filename = "SDL2/SDL_audio.h")]
namespace Audio {
- [CCode (cname="Uint16", cprefix="AUDIO_", cheader_filename="SDL2/SDL_audio.h")]
- public enum Format {
- U8, S8, U16LSB, S16LSB, U16MSB, S16MSB, U16, S16,
- S32LSB, S32MSB, S32, F32LSB, F32MSB, F32,
- U16SYS, S16SYS, U32SYS, S32SYS,
+ [CCode (cname = "Uint16", cprefix = "AUDIO_", cheader_filename = "SDL2/SDL_audio.h")]
+ public enum AudioFormat {
+ U8, S16LSB, S16MSB, S16SYS, S16,
+ U16LSB, U16MSB, U16SYS, U16,
+ [Version (since = "2.0")] S32LSB,
+ [Version (since = "2.0")] S32MSB,
+ [Version (since = "2.0")] S32SYS,
+ [Version (since = "2.0")] S32,
+ [Version (since = "2.0")] F32LSB,
+ [Version (since = "2.0")] F32MSB,
+ [Version (since = "2.0")] F32SYS,
+ [Version (since = "2.0")] F32
}// AudioFormat
- [CCode (cname="int", cprefix="SDL_AUDIO_")]
- public enum Status {
+ [CCode (cname = "int", cprefix = "SDL_AUDIO_")]
+ public enum AudioStatus {
STOPPED, PLAYING, PAUSED
}// AudioStatus
-
- [CCode (cname="int", cprefix="SDL_AUDIO_ALLOW_", cheader_filename="SDL2/SDL_audio.h")]
+
+ [CCode (cname = "int", cprefix = "SDL_AUDIO_ALLOW_", cheader_filename =
"SDL2/SDL_audio.h")]
public enum AllowFlags {
FREQUENCY_CHANGE,
FORMAT_CHANGE,
@@ -2913,258 +3556,285 @@ namespace SDL {
ANY_CHANGE
}// AudioAllowFlags
- [CCode (cname="SDL_AudioCallback", instance_pos = 0.1, has_target = true,
delegate_target_pos=0, cheader_filename="SDL2/SDL_audio.h")]
- public delegate void Callback(uint8[] stream, int len);
+ [CCode (cname = "SDL_AudioCallback", instance_pos = 0.1, has_target = true,
delegate_target_pos = 0, cheader_filename = "SDL2/SDL_audio.h")]
+ public delegate void AudioFunc (uint8[] stream, int len);
- [CCode (cname="SDL_AudioSpec", cheader_filename="SDL2/SDL_audio.h")]
- public struct Spec {
+ [CCode (cname = "SDL_AudioSpec", cheader_filename = "SDL2/SDL_audio.h")]
+ public struct AudioSpec {
public int freq;
- public SDL.Audio.Format format;
+ public AudioFormat format;
public uint8 channels;
public uint8 silence;
public uint16 samples;
public uint16 padding;
public uint32 size;
[CCode (delegate_target_cname = "userdata")]
- public unowned SDL.Audio.Callback callback;
+ public unowned AudioFunc callback;
}// AudioSpec
-
- [CCode (cname="SDL_AudioFilter", instance_pos = 0.1, cheader_filename="SDL2/SDL_audio.h")]
- public delegate void Filter(Audio.Converter cvt, Audio.Format format);
- [CCode (cname="SDL_AudioCVT", cheader_filename="SDL2/SDL_audio.h")]
- public struct Converter {
+ [CCode (cname = "SDL_AudioFilter", instance_pos = 0.1, cheader_filename = "SDL2/SDL_audio.h")]
+ public delegate void AudioFilter (AudioConverter cvt, AudioFormat format);
+
+ [CCode (cname = "SDL_AudioCVT", cheader_filename = "SDL2/SDL_audio.h")]
+ public struct AudioConverter {
public int needed;
- public SDL.Audio.Format src_format;
- public SDL.Audio.Format dst_format;
+ public AudioFormat src_format;
+ public AudioFormat dst_format;
public double rate_incr;
public uint8* buf;
public int len;
public int len_cvt;
public int len_mult;
public double len_ratio;
- public Audio.Filter filters[10];
+ public AudioFilter filters[10];
public int filter_index;
- [CCode (cname="SDL_BuildAudioCVT")]
- public static int build(Audio.Converter cvt, Audio.Format src_format,
- uchar src_channels, int src_rate, Audio.Format dst_format,
+ [CCode (cname = "SDL_BuildAudioCVT")]
+ public static int build (AudioConverter cvt, AudioFormat src_format,
+ uchar src_channels, int src_rate, AudioFormat dst_format,
uchar dst_channels, int dst_rate);
- [CCode (cname="SDL_ConvertAudio")]
- public int convert();
+ [CCode (cname = "SDL_ConvertAudio")]
+ public int convert ();
}// AudioConverter
-
- [CCode (cname="SDL_AudioDeviceID", has_type_id = false, cheader_filename="SDL2/SDL_audio.h")]
+
+ [CCode (cname = "SDL_AudioDeviceID", has_type_id = false, cheader_filename =
"SDL2/SDL_audio.h")]
[SimpleType]
[IntegerType (rank = 7)]
- public struct Device : uint32 {
- [CCode (cname="SDL_OpenAudioDevice")]
- public Device(string device_name, bool is_capture,
- Audio.Spec desired, Audio.Spec obtained,
+ public struct AudioDevice : uint32 {
+ [CCode (cname = "SDL_OpenAudioDevice")]
+ public AudioDevice (string device_name, bool is_capture,
+ AudioSpec desired, AudioSpec obtained,
int allowed_changes);
-
- [CCode (cname="SDL_PauseAudioDevice")]
- public void pause(int pause_on);
-
- [CCode (cname="SDL_GetAudioDeviceStatus")]
- public Audio.Status get_status();
-
- [CCode (cname="SDL_LockAudioDevice")]
- public void do_lock();
-
- [CCode (cname="SDL_LockAudioDevice")]
- public void unlock();
-
-
+
+ [CCode (cname = "SDL_PauseAudioDevice")]
+ public void pause (int pause_on);
+
+ [CCode (cname = "SDL_GetAudioDeviceStatus")]
+ public AudioStatus get_status ();
+
+ [CCode (cname = "SDL_LockAudioDevice")]
+ public void do_lock ();
+
+ [CCode (cname = "SDL_UnlockAudioDevice")]
+ public void unlock ();
+
+ [CCode (cname = "SDL_GetAudioDeviceName")]
+ public unowned string get_name ();
+
+ [Version (since = "2.0.4")]
+ [CCode (cname = "SDL_QueueAudio")]
+ public int raw_enqueue (void* data, uint32 length);
+
+ [Version (since = "2.0.4")]
+ [CCode (cname = "SDL_QueueAudio")]
+ public int enqueue (uint8[] data);
+
+ [Version (since = "2.0.4")]
+ [CCode (cname = "SDL_GetQueuedAudioSize")]
+ public uint32 get_queued_size ();
+
+ [Version (since = "2.0.4")]
+ [CCode (cname = "SDL_ClearQueuedAudio")]
+ public void clear_queue ();
+
+
}// AudioDeviceID
-
- [CCode (cname="SDL_GetNumAudioDrivers")]
- public static int num_drivers();
-
- [CCode (cname="SDL_GetAudioDriver")]
- public static unowned string get_driver(int index);
-
- [CCode (cname="SDL_AudioInit")]
- public static int init(string driver);
-
- [CCode (cname="SDL_AudioQuit")]
- public static void quit();
-
- [CCode (cname="SDL_GetCurrentAudioDriver")]
- public static unowned string get_current_driver();
-
- [CCode (cname="SDL_OpenAudio")]
- public static int open(Audio.Spec desired, out Audio.Spec obtained);
-
- [CCode (cname="SDL_GetNumAudioDevices")]
- public static int num_devices();
-
- [CCode (cname="SDL_GetAudioDeviceName")]
- public static unowned string get_device_name(int index);
-
- [CCode (cname="SDL_GetAudioStatus")]
- public static Audio.Status status();
-
- [CCode (cname="SDL_PauseAudio")]
- public static void pause(int pause_on);
-
- [CCode (cname="SDL_LoadWAV_RW")]
- public static unowned Audio.Spec? load_rw(RWops src, int freesrc, ref Audio.Spec spec, out
uint8[] audio_buf, out uint32 audio_len);
-
- public static unowned Audio.Spec? load(string file, ref Audio.Spec spec, out uint8[]
audio_buf, out uint32 audio_len){
- return load_rw(new SDL.RWops.from_file(file, "rb"), 1,
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_GetNumAudioDrivers")]
+ public static int num_drivers ();
+
+ [CCode (cname = "SDL_GetAudioDriver")]
+ public static unowned string get_driver (int index);
+
+ [CCode (cname = "SDL_AudioInit")]
+ public static int init (string driver);
+
+ [CCode (cname = "SDL_AudioQuit")]
+ public static void quit ();
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_GetCurrentAudioDriver")]
+ public static unowned string get_current_driver ();
+
+ [Version (deprecated = true, replacement = "AudioDevice.AudioDevice")]
+ [CCode (cname = "SDL_OpenAudio")]
+ public static int open (AudioSpec desired, out AudioSpec obtained);
+
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_GetNumAudioDevices")]
+ public static int num_devices (int iscapture = 0);
+
+
+ [CCode (cname = "SDL_GetAudioStatus")]
+ public static AudioStatus status ();
+
+ [Version (deprecated = true, replacement = "AudioDevice.pause")]
+ [CCode (cname = "SDL_PauseAudio")]
+ public static void pause (int pause_on);
+
+ [CCode (cname = "SDL_LoadWAV_RW")]
+ public static unowned AudioSpec? load_rw (RWops src, int freesrc, ref AudioSpec spec, out
uint8[] audio_buf, out uint32 audio_len);
+
+ public static unowned AudioSpec? load (string file, ref AudioSpec spec, out uint8[]
audio_buf, out uint32 audio_len) {
+ return load_rw (new SDL.RWops.from_file (file, "rb"), 1,
ref spec, out audio_buf, out audio_len);
}
-
- [CCode (cname="SDL_FreeWAV")]
- public static void free(ref uint8 audio_buf);
-
- [CCode (cname="SDL_MixAudio")]
- public static void mix(out uint8[] dst, uint8[] src, uint32 len, int volume);
-
- [CCode (cname="SDL_MixAudioFormat")]
- public static void mix_device(out uint8[] dst, uint8[] src, SDL.Audio.Format format, uint32
len, int volume);
-
- [CCode (cname="SDL_LockAudio")]
- public static void do_lock();
-
- [CCode (cname="SDL_UnlockAudio")]
- public static void unlock();
-
- [CCode (cname="SDL_CloseAudio")]
- public static void close();
-
- [CCode (cname="SDL_CloseAudioDevice")]
- public static void close_device(SDL.Audio.Device dev);
-
- [CCode (cname="SDL_AudioDeviceConnected")]
- public static int is_device_connected(SDL.Audio.Device dev);
+
+ [CCode (cname = "SDL_FreeWAV")]
+ public static void free (ref uint8 audio_buf);
+
+ [CCode (cname = "SDL_MixAudio")]
+ public static void mix (out uint8[] dst, uint8[] src, uint32 len, int volume);
+
+ [CCode (cname = "SDL_MixAudioFormat")]
+ public static void mix_device (out uint8[] dst, uint8[] src, AudioFormat format, uint32 len,
int volume);
+
+ [Version (deprecated = true, replacement = "AudioDevice.do_lock")]
+ [CCode (cname = "SDL_LockAudio")]
+ public static void do_lock ();
+
+ [Version (deprecated = true, replacement = "AudioDevice.unlock")]
+ [CCode (cname = "SDL_UnlockAudio")]
+ public static void unlock ();
+
+ [Version (deprecated = true, replacement = "Audio.close_device")]
+ [CCode (cname = "SDL_CloseAudio")]
+ public static void close ();
+
+ [CCode (cname = "SDL_CloseAudioDevice")]
+ public static void close_device (AudioDevice dev);
+
+ [CCode (cname = "SDL_AudioDeviceConnected")]
+ public static int is_device_connected (AudioDevice dev);
}// Audio
-
-
+
+
///
/// Timers
///
- [CCode (cname="SDL_TimerCallback", cheader_filename="SDL2/SDL_timer.h", has_target = true,
delegate_target_pos = 0.1)]
- public delegate uint32 TimerCallback(uint32 interval);
+ [CCode (cname = "SDL_TimerCallback", cheader_filename = "SDL2/SDL_timer.h", has_target = true,
delegate_target_pos = 0.1)]
+ public delegate uint32 TimerFunc (uint32 interval);
- [CCode (cname="SDL_TimerID", ref_function="", unref_function="", cheader_filename="SDL2/SDL_timer.h")]
+ [CCode (cname = "SDL_TimerID", ref_function = "", unref_function = "", cheader_filename =
"SDL2/SDL_timer.h")]
[Compact]
public class Timer {
- [CCode (cname="SDL_GetTicks")]
- public static uint32 get_ticks();
+ [CCode (cname = "SDL_GetTicks")]
+ public static uint32 get_ticks ();
- [CCode (cname="SDL_GetPerformanceCounter")]
- public static uint64 get_performance_counter();
+ [CCode (cname = "SDL_GetPerformanceCounter")]
+ public static uint64 get_performance_counter ();
- [CCode (cname="SDL_GetPerformanceFrequency")]
- public static uint64 get_performance_frequency();
+ [Version (since = "2.0.0")]
+ [CCode (cname = "SDL_GetPerformanceFrequency")]
+ public static uint64 get_performance_frequency ();
- [CCode (cname="SDL_Delay")]
- public static void delay(uint32 ms);
+ [CCode (cname = "SDL_Delay")]
+ public static void delay (uint32 ms);
- [CCode (cname="SDL_AddTimer", delegate_target_pos= 1.1)]
- public Timer (uint32 interval, SDL.TimerCallback callback);
-
- [CCode (cname="SDL_RemoveTimer")]
+ [CCode (cname = "SDL_AddTimer", delegate_target_pos= 1.1)]
+ public Timer (uint32 interval, SDL.TimerFunc callback);
+
+ [CCode (cname = "SDL_RemoveTimer")]
[DestroysInstance]
public bool remove ();
}// Timer
-
-
-
-
+
+
+
+
///
/// Threading
///
[CCode (has_target = true)]
- public delegate int ThreadFunc();
-
-
- [CCode (cname="SDL_ThreadPriority", cprefix="SDL_THREAD_PRIORITY_",
cheader_filename="SDL2/SDL_thread.h")]
- public enum ThreadPriority{
+ public delegate int ThreadFunc ();
+
+
+ [CCode (cname = "SDL_ThreadPriority", cprefix = "SDL_THREAD_PRIORITY_", cheader_filename =
"SDL2/SDL_thread.h")]
+ public enum ThreadPriority {
LOW, NORMAL, HIGH
}
-
- [CCode (cname="SDL_Thread", free_function="SDL_WaitThread", cheader_filename="SDL2/SDL_thread.h")]
+
+ [CCode (cname = "SDL_Thread", free_function = "SDL_WaitThread", cheader_filename =
"SDL2/SDL_thread.h")]
[Compact]
public class Thread {
- [CCode (cname="SDL_CreateThread", delegate_target_pos= 1.1)]
- public Thread(ThreadFunc f, string name);
+ [CCode (cname = "SDL_CreateThread", delegate_target_pos= 1.1)]
+ public Thread (ThreadFunc f, string name);
- [CCode (cname="SDL_ThreadID")]
- public static uint32 id();
+ [CCode (cname = "SDL_ThreadID")]
+ public static uint32 id ();
- [CCode (cname="SDL_GetThreadID")]
- public uint32 get_id();
+ [CCode (cname = "SDL_GetThreadID")]
+ public uint32 get_id ();
- [CCode (cname="SDL_GetThreadName")]
- public string get_name();
+ [CCode (cname = "SDL_GetThreadName")]
+ public string get_name ();
- [CCode (cname="SDL_SetThreadPriority")]
- public static int set_priotity(ThreadPriority priority);
-
- [CCode (cname="SDL_DetachThread")]
- public void detach();
+ [CCode (cname = "SDL_SetThreadPriority")]
+ public static int set_priotity (ThreadPriority priority);
+
+ [Version (since = "2.0.2")]
+ [CCode (cname = "SDL_DetachThread")]
+ public void detach ();
}// Thread
-
- [CCode (cname="SDL_Mutex", free_function="SDL_DestroyMutex")]
+
+ [CCode (cname = "SDL_Mutex", free_function = "SDL_DestroyMutex")]
[Compact]
public class Mutex {
- [CCode (cname="SDL_CreateMutex")]
- public Mutex();
-
- [CCode (cname="SDL_TryLockMutex")]
- public int try_lock();
-
- [CCode (cname="SDL_LockMutex")]
- public int do_lock();
-
- [CCode (cname="SDL_UnlockMutex")]
- public int unlock();
+ [CCode (cname = "SDL_CreateMutex")]
+ public Mutex ();
+
+ [CCode (cname = "SDL_TryLockMutex")]
+ public int try_lock ();
+
+ [CCode (cname = "SDL_LockMutex")]
+ public int do_lock ();
+
+ [CCode (cname = "SDL_UnlockMutex")]
+ public int unlock ();
}// Mutex
-
- [CCode (cname="SDL_sem", free_function="SDL_DestroySemaphore")]
+
+ [CCode (cname = "SDL_sem", free_function = "SDL_DestroySemaphore")]
[Compact]
public class Semaphore {
- [CCode (cname="SDL_CreateSemaphore")]
- public Semaphore(uint32 initial_value);
-
- [CCode (cname="SDL_SemWait")]
- public int wait();
-
- [CCode (cname="SDL_SemTryWait")]
- public int try_wait();
-
- [CCode (cname="SDL_SemWaitTimeout")]
- public int wait_timeout(uint32 ms);
-
- [CCode (cname="SDL_SemPost")]
- public int post();
-
- [CCode (cname="SDL_SemValue")]
- public uint32 get_value();
+ [CCode (cname = "SDL_CreateSemaphore")]
+ public Semaphore (uint32 initial_value);
+
+ [CCode (cname = "SDL_SemWait")]
+ public int wait ();
+
+ [CCode (cname = "SDL_SemTryWait")]
+ public int try_wait ();
+
+ [CCode (cname = "SDL_SemWaitTimeout")]
+ public int wait_timeout (uint32 ms);
+
+ [CCode (cname = "SDL_SemPost")]
+ public int post ();
+
+ [CCode (cname = "SDL_SemValue")]
+ public uint32 get_value ();
}// Semaphore
-
- [CCode (cname="SDL_cond", free_function="SDL_DestroyCond")]
+
+ [CCode (cname = "SDL_cond", free_function = "SDL_DestroyCond")]
[Compact]
public class Condition {
- [CCode (cname="SDL_CreateCond")]
- public Condition();
-
- [CCode (cname="SDL_CondSignal")]
- public int signalize();
-
- [CCode (cname="SDL_CondBroadcast")]
- public int broadcast();
-
- [CCode (cname="SDL_CondWait")]
- public int wait(SDL.Mutex mut);
-
- [CCode (cname="SDL_CondWaitTimeout")]
- public int wait_timeout(SDL.Mutex mut, uint32 ms);
+ [CCode (cname = "SDL_CreateCond")]
+ public Condition ();
+
+ [CCode (cname = "SDL_CondSignal")]
+ public int emit_signal ();
+
+ [CCode (cname = "SDL_CondBroadcast")]
+ public int broadcast ();
+
+ [CCode (cname = "SDL_CondWait")]
+ public int wait (SDL.Mutex mut);
+
+ [CCode (cname = "SDL_CondWaitTimeout")]
+ public int wait_timeout (SDL.Mutex mut, uint32 ms);
}// Condition
-
+
}// SDL
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]