Module: SDL

Defined in:
lib/rubysdl_aliases.rb,
lib/sdl.rb,
lib/rubysdl_aliases.rb,
lib/rubysdl_aliases.rb,
lib/rubysdl_aliases.rb,
lib/rubysdl_aliases.rb,
lib/rubysdl_aliases.rb,
lib/rubysdl_aliases.rb,
lib/rubysdl_aliases.rb,
lib/rubysdl_aliases.rb,
lib/rubysdl_aliases.rb,
lib/rubysdl_aliases.rb,
lib/rubysdl_aliases.rb,
lib/rubysdl_aliases.rb,
lib/sdl1_compatible.rb,
lib/rubysdl_compatible_ver1.rb

Overview

rubysdl_opengl.c

Defined Under Namespace

Modules: Mixer, Mouse Classes: BMFont, CD, CollisionMap, Event, Joystick, Kanji, Key, MPEG, PixelFormat, Rect, Screen, Surface, TTF, WM

Constant Summary collapse

VERSION =
"2.1.3"
Event2 =
Event
GL_RED_SIZE =
GL::RED_SIZE
GL_GREEN_SIZE =
GL::GREEN_SIZE
GL_BLUE_SIZE =
GL::BLUE_SIZE
GL_ALPHA_SIZE =
GL::ALPHA_SIZE
GL_BUFFER_SIZE =
GL::BUFFER_SIZE
GL_DOUBLEBUFFER =
GL::DOUBLEBUFFER
GL_DEPTH_SIZE =
GL::DEPTH_SIZE
GL_STENCIL_SIZE =
GL::STENCIL_SIZE
GL_ACCUM_RED_SIZE =
GL::ACCUM_RED_SIZE
GL_ACCUM_GREEN_SIZE =
GL::ACCUM_GREEN_SIZE
GL_ACCUM_BLUE_SIZE =
GL::ACCUM_BLUE_SIZE
GL_ACCUM_ALPHA_SIZE =
GL::ACCUM_ALPHA_SIZE
TRANSFORM_AA =
Surface::TRANSFORM_AA
TRANSFORM_SAFE =
Surface::TRANSFORM_SAFE
TRANSFORM_TMAP =
Surface::TRANSFORM_TMAP

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.blitSurface(*args) ⇒ Object Also known as: blit_surface



8
9
10
# File 'lib/sdl1_compatible.rb', line 8

def blitSurface(*args)
  SDL::Screen.blit(*args)
end

.blitSurface2(src, srcRect, dst, dstRect) ⇒ Object Also known as: blit_surface2

FIX:



160
161
162
163
164
# File 'lib/sdl.rb', line 160

def blitSurface2(src,srcRect,dst,dstRect)
  srcR = convertRect(srcRect)
  dstR = convertRect(dstRect)
  blitSurface( src, srcR.x, srcR.y, srcR.w, srcR.h , dst, dstR.x, dstR.y )
end

.checkVideoMode(*args) ⇒ Object Also known as: check_video_mode



17
18
19
# File 'lib/rubysdl_compatible_ver1.rb', line 17

def checkVideoMode(*args)
  SDL::Screen.checkMode(*args)
end

.color2int(color, format) ⇒ Object



60
61
62
63
64
65
66
67
68
69
# File 'lib/sdl.rb', line 60

def color2int(color,format)
  case color
  when Integer
    return color
  when Array
    return format.mapRGB(*color)
  else
    raise Error,'first argument must be Integer or Array'
  end
end

.convertRect(rect) ⇒ Object



148
149
150
151
152
153
154
155
156
157
# File 'lib/sdl.rb', line 148

def convertRect(rect)
  case rect
  when NilClass
    return Rect.new( 0, 0, 0, 0 )
  when Array
    return Rect.new( rect[0], rect[1], rect[2], rect[3] )
  else
    return rect
  end
end

.getGammaRamp(*args) ⇒ Object Also known as: get_gamma_ramp



29
30
31
# File 'lib/rubysdl_compatible_ver1.rb', line 29

def getGammaRamp(*args)
  SDL::Screen.getGammaRamp(*args)
end

.getGLAttr(arg) ⇒ Object Also known as: get_GL_attr



45
46
47
# File 'lib/rubysdl_compatible_ver1.rb', line 45

def getGLAttr(arg)
  GL.getAttr(arg)
end

.getVideoSurfaceObject Also known as: get_video_surface



9
10
11
# File 'lib/rubysdl_compatible_ver1.rb', line 9

def getVideoSurface
  SDL::Screen.get
end

.GLSwapBuffersObject Also known as: GL_swap_buffers



53
54
55
# File 'lib/rubysdl_compatible_ver1.rb', line 53

def GLSwapBuffers
  GL.swap_buffers
end

.listModes(*args) ⇒ Object Also known as: list_modes



21
22
23
# File 'lib/rubysdl_compatible_ver1.rb', line 21

def listModes(*args)
  SDL::Screen.listModes(*args)
end

.setGamma(*args) ⇒ Object Also known as: set_gamma



25
26
27
# File 'lib/rubysdl_compatible_ver1.rb', line 25

def setGamma(*args)
  SDL::Screen.setGamma(*args)
end

.setGammaRamp(*args) ⇒ Object Also known as: set_gamma_ramp



33
34
35
# File 'lib/rubysdl_compatible_ver1.rb', line 33

def setGammaRamp(*args)
  SDL::Screen.setGammaRamp(*args)
end

.setGLAttr(*args) ⇒ Object Also known as: set_GL_attr



49
50
51
# File 'lib/rubysdl_compatible_ver1.rb', line 49

def setGLAttr(*args)
  GL.setAttr(*args)
end

.setVideoMode(*args) ⇒ Object Also known as: set_video_mode



5
6
7
# File 'lib/sdl1_compatible.rb', line 5

def setVideoMode(*args)
  SDL::Screen.open(*args)
end

.videoDriverNameObject Also known as: video_driver_name



37
38
39
# File 'lib/rubysdl_compatible_ver1.rb', line 37

def videoDriverName
  SDL::Screen.driverName
end

.videoInfoObject Also known as: video_info



41
42
43
# File 'lib/rubysdl_compatible_ver1.rb', line 41

def videoInfo
  SDL::Screen.info
end

Instance Method Details

#autoLockObject



164
# File 'lib/rubysdl_compatible_ver1.rb', line 164

def autoLock; Surface.autoLock?; end

#autoLock=(val) ⇒ Object



167
168
169
# File 'lib/rubysdl_compatible_ver1.rb', line 167

def autoLock=(val)
  if val then autoLockON else autoLockOFF end
end

#autoLock?Boolean

Returns:

  • (Boolean)


163
# File 'lib/rubysdl_compatible_ver1.rb', line 163

def autoLock?; Surface.autoLock?; end

#autoLockOFFObject



166
# File 'lib/rubysdl_compatible_ver1.rb', line 166

def autoLockOFF; Surface.autoLockOFF; end

#autoLockONObject



165
# File 'lib/rubysdl_compatible_ver1.rb', line 165

def autoLockON; Surface.autoLockON; end

#transform(src, dst, angle, xscale, yscale, px, py, qx, qy, flags) ⇒ Object



170
171
172
# File 'lib/rubysdl_compatible_ver1.rb', line 170

def transform(src,dst,angle,xscale,yscale,px,py,qx,qy,flags)
  Surface.transformDraw(src,dst,angle,xscale,yscale,px,py,qx,qy,flags)
end

#transformBlit(src, dst, angle, xscale, yscale, px, py, qx, qy, flags) ⇒ Object



173
174
175
# File 'lib/rubysdl_compatible_ver1.rb', line 173

def transformBlit(src,dst,angle,xscale,yscale,px,py,qx,qy,flags)
  Surface.transformBlit(src,dst,angle,xscale,yscale,px,py,qx,qy,flags)
end