sgl 0.4.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +254 -234
- data/History.txt +6 -0
- data/Manifest.txt +10 -0
- data/Rakefile +27 -7
- data/examples/cocoa1-basic.rb +14 -14
- data/examples/cocoa10-transparent.rb +26 -26
- data/examples/cocoa11-application.rb +13 -13
- data/examples/cocoa2-draw.rb +23 -23
- data/examples/cocoa3-affine.rb +29 -29
- data/examples/cocoa4-font.rb +24 -24
- data/examples/cocoa5-image.rb +22 -22
- data/examples/cocoa6-sound.rb +24 -24
- data/examples/cocoa7-movie.rb +40 -40
- data/examples/cocoa8-movieoverlay.rb +42 -42
- data/examples/cocoa9-streaming.rb +40 -40
- data/examples/opengl1-basic.rb +14 -14
- data/examples/opengl11-application.rb +13 -13
- data/examples/opengl2-draw.rb +23 -23
- data/examples/opengl3-affine.rb +29 -29
- data/examples/sample1.rb +11 -11
- data/examples/sample10.rb +16 -16
- data/examples/sample11.rb +22 -22
- data/examples/sample11a.rb +33 -33
- data/examples/sample12.rb +30 -30
- data/examples/sample12a.rb +35 -35
- data/examples/sample13.rb +116 -116
- data/examples/sample15.rb +24 -24
- data/examples/sample16.rb +31 -31
- data/examples/sample16a.rb +35 -35
- data/examples/sample6.rb +18 -18
- data/examples/sample7.rb +16 -16
- data/examples/sample9.rb +20 -20
- data/examples/testgl.rb +169 -169
- data/lib/sgl/bass.rb +46 -46
- data/lib/sgl/cocoa-app.rb +43 -43
- data/lib/sgl/cocoa-color.rb +65 -65
- data/lib/sgl/cocoa-draw.rb +72 -72
- data/lib/sgl/cocoa-event.rb +229 -229
- data/lib/sgl/cocoa-media.rb +144 -144
- data/lib/sgl/cocoa-notuse.rb +493 -493
- data/lib/sgl/cocoa-window.rb +203 -203
- data/lib/sgl/cocoa.rb +8 -8
- data/lib/sgl/opengl-app.rb +38 -38
- data/lib/sgl/opengl-color.rb +44 -44
- data/lib/sgl/opengl-draw.rb +260 -260
- data/lib/sgl/opengl-event.rb +325 -325
- data/lib/sgl/opengl-modules.rb +22 -22
- data/lib/sgl/opengl-window.rb +224 -224
- data/lib/sgl/opengl.rb +7 -7
- data/lib/sgl/sgl-button.rb +135 -135
- data/lib/sgl/sgl-client.rb +21 -21
- data/lib/sgl/sgl-color.rb +68 -82
- data/lib/sgl/sgl-connect.rb +9 -9
- data/lib/sgl/sgl-server.rb +58 -58
- data/lib/sgl/sgl-spring.rb +216 -216
- data/lib/sgl/version.rb +2 -2
- data/scripts/lib-txt2html.rb +130 -0
- data/scripts/txt2html +2 -63
- data/spec/sgl_spec.rb +13 -0
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +1 -0
- data/test/test_cocoa_app.rb +291 -291
- data/test/test_module_ruby16.rb +30 -30
- data/test/test_opengl_app.rb +147 -147
- data/test/test_opengl_basic.rb +22 -22
- data/test/test_opengl_fullscreen.rb +23 -23
- data/test/test_opengl_novice.rb +35 -35
- data/website/challenge1.html +91 -91
- data/website/challenge1.txt +3 -3
- data/website/challenge2.html +143 -144
- data/website/challenge2.txt +13 -14
- data/website/challenge3.html +66 -63
- data/website/challenge3.txt +7 -7
- data/website/cocoa.html +85 -88
- data/website/cocoa.txt +2 -4
- data/website/description.html +138 -138
- data/website/description.txt +1 -1
- data/website/exercise1.html +262 -264
- data/website/exercise1.txt +58 -53
- data/website/exercise2.html +241 -683
- data/website/exercise2.txt +11 -427
- data/website/exercise3.html +206 -0
- data/website/exercise3.txt +155 -0
- data/website/exercise4.html +198 -0
- data/website/exercise4.txt +151 -0
- data/website/exercise5.html +162 -0
- data/website/exercise5.txt +113 -0
- data/website/exhibition.html +84 -84
- data/website/howto.html +146 -134
- data/website/howto.txt +9 -0
- data/website/index.html +178 -178
- data/website/index.txt +20 -19
- data/website/sound.html +141 -141
- metadata +16 -3
data/website/howto.html
CHANGED
@@ -1,134 +1,146 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
2
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
3
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
-
<head>
|
5
|
-
<link rel="stylesheet" href="stylesheets/screen.css" type="text/css" media="screen" />
|
6
|
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
7
|
-
<title>
|
8
|
-
便利情報
|
9
|
-
</title>
|
10
|
-
<script src="javascripts/rounded_corners_lite.inc.js" type="text/javascript"></script>
|
11
|
-
<style>
|
12
|
-
|
13
|
-
</style>
|
14
|
-
<script type="text/javascript">
|
15
|
-
window.onload = function() {
|
16
|
-
settings = {
|
17
|
-
tl: { radius: 10 },
|
18
|
-
tr: { radius: 10 },
|
19
|
-
bl: { radius: 10 },
|
20
|
-
br: { radius: 10 },
|
21
|
-
antiAlias: true,
|
22
|
-
autoPad: true,
|
23
|
-
validTags: ["div"]
|
24
|
-
}
|
25
|
-
var versionBox = new curvyCorners(settings, document.getElementById("version"));
|
26
|
-
versionBox.applyCornersToAll();
|
27
|
-
}
|
28
|
-
</script>
|
29
|
-
</head>
|
30
|
-
<body>
|
31
|
-
<div id="main">
|
32
|
-
|
33
|
-
<h1>便利情報</h1>
|
34
|
-
<div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/sgl"; return false'>
|
35
|
-
<p>Get Version</p>
|
36
|
-
<a href="http://rubyforge.org/projects/sgl" class="numbers">0.
|
37
|
-
</div>
|
38
|
-
<p>Ruby初心者のための,知ってると便利に使える情報です.</p>
|
39
|
-
|
40
|
-
|
41
|
-
<h2>コメントアウトを活用する</h2>
|
42
|
-
|
43
|
-
|
44
|
-
<p>ある行だけ実行しないようにしたいが,消してしまいたくはないというとき,
|
45
|
-
コメントアウトという方法がある.行の最初に<code>#</code>を入れると,その行だけを
|
46
|
-
実行しないようにできる.</p>
|
47
|
-
|
48
|
-
|
49
|
-
<p>コメントアウトを活用することはとても大事だ.プログラムをかいてみてうま
|
50
|
-
く動かなくなったときは,その行を消してしまうのではなくコメントアウトす
|
51
|
-
ることによって,情報を保存しつつ動作させないようにする.なにをやったら
|
52
|
-
うまくいかなかったのかを記録として残すようにすることが大事である.</p>
|
53
|
-
|
54
|
-
|
55
|
-
<h2>notepadの使い方: コピー&ペースト</h2>
|
56
|
-
|
57
|
-
|
58
|
-
<ul>
|
59
|
-
<li>コピーしたい領域をマウスをドラッグして反転させる.</li>
|
60
|
-
<li>Ctrlを押しながらCを押す.その領域がコピーバッファに入る.</li>
|
61
|
-
<li>挿入したいところにカーソルを合わせ,Ctrlを押しながらVを押すとペーストされる.</li>
|
62
|
-
</ul>
|
63
|
-
|
64
|
-
|
65
|
-
<h2>notepadの使い方: ショートカットキー</h2>
|
66
|
-
|
67
|
-
|
68
|
-
<ul>
|
69
|
-
<li>Ctrl+Sで,ファイルをセーブする.</li>
|
70
|
-
</ul>
|
71
|
-
|
72
|
-
|
73
|
-
<h2>コマンドプロンプトの使い方</h2>
|
74
|
-
|
75
|
-
|
76
|
-
<ul>
|
77
|
-
<li>上キーを押すと,一つ前のコマンドを表示する.同じコマンドを繰り返す時に便利.</li>
|
78
|
-
<li><code>dir</code>で,現在のディレクトリーにあるファイルの一覧を表示する.</li>
|
79
|
-
<li><code>dir *.rb</code>で,ファイルの終わりに<code>.rb</code>がついたファイル一覧を表示する.
|
80
|
-
<ul>
|
81
|
-
<li>このコマンドでちゃんとセーブされているかを確認する.</li>
|
82
|
-
</ul></li>
|
83
|
-
</ul>
|
84
|
-
|
85
|
-
|
86
|
-
<h2
|
87
|
-
|
88
|
-
|
89
|
-
<p
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
<p>
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
<
|
121
|
-
|
122
|
-
|
123
|
-
<
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<link rel="stylesheet" href="stylesheets/screen.css" type="text/css" media="screen" />
|
6
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
7
|
+
<title>
|
8
|
+
便利情報
|
9
|
+
</title>
|
10
|
+
<script src="javascripts/rounded_corners_lite.inc.js" type="text/javascript"></script>
|
11
|
+
<style>
|
12
|
+
|
13
|
+
</style>
|
14
|
+
<script type="text/javascript">
|
15
|
+
window.onload = function() {
|
16
|
+
settings = {
|
17
|
+
tl: { radius: 10 },
|
18
|
+
tr: { radius: 10 },
|
19
|
+
bl: { radius: 10 },
|
20
|
+
br: { radius: 10 },
|
21
|
+
antiAlias: true,
|
22
|
+
autoPad: true,
|
23
|
+
validTags: ["div"]
|
24
|
+
}
|
25
|
+
var versionBox = new curvyCorners(settings, document.getElementById("version"));
|
26
|
+
versionBox.applyCornersToAll();
|
27
|
+
}
|
28
|
+
</script>
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="main">
|
32
|
+
|
33
|
+
<h1>便利情報</h1>
|
34
|
+
<div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/sgl"; return false'>
|
35
|
+
<p>Get Version</p>
|
36
|
+
<a href="http://rubyforge.org/projects/sgl" class="numbers">1.0.0</a>
|
37
|
+
</div>
|
38
|
+
<p>Ruby初心者のための,知ってると便利に使える情報です.</p>
|
39
|
+
|
40
|
+
|
41
|
+
<h2>コメントアウトを活用する</h2>
|
42
|
+
|
43
|
+
|
44
|
+
<p>ある行だけ実行しないようにしたいが,消してしまいたくはないというとき,
|
45
|
+
コメントアウトという方法がある.行の最初に<code>#</code>を入れると,その行だけを
|
46
|
+
実行しないようにできる.</p>
|
47
|
+
|
48
|
+
|
49
|
+
<p>コメントアウトを活用することはとても大事だ.プログラムをかいてみてうま
|
50
|
+
く動かなくなったときは,その行を消してしまうのではなくコメントアウトす
|
51
|
+
ることによって,情報を保存しつつ動作させないようにする.なにをやったら
|
52
|
+
うまくいかなかったのかを記録として残すようにすることが大事である.</p>
|
53
|
+
|
54
|
+
|
55
|
+
<h2>notepadの使い方: コピー&ペースト</h2>
|
56
|
+
|
57
|
+
|
58
|
+
<ul>
|
59
|
+
<li>コピーしたい領域をマウスをドラッグして反転させる.</li>
|
60
|
+
<li>Ctrlを押しながらCを押す.その領域がコピーバッファに入る.</li>
|
61
|
+
<li>挿入したいところにカーソルを合わせ,Ctrlを押しながらVを押すとペーストされる.</li>
|
62
|
+
</ul>
|
63
|
+
|
64
|
+
|
65
|
+
<h2>notepadの使い方: ショートカットキー</h2>
|
66
|
+
|
67
|
+
|
68
|
+
<ul>
|
69
|
+
<li>Ctrl+Sで,ファイルをセーブする.</li>
|
70
|
+
</ul>
|
71
|
+
|
72
|
+
|
73
|
+
<h2>コマンドプロンプトの使い方</h2>
|
74
|
+
|
75
|
+
|
76
|
+
<ul>
|
77
|
+
<li>上キーを押すと,一つ前のコマンドを表示する.同じコマンドを繰り返す時に便利.</li>
|
78
|
+
<li><code>dir</code>で,現在のディレクトリーにあるファイルの一覧を表示する.</li>
|
79
|
+
<li><code>dir *.rb</code>で,ファイルの終わりに<code>.rb</code>がついたファイル一覧を表示する.
|
80
|
+
<ul>
|
81
|
+
<li>このコマンドでちゃんとセーブされているかを確認する.</li>
|
82
|
+
</ul></li>
|
83
|
+
</ul>
|
84
|
+
|
85
|
+
|
86
|
+
<h2>課題の注意点</h2>
|
87
|
+
|
88
|
+
|
89
|
+
<p>課題はいずれもwindowサイズなどは自由.課題例は100,100のサイズになって
|
90
|
+
いるが,より大きいwindowサイズを選択してもよい.</p>
|
91
|
+
|
92
|
+
|
93
|
+
<p>ファイル名は必ず指定のものにし,Z:に保存する.指定のファイル名のファイ
|
94
|
+
ルが保存されているかどうかで課題提出を判定する.ファイル名が違う場合は
|
95
|
+
提出してないことになってしまうので,注意する.</p>
|
96
|
+
|
97
|
+
|
98
|
+
<h2>Rubyとは?</h2>
|
99
|
+
|
100
|
+
|
101
|
+
<p>sglはオブジェクト指向スクリプト言語Rubyを基盤として用いている.もしプ
|
102
|
+
ログラミング言語としてのRubyを学びたい場合は直接Ruby についての本を参
|
103
|
+
照する.</p>
|
104
|
+
|
105
|
+
|
106
|
+
<ul>
|
107
|
+
<li><a href="http://www.ruby-lang.org/ja/">Ruby</a></li>
|
108
|
+
</ul>
|
109
|
+
|
110
|
+
|
111
|
+
<p>下記の書籍をおすすめする.</p>
|
112
|
+
|
113
|
+
|
114
|
+
<ul>
|
115
|
+
<li><a href="http://www.amazon.co.jp/dp/4274066428/etocom05-22">プログラミングRuby 第2版 言語編</a></li>
|
116
|
+
<li><a href="http://www.amazon.co.jp/dp/4274066436/etocom05-22">プログラミングRuby 第2版 ライブラリ編</a></li>
|
117
|
+
</ul>
|
118
|
+
|
119
|
+
|
120
|
+
<h2>OpenGLとは?</h2>
|
121
|
+
|
122
|
+
|
123
|
+
<p>OpenGLとはグラフィックを描画するためのプログラミングにおける方法の一つ
|
124
|
+
である.sglはグラフィック描画の仕組みとして内部的にOpenGLを使っている.
|
125
|
+
もしsglの提供するグラフィックを超えてグラフィックを使いたい場合は,直
|
126
|
+
接OpenGLを使うこともできる.</p>
|
127
|
+
|
128
|
+
|
129
|
+
<p>OpenGLの使い方は,下記のテキストをおすすめする.</p>
|
130
|
+
|
131
|
+
|
132
|
+
<ul>
|
133
|
+
<li><a href="http://www.exa-corp.co.jp/solution/UBIQ/OpenGL/index.shtml">OpenGLプログラミングコース</a>
|
134
|
+
<ul>
|
135
|
+
<li><a href="http://www.exa-corp.co.jp/solution/UBIQ/OpenGL/OpenGL-text-091.pdf">OpenGLプログラミングテキスト</a></li>
|
136
|
+
</ul></li>
|
137
|
+
</ul>
|
138
|
+
<p class="coda">
|
139
|
+
30th June 2007<br>
|
140
|
+
</p>
|
141
|
+
</div>
|
142
|
+
|
143
|
+
<!-- insert site tracking codes here, like Google Urchin -->
|
144
|
+
|
145
|
+
</body>
|
146
|
+
</html>
|
data/website/howto.txt
CHANGED
@@ -30,6 +30,15 @@ h2. コマンドプロンプトの使い方
|
|
30
30
|
* @dir *.rb@で,ファイルの終わりに@.rb@がついたファイル一覧を表示する.
|
31
31
|
** このコマンドでちゃんとセーブされているかを確認する.
|
32
32
|
|
33
|
+
h2. 課題の注意点
|
34
|
+
|
35
|
+
課題はいずれもwindowサイズなどは自由.課題例は100,100のサイズになって
|
36
|
+
いるが,より大きいwindowサイズを選択してもよい.
|
37
|
+
|
38
|
+
ファイル名は必ず指定のものにし,Z:に保存する.指定のファイル名のファイ
|
39
|
+
ルが保存されているかどうかで課題提出を判定する.ファイル名が違う場合は
|
40
|
+
提出してないことになってしまうので,注意する.
|
41
|
+
|
33
42
|
h2. Rubyとは?
|
34
43
|
|
35
44
|
sglはオブジェクト指向スクリプト言語Rubyを基盤として用いている.もしプ
|
data/website/index.html
CHANGED
@@ -1,178 +1,178 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
2
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
3
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
-
<head>
|
5
|
-
<link rel="stylesheet" href="stylesheets/screen.css" type="text/css" media="screen" />
|
6
|
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
7
|
-
<title>
|
8
|
-
sgl → simple generic library
|
9
|
-
</title>
|
10
|
-
<script src="javascripts/rounded_corners_lite.inc.js" type="text/javascript"></script>
|
11
|
-
<style>
|
12
|
-
|
13
|
-
</style>
|
14
|
-
<script type="text/javascript">
|
15
|
-
window.onload = function() {
|
16
|
-
settings = {
|
17
|
-
tl: { radius: 10 },
|
18
|
-
tr: { radius: 10 },
|
19
|
-
bl: { radius: 10 },
|
20
|
-
br: { radius: 10 },
|
21
|
-
antiAlias: true,
|
22
|
-
autoPad: true,
|
23
|
-
validTags: ["div"]
|
24
|
-
}
|
25
|
-
var versionBox = new curvyCorners(settings, document.getElementById("version"));
|
26
|
-
versionBox.applyCornersToAll();
|
27
|
-
}
|
28
|
-
</script>
|
29
|
-
</head>
|
30
|
-
<body>
|
31
|
-
<div id="main">
|
32
|
-
|
33
|
-
<h1>sgl → simple generic library</h1>
|
34
|
-
<div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/sgl"; return false'>
|
35
|
-
<p>Get Version</p>
|
36
|
-
<a href="http://rubyforge.org/projects/sgl" class="numbers">0.
|
37
|
-
</div>
|
38
|
-
<h2>What is sgl?</h2>
|
39
|
-
|
40
|
-
|
41
|
-
<p>‘sgl’ is a simgple generic library to create a program with graphics and sound.</p>
|
42
|
-
|
43
|
-
|
44
|
-
<h2>Requirement</h2>
|
45
|
-
|
46
|
-
|
47
|
-
<h3>Windows</h3>
|
48
|
-
|
49
|
-
|
50
|
-
<ul>
|
51
|
-
<li>Ruby 1.8.5 or later</li>
|
52
|
-
<li>Ruby/OpenGL</li>
|
53
|
-
<li>Ruby/Math3D</li>
|
54
|
-
<li>Ruby/SDL</li>
|
55
|
-
</ul>
|
56
|
-
|
57
|
-
|
58
|
-
<p>You can see <a href="http://eto.com/d/RubySDLonWindows.html">Ruby/SDL on Windows</a>
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
<h3>Mac <span class="caps">OS X</span></h3>
|
63
|
-
|
64
|
-
|
65
|
-
<ul>
|
66
|
-
<li>Mac <span class="caps">OS X 10</span>.3 or later</li>
|
67
|
-
<li>Ruby 1.8.5 or later</li>
|
68
|
-
<li>X Window system</li>
|
69
|
-
</ul>
|
70
|
-
|
71
|
-
|
72
|
-
<h2>Installing</h2>
|
73
|
-
|
74
|
-
|
75
|
-
<pre syntax="ruby">sudo gem install sgl</pre>
|
76
|
-
|
77
|
-
<h2>The basics</h2>
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
require "sgl"
|
83
|
-
window 100, 100
|
84
|
-
line 0, 0, 100, 100
|
85
|
-
wait
|
86
|
-
</pre>
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
<
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
<
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
</
|
133
|
-
|
134
|
-
|
135
|
-
<
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
<
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
<li><a href="
|
147
|
-
<li><a href="challenge1.html">
|
148
|
-
<li><a href="challenge2.html">
|
149
|
-
<li><a href="challenge3.html">
|
150
|
-
</ul></li>
|
151
|
-
</ul>
|
152
|
-
|
153
|
-
|
154
|
-
<h2>Repositry</h2>
|
155
|
-
|
156
|
-
|
157
|
-
<p>The trunk repository is <code>svn://rubyforge.org/var/svn/sgl/trunk</code> for anonymous access.</p>
|
158
|
-
|
159
|
-
|
160
|
-
<h2>License</h2>
|
161
|
-
|
162
|
-
|
163
|
-
<p>Ruby License.</p>
|
164
|
-
|
165
|
-
|
166
|
-
<h2>Contact</h2>
|
167
|
-
|
168
|
-
|
169
|
-
<p>Comments are welcome. Send an email to
|
170
|
-
<p class="coda">
|
171
|
-
|
172
|
-
</p>
|
173
|
-
</div>
|
174
|
-
|
175
|
-
<!-- insert site tracking codes here, like Google Urchin -->
|
176
|
-
|
177
|
-
</body>
|
178
|
-
</html>
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<link rel="stylesheet" href="stylesheets/screen.css" type="text/css" media="screen" />
|
6
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
7
|
+
<title>
|
8
|
+
sgl → simple generic library
|
9
|
+
</title>
|
10
|
+
<script src="javascripts/rounded_corners_lite.inc.js" type="text/javascript"></script>
|
11
|
+
<style>
|
12
|
+
|
13
|
+
</style>
|
14
|
+
<script type="text/javascript">
|
15
|
+
window.onload = function() {
|
16
|
+
settings = {
|
17
|
+
tl: { radius: 10 },
|
18
|
+
tr: { radius: 10 },
|
19
|
+
bl: { radius: 10 },
|
20
|
+
br: { radius: 10 },
|
21
|
+
antiAlias: true,
|
22
|
+
autoPad: true,
|
23
|
+
validTags: ["div"]
|
24
|
+
}
|
25
|
+
var versionBox = new curvyCorners(settings, document.getElementById("version"));
|
26
|
+
versionBox.applyCornersToAll();
|
27
|
+
}
|
28
|
+
</script>
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="main">
|
32
|
+
|
33
|
+
<h1>sgl → simple generic library</h1>
|
34
|
+
<div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/sgl"; return false'>
|
35
|
+
<p>Get Version</p>
|
36
|
+
<a href="http://rubyforge.org/projects/sgl" class="numbers">1.0.0</a>
|
37
|
+
</div>
|
38
|
+
<h2>What is sgl?</h2>
|
39
|
+
|
40
|
+
|
41
|
+
<p>‘sgl’ is a simgple generic library to create a program with graphics and sound.</p>
|
42
|
+
|
43
|
+
|
44
|
+
<h2>Requirement</h2>
|
45
|
+
|
46
|
+
|
47
|
+
<h3>Windows</h3>
|
48
|
+
|
49
|
+
|
50
|
+
<ul>
|
51
|
+
<li>Ruby 1.8.5 or later</li>
|
52
|
+
<li>Ruby/OpenGL</li>
|
53
|
+
<li>Ruby/Math3D</li>
|
54
|
+
<li>Ruby/SDL</li>
|
55
|
+
</ul>
|
56
|
+
|
57
|
+
|
58
|
+
<p>You can see <a href="http://eto.com/d/RubySDLonWindows.html">Ruby/SDL on Windows</a>
|
59
|
+
install documnet.</p>
|
60
|
+
|
61
|
+
|
62
|
+
<h3>Mac <span class="caps">OS X</span></h3>
|
63
|
+
|
64
|
+
|
65
|
+
<ul>
|
66
|
+
<li>Mac <span class="caps">OS X 10</span>.3 or later</li>
|
67
|
+
<li>Ruby 1.8.5 or later</li>
|
68
|
+
<li>X Window system</li>
|
69
|
+
</ul>
|
70
|
+
|
71
|
+
|
72
|
+
<h2>Installing</h2>
|
73
|
+
|
74
|
+
|
75
|
+
<pre syntax="ruby">sudo gem install sgl</pre>
|
76
|
+
|
77
|
+
<h2>The basics</h2>
|
78
|
+
|
79
|
+
|
80
|
+
<pre syntax="ruby">
|
81
|
+
# test1.rb
|
82
|
+
require "sgl"
|
83
|
+
window 100, 100
|
84
|
+
line 0, 0, 100, 100
|
85
|
+
wait
|
86
|
+
</pre>
|
87
|
+
|
88
|
+
<pre syntax="ruby">
|
89
|
+
# test2.rb
|
90
|
+
require "sgl"
|
91
|
+
window 100, 100
|
92
|
+
background 0
|
93
|
+
color 100
|
94
|
+
line 0, 0, 100, 100
|
95
|
+
wait
|
96
|
+
</pre>
|
97
|
+
|
98
|
+
<pre syntax="ruby">
|
99
|
+
# test3.rb
|
100
|
+
require "sgl"
|
101
|
+
|
102
|
+
def setup
|
103
|
+
window 100, 100
|
104
|
+
end
|
105
|
+
|
106
|
+
def display
|
107
|
+
line 0, 0, 100, 100
|
108
|
+
end
|
109
|
+
|
110
|
+
mainloop
|
111
|
+
</pre>
|
112
|
+
|
113
|
+
<h2>Documents</h2>
|
114
|
+
|
115
|
+
|
116
|
+
<ul>
|
117
|
+
<li><a href="rdoc/"><span class="caps">API</span> Reference</a></li>
|
118
|
+
<li><a href="cocoa.html">Description of sgl-cocoa</a></li>
|
119
|
+
</ul>
|
120
|
+
|
121
|
+
|
122
|
+
<ul>
|
123
|
+
<li>Pages below are in Japanese
|
124
|
+
<ul>
|
125
|
+
<li><a href="description.html">Description</a></li>
|
126
|
+
<li><a href="howto.html">How to for Beginner</a></li>
|
127
|
+
<li><a href="sound.html">How to use Sound function</a></li>
|
128
|
+
</ul></li>
|
129
|
+
</ul>
|
130
|
+
|
131
|
+
|
132
|
+
<h2>Classes</h2>
|
133
|
+
|
134
|
+
|
135
|
+
<p>We did some classes using sgl in some art schools.
|
136
|
+
You can see some materials for the classes.</p>
|
137
|
+
|
138
|
+
|
139
|
+
<ul>
|
140
|
+
<li>Pages below are in Japanese
|
141
|
+
<ul>
|
142
|
+
<li><a href="exercise1.html">Exercise 1</a></li>
|
143
|
+
<li><a href="exercise2.html">Exercise 2</a></li>
|
144
|
+
<li><a href="exercise3.html">Exercise 3</a></li>
|
145
|
+
<li><a href="exercise4.html">Exercise 4</a></li>
|
146
|
+
<li><a href="exercise5.html">Exercise 5</a></li>
|
147
|
+
<li><a href="challenge1.html">Special Exercise 1</a></li>
|
148
|
+
<li><a href="challenge2.html">Special Exercise 2</a></li>
|
149
|
+
<li><a href="challenge3.html">Final Exercise</a></li>
|
150
|
+
</ul></li>
|
151
|
+
</ul>
|
152
|
+
|
153
|
+
|
154
|
+
<h2>Repositry</h2>
|
155
|
+
|
156
|
+
|
157
|
+
<p>The trunk repository is <code>svn://rubyforge.org/var/svn/sgl/trunk</code> for anonymous access.</p>
|
158
|
+
|
159
|
+
|
160
|
+
<h2>License</h2>
|
161
|
+
|
162
|
+
|
163
|
+
<p>Ruby License.</p>
|
164
|
+
|
165
|
+
|
166
|
+
<h2>Contact</h2>
|
167
|
+
|
168
|
+
|
169
|
+
<p>Comments are welcome. Send an email to Kouichirou Eto “eto at rubyforge dot org”.</p>
|
170
|
+
<p class="coda">
|
171
|
+
1st July 2007<br>
|
172
|
+
</p>
|
173
|
+
</div>
|
174
|
+
|
175
|
+
<!-- insert site tracking codes here, like Google Urchin -->
|
176
|
+
|
177
|
+
</body>
|
178
|
+
</html>
|