Skip to content

Instantly share code, notes, and snippets.

@PedroHLC
Last active January 9, 2023 21:37
Show Gist options
  • Save PedroHLC/5331234 to your computer and use it in GitHub Desktop.
Save PedroHLC/5331234 to your computer and use it in GitHub Desktop.
SDL 2.0 Binding for Vala
using GLib;
using SDL;
public class Example {
protected static SDL.Window window;
public static void main () {
SDL.init ();
window = new Window ("Testing SDL 2.0 in Vala", Window.POS_CENTERED, Window.POS_CENTERED, 640, 480, WindowFlags.RESIZABLE);
window.show ();
Event e;
for (e = {0}; e.type != EventType.QUIT; Event.poll (out e)){
window.update_surface ();
SDL.Timer.delay(10);
}
window.destroy (); //Actually useless since it is called when window is disposed
SDL.quit ();
}
}
To make it easily for me to maintain, this file has been moved to:
https://gitorious.org/sdl-2-0-vala-vapi/pedrohlc-sdl2-vala-vapi/source/sdl2-image.vapi
To make it easily for me to maintain, this file has been moved to:
https://gitorious.org/sdl-2-0-vala-vapi/pedrohlc-sdl2-vala-vapi/source/sdl2.vapi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment