// Workshop 1 part 1 import sdljava.*; import sdljava.video.*; class part1 { public static void main(String[] args) { // Create an SDL object SDLMain sdl = new SDLMain(); // SDL uses exceptions when it encounters problems try { // Initialise SDL to use its video (graphics) // capabilities sdl.init(SDLMain.SDL_INIT_VIDEO); // SDL uses what it calls a 'surface' as a window. SDLSurface screen = SDLVideo.setVideoMode(640, 480, 0, 0 ); // Make our program sleep for a couple of seconds // so we can admire our blank window... java.lang.Thread.sleep(2500); } catch(Exception e) // Just catching all problems for now { // We shall handle any problems by printing a // stack trace: e.printStackTrace(); // and an explanation if that wasn't enough System.out.println("SDL could not initialise"); } } }