OSDN Git Service

エラー処理追加
[scala-sdl/scalasdl-1.0.git.git] / src / SDL_structs.scala
1 /*************************************************
2 * ScalaSDL
3 *
4 * Copyright(C)2010 RoNor
5 * ronor.u@gmail.com
6 *
7 * Licensed under GNU Lesser General Public License
8 * http://www.gnu.org/licenses/lgpl.html 
9 * -----------------------------------------------
10 * SDL_structs.scala
11 * SDLで用意されている構造体をクラスに置き換えたものです。
12 *
13 * 参考資料
14 * http://www.libsdl.org/cgi/docwiki.cgi/SDL_API
15 *************************************************/
16
17 package sdl {
18   class SDL_Version {
19     var major:Int = 0
20     var minor:Int = 0
21     var patch:Int = 0
22   }
23
24   class SDL_Surface {
25     var pointer:Int = 0
26     var flags:Int = 0
27     var format:SDL_PixelFormat = null
28     var w:Int = 0
29     var h:Int = 0
30     var pitch:Int = 0
31     var pixels:java.nio.ByteBuffer = null
32     var clip_rect:SDL_Rect = null
33     var refcount:Int = 0
34   }
35
36   class SDL_PixelFormat {
37     var pointer:Int = 0
38     var palette:SDL_Palette = null
39     var BitsPerPixel:Int = 0
40     var BytesPerPixel:Int = 0
41     var Rloss:Int = 0
42     var Gloss:Int = 0
43     var Bloss:Int = 0
44     var Aloss:Int = 0
45     var Rshift:Int = 0
46     var Gshift:Int = 0
47     var Bshift:Int = 0
48     var Ashift:Int = 0
49     var Rmask:Int = 0
50     var Gmask:Int = 0
51     var Bmask:Int = 0
52     var Amask:Int = 0
53     var colorkey:Int = 0
54     var alpha:Int = 0
55   }
56
57   class SDL_Palette {
58     var pointer:Int = 0
59     var ncolors:Int = 0
60     var colors:SDL_Color = null
61   }
62
63   class SDL_Color {
64     var r:Int = 0
65     var g:Int = 0
66     var b:Int = 0
67     var unused:Int = 0
68   }
69
70   class SDL_Rect(var x:Int, var y:Int, var w:Int, var h:Int) {
71     def this(x:Int, y:Int) = this(x,y,0,0)
72     def this() = this(0,0,0,0)
73   }
74
75   /**
76   *This read-only structure is returned by SDL_GetVideoInfo.<br />
77   *It contains information on either the best available mode if called before SDL_SetVideoMode or the current video mode if called after SDL_SetVideoMode.
78   */
79   class SDL_VideoInfo {
80     var hw_available:Long = 1
81     var wm_available:Long = 1
82     var blit_hw:Long = 1
83     var blit_hw_CC:Long = 1
84     var blit_hw_A:Long = 1
85     var blit_sw:Long = 1
86     var blit_sw_CC:Long = 1
87     var blit_sw_A:Long = 1
88     var blit_fill:Long = 1
89     var video_mem:Long = 0
90     var vfmt:SDL_PixelFormat = null
91     var current_w:Int = 0
92     var current_h:Int = 0
93   }
94
95   class Overlay {
96     var format:Int = 0
97     var w:Int = 0
98     var h:Int = 0
99     var planes:Int = 0
100     var pitches:Array[Int] = null
101     var pixels:Array[Int] = null
102     var hw_overlay:Int = 1
103   }
104 }