rubysdl 2.1.0 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,7 +19,7 @@
19
19
  */
20
20
  #ifdef HAVE_SMPEG
21
21
  #include "rubysdl.h"
22
- #include "smpeg/smpeg.h"
22
+ #include <smpeg.h>
23
23
 
24
24
  #ifdef HAVE_SDL_MIXER
25
25
  #include "SDL_mixer.h"
@@ -1,5 +1,8 @@
1
+ # a sample with ruby-opengl and Ruby/SDL
1
2
  require 'sdl'
2
- require 'opengl'
3
+ require 'gl'
4
+
5
+ include Gl
3
6
 
4
7
  # initialize SDL and opengl
5
8
  SDL.init SDL::INIT_VIDEO
@@ -10,18 +13,18 @@ SDL::GL.set_attr SDL::GL_DEPTH_SIZE,16
10
13
  SDL::GL.set_attr SDL::GL_DOUBLEBUFFER,1
11
14
  SDL::Screen.open 640,400,16,SDL::OPENGL
12
15
 
13
- GL::Viewport( 0, 0, 640, 400 );
14
- GL::MatrixMode( GL::PROJECTION );
15
- GL::LoadIdentity( );
16
+ glViewport( 0, 0, 640, 400 );
17
+ glMatrixMode( GL_PROJECTION );
18
+ glLoadIdentity( );
16
19
 
17
- GL::MatrixMode( GL::MODELVIEW );
18
- GL::LoadIdentity( );
20
+ glMatrixMode( GL_MODELVIEW );
21
+ glLoadIdentity( );
19
22
 
20
- GL::Enable(GL::DEPTH_TEST);
23
+ glEnable(GL_DEPTH_TEST);
21
24
 
22
- GL::DepthFunc(GL::LESS);
25
+ glDepthFunc(GL_LESS);
23
26
 
24
- GL::ShadeModel(GL::SMOOTH);
27
+ glShadeModel(GL_SMOOTH);
25
28
 
26
29
  shadedCube=true
27
30
 
@@ -55,110 +58,110 @@ loop do
55
58
  end
56
59
  end
57
60
 
58
- GL.ClearColor(0.0, 0.0, 0.0, 1.0);
59
- GL.Clear(GL::COLOR_BUFFER_BIT|GL::DEPTH_BUFFER_BIT);
61
+ glClearColor(0.0, 0.0, 0.0, 1.0);
62
+ glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
60
63
 
61
64
 
62
- GL::Begin(GL::QUADS)
65
+ glBegin(GL_QUADS)
63
66
 
64
67
  if shadedCube then
65
- GL::Color(color[0]);
66
- GL::Vertex(cube[0]);
67
- GL::Color(color[1]);
68
- GL::Vertex(cube[1]);
69
- GL::Color(color[2]);
70
- GL::Vertex(cube[2]);
71
- GL::Color(color[3]);
72
- GL::Vertex(cube[3]);
68
+ glColor(color[0]);
69
+ glVertex(cube[0]);
70
+ glColor(color[1]);
71
+ glVertex(cube[1]);
72
+ glColor(color[2]);
73
+ glVertex(cube[2]);
74
+ glColor(color[3]);
75
+ glVertex(cube[3]);
73
76
 
74
- GL::Color(color[3]);
75
- GL::Vertex(cube[3]);
76
- GL::Color(color[4]);
77
- GL::Vertex(cube[4]);
78
- GL::Color(color[7]);
79
- GL::Vertex(cube[7]);
80
- GL::Color(color[2]);
81
- GL::Vertex(cube[2]);
77
+ glColor(color[3]);
78
+ glVertex(cube[3]);
79
+ glColor(color[4]);
80
+ glVertex(cube[4]);
81
+ glColor(color[7]);
82
+ glVertex(cube[7]);
83
+ glColor(color[2]);
84
+ glVertex(cube[2]);
82
85
 
83
- GL::Color(color[0]);
84
- GL::Vertex(cube[0]);
85
- GL::Color(color[5]);
86
- GL::Vertex(cube[5]);
87
- GL::Color(color[6]);
88
- GL::Vertex(cube[6]);
89
- GL::Color(color[1]);
90
- GL::Vertex(cube[1]);
86
+ glColor(color[0]);
87
+ glVertex(cube[0]);
88
+ glColor(color[5]);
89
+ glVertex(cube[5]);
90
+ glColor(color[6]);
91
+ glVertex(cube[6]);
92
+ glColor(color[1]);
93
+ glVertex(cube[1]);
91
94
 
92
- GL::Color(color[5]);
93
- GL::Vertex(cube[5]);
94
- GL::Color(color[4]);
95
- GL::Vertex(cube[4]);
96
- GL::Color(color[7]);
97
- GL::Vertex(cube[7]);
98
- GL::Color(color[6]);
99
- GL::Vertex(cube[6]);
95
+ glColor(color[5]);
96
+ glVertex(cube[5]);
97
+ glColor(color[4]);
98
+ glVertex(cube[4]);
99
+ glColor(color[7]);
100
+ glVertex(cube[7]);
101
+ glColor(color[6]);
102
+ glVertex(cube[6]);
100
103
 
101
- GL::Color(color[5]);
102
- GL::Vertex(cube[5]);
103
- GL::Color(color[0]);
104
- GL::Vertex(cube[0]);
105
- GL::Color(color[3]);
106
- GL::Vertex(cube[3]);
107
- GL::Color(color[4]);
108
- GL::Vertex(cube[4]);
104
+ glColor(color[5]);
105
+ glVertex(cube[5]);
106
+ glColor(color[0]);
107
+ glVertex(cube[0]);
108
+ glColor(color[3]);
109
+ glVertex(cube[3]);
110
+ glColor(color[4]);
111
+ glVertex(cube[4]);
109
112
 
110
- GL::Color(color[6]);
111
- GL::Vertex(cube[6]);
112
- GL::Color(color[1]);
113
- GL::Vertex(cube[1]);
114
- GL::Color(color[2]);
115
- GL::Vertex(cube[2]);
116
- GL::Color(color[7]);
117
- GL::Vertex(cube[7]);
113
+ glColor(color[6]);
114
+ glVertex(cube[6]);
115
+ glColor(color[1]);
116
+ glVertex(cube[1]);
117
+ glColor(color[2]);
118
+ glVertex(cube[2]);
119
+ glColor(color[7]);
120
+ glVertex(cube[7]);
118
121
 
119
122
  else
120
- GL::Color(1.0, 0.0, 0.0);
121
- GL::Vertex(cube[0]);
122
- GL::Vertex(cube[1]);
123
- GL::Vertex(cube[2]);
124
- GL::Vertex(cube[3]);
123
+ glColor(1.0, 0.0, 0.0);
124
+ glVertex(cube[0]);
125
+ glVertex(cube[1]);
126
+ glVertex(cube[2]);
127
+ glVertex(cube[3]);
125
128
 
126
- GL::Color(0.0, 1.0, 0.0);
127
- GL::Vertex(cube[3]);
128
- GL::Vertex(cube[4]);
129
- GL::Vertex(cube[7]);
130
- GL::Vertex(cube[2]);
129
+ glColor(0.0, 1.0, 0.0);
130
+ glVertex(cube[3]);
131
+ glVertex(cube[4]);
132
+ glVertex(cube[7]);
133
+ glVertex(cube[2]);
131
134
 
132
- GL::Color(0.0, 0.0, 1.0);
133
- GL::Vertex(cube[0]);
134
- GL::Vertex(cube[5]);
135
- GL::Vertex(cube[6]);
136
- GL::Vertex(cube[1]);
135
+ glColor(0.0, 0.0, 1.0);
136
+ glVertex(cube[0]);
137
+ glVertex(cube[5]);
138
+ glVertex(cube[6]);
139
+ glVertex(cube[1]);
137
140
 
138
- GL::Color(0.0, 1.0, 1.0);
139
- GL::Vertex(cube[5]);
140
- GL::Vertex(cube[4]);
141
- GL::Vertex(cube[7]);
142
- GL::Vertex(cube[6]);
141
+ glColor(0.0, 1.0, 1.0);
142
+ glVertex(cube[5]);
143
+ glVertex(cube[4]);
144
+ glVertex(cube[7]);
145
+ glVertex(cube[6]);
143
146
 
144
- GL::Color(1.0, 1.0, 0.0);
145
- GL::Vertex(cube[5]);
146
- GL::Vertex(cube[0]);
147
- GL::Vertex(cube[3]);
148
- GL::Vertex(cube[4]);
147
+ glColor(1.0, 1.0, 0.0);
148
+ glVertex(cube[5]);
149
+ glVertex(cube[0]);
150
+ glVertex(cube[3]);
151
+ glVertex(cube[4]);
149
152
 
150
- GL::Color(1.0, 0.0, 1.0);
151
- GL::Vertex(cube[6]);
152
- GL::Vertex(cube[1]);
153
- GL::Vertex(cube[2]);
154
- GL::Vertex(cube[7]);
153
+ glColor(1.0, 0.0, 1.0);
154
+ glVertex(cube[6]);
155
+ glVertex(cube[1]);
156
+ glVertex(cube[2]);
157
+ glVertex(cube[7]);
155
158
 
156
159
  end
157
160
 
158
- GL::End()
161
+ glEnd()
159
162
 
160
- GL::MatrixMode(GL::MODELVIEW);
161
- GL::Rotate(5.0, 1.0, 1.0, 1.0);
163
+ glMatrixMode(GL_MODELVIEW);
164
+ glRotate(5.0, 1.0, 1.0, 1.0);
162
165
 
163
166
  SDL::GL.swap_buffers
164
167
 
@@ -0,0 +1,166 @@
1
+ # a sample for old OpenGL Interface for Ruby
2
+ require 'sdl'
3
+ require 'opengl'
4
+
5
+ # initialize SDL and opengl
6
+ SDL.init SDL::INIT_VIDEO
7
+ SDL::GL.set_attr SDL::GL_RED_SIZE,5
8
+ SDL::GL.set_attr SDL::GL_GREEN_SIZE,5
9
+ SDL::GL.set_attr SDL::GL_BLUE_SIZE,5
10
+ SDL::GL.set_attr SDL::GL_DEPTH_SIZE,16
11
+ SDL::GL.set_attr SDL::GL_DOUBLEBUFFER,1
12
+ SDL::Screen.open 640,400,16,SDL::OPENGL
13
+
14
+ GL::Viewport( 0, 0, 640, 400 );
15
+ GL::MatrixMode( GL::PROJECTION );
16
+ GL::LoadIdentity( );
17
+
18
+ GL::MatrixMode( GL::MODELVIEW );
19
+ GL::LoadIdentity( );
20
+
21
+ GL::Enable(GL::DEPTH_TEST);
22
+
23
+ GL::DepthFunc(GL::LESS);
24
+
25
+ GL::ShadeModel(GL::SMOOTH);
26
+
27
+ shadedCube=true
28
+
29
+ color =
30
+ [[ 1.0, 1.0, 0.0],
31
+ [ 1.0, 0.0, 0.0],
32
+ [ 0.0, 0.0, 0.0],
33
+ [ 0.0, 1.0, 0.0],
34
+ [ 0.0, 1.0, 1.0],
35
+ [ 1.0, 1.0, 1.0],
36
+ [ 1.0, 0.0, 1.0],
37
+ [ 0.0, 0.0, 1.0]]
38
+
39
+ cube =
40
+ [[ 0.5, 0.5, -0.5],
41
+ [ 0.5, -0.5, -0.5],
42
+ [-0.5, -0.5, -0.5],
43
+ [-0.5, 0.5, -0.5],
44
+ [-0.5, 0.5, 0.5],
45
+ [ 0.5, 0.5, 0.5],
46
+ [ 0.5, -0.5, 0.5],
47
+ [-0.5, -0.5, 0.5]]
48
+
49
+
50
+ loop do
51
+
52
+ while event = SDL::Event2.poll
53
+ case event
54
+ when SDL::Event2::Quit, SDL::Event2::KeyDown
55
+ exit
56
+ end
57
+ end
58
+
59
+ GL.ClearColor(0.0, 0.0, 0.0, 1.0);
60
+ GL.Clear(GL::COLOR_BUFFER_BIT|GL::DEPTH_BUFFER_BIT);
61
+
62
+
63
+ GL::Begin(GL::QUADS)
64
+
65
+ if shadedCube then
66
+ GL::Color(color[0]);
67
+ GL::Vertex(cube[0]);
68
+ GL::Color(color[1]);
69
+ GL::Vertex(cube[1]);
70
+ GL::Color(color[2]);
71
+ GL::Vertex(cube[2]);
72
+ GL::Color(color[3]);
73
+ GL::Vertex(cube[3]);
74
+
75
+ GL::Color(color[3]);
76
+ GL::Vertex(cube[3]);
77
+ GL::Color(color[4]);
78
+ GL::Vertex(cube[4]);
79
+ GL::Color(color[7]);
80
+ GL::Vertex(cube[7]);
81
+ GL::Color(color[2]);
82
+ GL::Vertex(cube[2]);
83
+
84
+ GL::Color(color[0]);
85
+ GL::Vertex(cube[0]);
86
+ GL::Color(color[5]);
87
+ GL::Vertex(cube[5]);
88
+ GL::Color(color[6]);
89
+ GL::Vertex(cube[6]);
90
+ GL::Color(color[1]);
91
+ GL::Vertex(cube[1]);
92
+
93
+ GL::Color(color[5]);
94
+ GL::Vertex(cube[5]);
95
+ GL::Color(color[4]);
96
+ GL::Vertex(cube[4]);
97
+ GL::Color(color[7]);
98
+ GL::Vertex(cube[7]);
99
+ GL::Color(color[6]);
100
+ GL::Vertex(cube[6]);
101
+
102
+ GL::Color(color[5]);
103
+ GL::Vertex(cube[5]);
104
+ GL::Color(color[0]);
105
+ GL::Vertex(cube[0]);
106
+ GL::Color(color[3]);
107
+ GL::Vertex(cube[3]);
108
+ GL::Color(color[4]);
109
+ GL::Vertex(cube[4]);
110
+
111
+ GL::Color(color[6]);
112
+ GL::Vertex(cube[6]);
113
+ GL::Color(color[1]);
114
+ GL::Vertex(cube[1]);
115
+ GL::Color(color[2]);
116
+ GL::Vertex(cube[2]);
117
+ GL::Color(color[7]);
118
+ GL::Vertex(cube[7]);
119
+
120
+ else
121
+ GL::Color(1.0, 0.0, 0.0);
122
+ GL::Vertex(cube[0]);
123
+ GL::Vertex(cube[1]);
124
+ GL::Vertex(cube[2]);
125
+ GL::Vertex(cube[3]);
126
+
127
+ GL::Color(0.0, 1.0, 0.0);
128
+ GL::Vertex(cube[3]);
129
+ GL::Vertex(cube[4]);
130
+ GL::Vertex(cube[7]);
131
+ GL::Vertex(cube[2]);
132
+
133
+ GL::Color(0.0, 0.0, 1.0);
134
+ GL::Vertex(cube[0]);
135
+ GL::Vertex(cube[5]);
136
+ GL::Vertex(cube[6]);
137
+ GL::Vertex(cube[1]);
138
+
139
+ GL::Color(0.0, 1.0, 1.0);
140
+ GL::Vertex(cube[5]);
141
+ GL::Vertex(cube[4]);
142
+ GL::Vertex(cube[7]);
143
+ GL::Vertex(cube[6]);
144
+
145
+ GL::Color(1.0, 1.0, 0.0);
146
+ GL::Vertex(cube[5]);
147
+ GL::Vertex(cube[0]);
148
+ GL::Vertex(cube[3]);
149
+ GL::Vertex(cube[4]);
150
+
151
+ GL::Color(1.0, 0.0, 1.0);
152
+ GL::Vertex(cube[6]);
153
+ GL::Vertex(cube[1]);
154
+ GL::Vertex(cube[2]);
155
+ GL::Vertex(cube[7]);
156
+
157
+ end
158
+
159
+ GL::End()
160
+
161
+ GL::MatrixMode(GL::MODELVIEW);
162
+ GL::Rotate(5.0, 1.0, 1.0, 1.0);
163
+
164
+ SDL::GL.swap_buffers
165
+
166
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubysdl
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ohbayashi Ippei
@@ -9,11 +9,11 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-03-17 00:00:00 +09:00
12
+ date: 2009-12-03 00:00:00 +09:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
16
- description:
16
+ description: " Ruby/SDL is an extension library to use SDL(Simple DirectMedia\n Layer). This library enables you to control audio, keyboard,\n mouse, joystick, 3D hardware via OpenGL, and 2D video \n framebuffer. Ruby/SDL is used by games and visual demos.\n"
17
17
  email: ohai@kmc.gr.jp
18
18
  executables: []
19
19
 
@@ -34,13 +34,10 @@ files:
34
34
  - lib/sdl.rb
35
35
  - lib/rubysdl_compatible_ver1.rb
36
36
  - rubysdl.h
37
- - rubysdl_const_list.txt
38
- - rubysdl_doc_old.rd
39
37
  - rubysdl_ref.rd
40
38
  - rubysdl_ref.html
41
39
  - rubysdl_ref.en.rd
42
40
  - rubysdl_ref.en.html
43
- - rubysdl_doc_old.en.rd
44
41
  - rubysdl_event.c
45
42
  - rubysdl_event_key.c
46
43
  - rubysdl_main.c
@@ -71,6 +68,7 @@ files:
71
68
  - sample/cdrom.rb
72
69
  - sample/playmod.rb
73
70
  - sample/testgl.rb
71
+ - sample/testgl_old.rb
74
72
  - sample/icon.bmp
75
73
  - sample/cursor.rb
76
74
  - sample/event2.rb
@@ -123,8 +121,10 @@ files:
123
121
  - doc-en/time.rsd
124
122
  - doc-en/video.rsd
125
123
  - doc-en/wm.rsd
126
- has_rdoc: false
124
+ has_rdoc: true
127
125
  homepage: http://www.kmc.gr.jp/~ohai/
126
+ licenses: []
127
+
128
128
  post_install_message:
129
129
  rdoc_options: []
130
130
 
@@ -144,10 +144,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
144
  version:
145
145
  requirements: []
146
146
 
147
- rubyforge_project:
148
- rubygems_version: 1.2.0
147
+ rubyforge_project: rubysdl
148
+ rubygems_version: 1.3.4
149
149
  signing_key:
150
- specification_version: 2
150
+ specification_version: 3
151
151
  summary: The simple ruby extension library to use SDL
152
152
  test_files: []
153
153