Source code: org/libsdl/video/SDLScreen.java
1
2
3 package org.libsdl.video;
4
5
6 /**
7 * The <code>SDLScreen</code> class extends <code>SDLSurface</code> which extends
8 * <code>SDLStruct</code> and thus it represents a native C structure. In
9 * particular, the <code>SDLScreen</code> class represents the visible SDL surface.
10 * <p>
11 * A <code>SDLScreen</code> cannot be instantiated directly. It is created and
12 * returned by the <code>SDLVideo</code> object.
13 * <p>
14 * ------ EXAMPLE ------
15 * <p><blockquote><pre>
16 * SDL sdl = SDL.getInstance();
17 * SDLVideo video = sdl.getVideo();
18 * // Create a screen that is 640x480 at 32 bpp fullscreen
19 * SDLScreen screen = video.setVideoMode(640, 480, 32, SDLVideo.SDL_FULLSCREEN);
20 * ... // do some drawing and stuff
21 * screen.flip(); // would probably be in a loop normally
22 * </pre></blockquote><p>
23 *
24 * @author Eric Wittmann
25 * @version $revision$
26 * @see org.libsdl.video.SDLVideo#setVideoMode(int, int, int, int)
27 * @see org.libsdl.video.SDLVideo#getVideoSurface()
28 */
29 public class SDLScreen extends SDLSurface
30 {
31 public SDLScreen(int l) {
32 super(l);
33 }
34
35 /**
36 * If this <code>SDLScreen</code> object was created as a double-buffered
37 * surface, this method will flip the surface. Note that if the screen
38 * is not double-buffered, this does the same thing as <code>updateRect</code>
39 * with the entire surface as the rect.
40 * <p>
41 * <b>Corresponds</b>:<blockquote><code>SDL_Flip()</code></blockquote>
42 * <p>
43 * @return Boolean - true if flip succeeded
44 */
45 public native boolean flip();
46
47 /**
48 * Update a portion of the screen.
49 * <p>
50 * <b>Corresponds</b>:<blockquote><code>SDL_UpdateRect()</code></blockquote>
51 * <p>
52 * @param x Integer - x value
53 * @param y Integer - y value
54 * @param w Integer - width
55 * @param h Integer - height
56 */
57 public native void updateRect(int x, int y, int w, int h);
58 // public native void updateRects(int numrects, SDLRect [] rects);
59
60 // Don't want to do anyting here - because SDLSurface DOES do something,
61 // and it's the wrong thing for SDLScreen
62 public void finalize() {
63
64 }
65 }