rubysdl-2.1.3/LICENSE0000644000175000017500000006347712241572166012657 0ustar ohaiohai GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! rubysdl-2.1.3/MANIFEST0000644000175000017500000000307212241572166012764 0ustar ohaiohaiMANIFEST README.ja README.en NEWS.ja NEWS.en LICENSE depend extconf.rb lib/rubysdl_aliases.rb lib/sdl.rb lib/rubysdl_compatible_ver1.rb rubysdl.h rubysdl_ref.rd rubysdl_ref.html rubysdl_ref.en.rd rubysdl_ref.en.html rubysdl_event.c rubysdl_event_key.c rubysdl_main.c rubysdl_mixer.c rubysdl_mouse.c rubysdl_sge_video.c rubysdl_time.c rubysdl_video.c rubysdl_wm.c rubysdl_ttf.c rubysdl_cdrom.c rubysdl_joystick.c rubysdl_image.c rubysdl_opengl.c rubysdl_pixel.c rubysdl_smpeg.c rubysdl_sdlskk.c rubysdl_kanji.c rubysdl_rwops.c SDL_kanji.c SDL_kanji.h sample/testsprite.rb sample/playwave.rb sample/movesp.rb sample/alpha.rb sample/sgetest.rb sample/font.rb sample/cdrom.rb sample/playmod.rb sample/testgl.rb sample/testgl_old.rb sample/icon.bmp sample/cursor.rb sample/event2.rb sample/joy2.rb sample/plaympeg.rb sample/cursor.bmp sample/transformblit.rb sample/randrect.rb sample/sdlskk.rb sample/ellipses.rb sample/collision.rb sample/stetris.rb sample/aadraw.rb sample/alphadraw.rb sample/fpstimer.rb sample/bfont.rb sample/font.bmp sample/kanji.rb sample/sample.ttf sample/load_from_io.rb sample/icon.png sample/icon.bmp.gz doc/Makefile doc/rsd.rb doc/cdrom.rsd doc/collision.rsd doc/event.rsd doc/font.rsd doc/general.rsd doc/init.rsd doc/joystick.rsd doc/mixer.rsd doc/mpeg.rsd doc/sdlskk.rsd doc/time.rsd doc/video.rsd doc/wm.rsd doc-en/Makefile doc-en/cdrom.rsd doc-en/collision.rsd doc-en/event.rsd doc-en/font.rsd doc-en/general.rsd doc-en/init.rsd doc-en/joystick.rsd doc-en/mixer.rsd doc-en/mpeg.rsd doc-en/opengl.rsd doc-en/sdlskk.rsd doc-en/time.rsd doc-en/video.rsd doc-en/wm.rsd rubysdl-2.1.3/NEWS.en0000644000175000017500000002024112241572166012730 0ustar ohaiohaiversion 2.1.3 Fix following methods * SDL::TTF#draw* Update documents Fix compilation problem on FreeBSD(Thanks Rusmir Dusko) Fix codes about multi-thread Bundle SGE(Please do not use this bundled SGE if you have other way to use SGE) version 2.1.2 Improbe the handling of strings Fix following methods * SDL::Surface#draw_bezier Update documents version 2.1.1 Fix a compile problem on MacOS X Rename sdl.so to sdl_ext Add following constants * SDL::Mixer::NO_FADING * SDL::Mixer::FADING_OUT * SDL::Mixer::FADING_IN * SDL::TRANSFORM_AA(for compatible with 1.x) * SDL::TRANSFORM_TMAP(for compatible with 1.x) * SDL::TRANSFORM_SAFE(for compatible with 1.x) Fix documents Remove obsolete documents version 2.1.0 add following methods * SDL::TTF#close * SDL::TTF#closed? * SDL::BMFont#close * SDL::BMFont#closed? * SDL::Kanji#close * SDL::Kanji#closed? * SDL::Surface#destroyed? * SDL::Joystick#closed? * SDL::Mixer::Wave#destroyed? * SDL::Mixer::Music#destroyed? * SDL::Kanji#get_coding_system modify documents Async following methods on Ruby 1.9 * SDL::Event#wait * SDL.delay Ruby m17n support on Ruby 1.9 * SDL::WM.set_caption * SDL::WM.caption * SDL::TTF#draw_solid * SDL::TTF#draw_blended * SDL::TTF#draw_shaded * SDL::TTF#render_solid * SDL::TTF#render_blended * SDL::TTF#render_shaded * SDL::Kanji#put * SDL::Kanji#putTate * SDL::SDLSKK#str Fix the bug of following methods * SDL::MPEG#move version 2.0.1b fix sample bug fix SDL::MPEG.info version 2.0.1 fix some compile errors/warnings raise SDL::Surface::VideoMemoryLost when video memory is lost when calling SDL::Surface.blit version 2.0 some changes for ruby 1.9 fix SDL_RWops code Fix/Improve documents Improve English documents Add following methods * SDL::Surface#load_bmp_from_string * SDL::Surface#load_from_string * SDL::Mixer::Wave#load_from_string * SDL::Mixer.playing_channels version 2.0 alpha 1 Remove following methods * SDL::Surface#draw_ellispe * SDL::Surface#draw_filled_ellispe * SDL::Surface#rotate_surface * SDL::Surface#rotate_scaled_surface * SDL.rotate * SDL.rotate_blit * SDL.rotate_scaled_blit * SDL.rotate_xy_scaled Remove Old SDL::Event, and rename SDL::Event2 to SDL::Event Change internal implementation Add following methods * SDL::Surface#destroy * SDL::Joystick#close * SDL::Mixer#close * SDL::Mixer::Wave#destroy * SDL::Mixer::Music#destroy Add module SDL::GL Change behavior of following methods * SDL::Surface#draw_line * SDL::Surface#draw_circle * SDL::Surface#draw_rect * SDL::Surface#draw_ellipse * SDL::Surface#draw_bezier Rename following methods * SDL.auto_lock? -> SDL::Surface.auto_lock? * SDL.auto_lock_on -> SDL::Surface.auto_lock_on * SDL.auto_lock_off -> SDL::Surface.auto_lock_off * SDL.transform_blit -> SDL::Surface#transform_blit * SDL.blitSurface -> SDL::Surface.blit * SDL.get_video_surface -> SDL::Screen.get * SDL.set_video_mode -> SDL::Screen.open * SDL.check_video_mode -> SDL::Screen.check_mode * SDL.list_modes -> SDL::Screen.list_modes * SDL.set_gamma -> SDL::Screen.set_gamma * SDL.get_gamma_ramp -> SDL::Screen.get_gamma_ramp * SDL.set_gamma_ramp -> SDL::Screen.set_gamma_ramp * SDL.video_driver_name -> SDL::Screen.driver_name * SDL.video_info -> SDL::Screen.info * SDL::Surface#get_rgb -> SDL::PixelFormat#get_rgb * SDL::Surface#get_rgba -> SDL::PixelFormat#get_rgba * SDL::Surface#map_rgb -> SDL::PixelFormat#map_rgb * SDL::Surface#map_rgba -> SDL::PixelFormat#map_rgba * SDL::Surface#get_palette -> SDL::PixelFormat#palette * SDL::Surface#bpp -> SDL::PixelFormat#bpp * SDL::Surface#bytes_per_pixel -> SDL::PixelFormat#bytes_per_pixel * SDL::Surface#[RGBA]mask -> SDL::PixelFormat#[RGBA]mask * SDL::Surface#[RGBA]shift -> SDL::PixelFormat#[RGBA]shift * SDL::Surface#[RGBA]loss -> SDL::PixelFormat#[RGBA]loss * SDL::Surface#colorkey -> SDL::PixelFormat#colorkey * SDL::Surface#alpha -> SDL::PixelFormat#alpha * SDL.get_GL_attr -> SDL::GL.get_attr * SDL.set_GL_attr -> SDL::GL.set_attr * SDL.GL_swap_buffers -> SDL::GL.swap_buffers Move following constants * 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 version 1.3.1 Fix the bug that we cannot compile when SMEPG is installed but SDL_mixer is not installed.(1.2.0's change is incomplete) Add following methods SDL::Surface#Rloss SDL::Surface#Gloss SDL::Surface#Bloss SDL::Surface#Aloss SDL::Surface#Rshift SDL::Surface#Gshift SDL::Surface#Bshift SDL::Surface#Ashift SDL::Surface#pitch SDL::Surface#bytes_per_pixel Fix following methods SDL::Surface.pixels version 1.3.0 Fix/Improve documents Add constant SDL::NOFRAME Add following methods SDL::Screen.update_rects SDL::Event2.pump SDL::Mixer.driver_name SDL::Surface.blit SDL::Mixer.driver_name Fix following methods SDL.video_driver_name version 1.2.0 Add Japanese reference Add following methods SDL::MPEG#render_final SDL::Surface.load_bmp_from_io SDL::Surface.load_from_io SDL::Mixer::Wave.load_from_io SDL::Mixer::Music.load_from_string Fix the bug that we cannot compile when SMEPG is installed but SDL_mixer is not installed. version 1.1.0 Change Japanese reference Add following methods SDL::CD.framesToMSF SDL::CD.MSFToFrames SDL::CD#in_drive? SDL::Mixer.playChannelTimed SDL::Mixer.fadeInChannel SDL::Mixer.fadeInChannelTimed SDL::Mixer.expire SDL::Mixer.fading SDL::Mixer.fadeOut SDL::Mixer.fadingMusic SDL::Mouse.show? SDL::CollisionMap#w SDL::CollisionMap#h SDL::BMFont#textSize SDL::TTF#init? Add following class SDL::Event2::VideoExpose Fix bugs in SDL::Key.press? SDL::TTF#familyName SDL::TTF#styleName SDL::BMFont Add some constants about key repeat version 1.0.0 Add following methods SDL::Surface#drawBezier SDL::Surface#drawAABezier SDL::Surface#drawBezierAlpha SDL::Surface#drawAABezierAlpha Fix bugs in SDL::MPEG#setDisplay version 0.9.5 Fix bugs in SDL::Surface#getPalette and SDL::Surface#copyRect Add SDL::WM.grubInput, SDL.quit, SDL.putenv and SDL.getenv Fix trivial typo Fix documentation of SDL::TTF#textSize version 0.9.4 Add SDL::Surface#pixels, SDL::Surface#[RGBA]mask and SDL::Surface.new_from Modyfy SDL::Surface.new Add a little OpenGL document version 0.9.3 Support bitmap font drawing with sge Support bdf font drawing with SDL_kanji Add following methods SDL::TTF#height SDL::TTF#ascent SDL::TTF#descent SDL::TTF#lineSkip SDL::Surface#copyRect Fix some warnings Fix a critical bug in SDLSKK module Setup OpenGL by default version 0.9.2 Primitive draw with anti-alias and alpha blending is now available. Modify SDL.transformBlit for alpha blending. version 0.9.1 Fix two critical bugs in event module. version 0.9 Support SDLSKK 0.4, and stop supporting 0.3. Add collision detection function. ( thanks to Wayne Conrad ) Improve MPEG playback function. Enable to load multiple mpeg files. Add sample. ( thanks to Simon Strandgaard ) version 0.8.3 Add following methods because of typo. ( thanks to Wayne Conrad ) SDL::Surface#drawEllipse SDL::Surface#drawFilledEllipse Fix following method. ( thanks to moumar ) SDL.videoInfo version 0.8.2 Support SDLSKK 0.3, and stop supporting 0.2. Bug fix about Joystick subsystem. Add following methods. SDL::Screen#toggleFullScreen SDL::Key.getKeyName Add aliases into documents. version 0.8.1 bug fix version 0.8 Support SDLSKK. Change SDL's finalizer (Thanks to Tamura). Change some methods' name. SDL::CD.name -> SDL::CD.indexName SDL::Joystick.name -> SDL::Joystick.indexName Add Ruby like ( uncapitalized and separated by underbars ) aliases. Add following methods. SDL::Mixer.allocateChannels SDL::TTF#renderSolidUTF8 SDL::TTF#renderBlendedUTF8 SDL::TTF#renderShadedUTF8 SDL::TTF#faces SDL::TTF#fixedWidth? SDL::TTF#familyName SDL::TTF#styleName SDL.videoDriverName SDL.getGammaRamp SDL.setGammaRamp SDL::Surface#saveBMP SDL::Surface#displayFormatAlpha SDL::Surface#getClipRect SDL.autoLock? SDL.autoLockON SDL.autoLockOFF Extend following method. SDL.blitSurace2rubysdl-2.1.3/NEWS.ja0000644000175000017500000002247312241572166012731 0ustar ohaiohaiversion 2.1.3 $B0J2<$N%a%=%C%I$N%P%0$r=$@5(B * SDL::TTF#draw* $B%I%-%e%a%s%H$N=$@5(B FreeBSD$B$G%3%s%Q%$%k;~$K%(%i!<$,@8$8$kLdBj$r=$@5(B(Thanks Rusmir Dusko) $B%9%l%C%I$^$o$j$N5sF0$r=$@5(B SGE $B$r%P%s%I%k(B($B$G$-$k8B$j;H$o$J$$$G$/$@$5$$(B) version 2.1.2 Ruby$B$NJ8;zNs$H(BC$B$NJ8;zNs$NJQ49$r87L)$K$9$k$h$&$K$7$?(B $B0J2<$N%a%=%C%I$N%P%0$r=$@5(B * SDL::Surface#draw_bezier $B%I%-%e%a%s%H$N=$@5(B version 2.1.1 Ruby 1.9$B$H(BMacOS X$B$G%3%s%Q%$%k$G$-$J$$LdBj$r=$@5(B sdl.so $B$r(B sdl_ext $B$H$$$&L>A0$KJQ99(B $B0J2<$NDj?t$rDI2C(B * SDL::Mixer::NO_FADING * SDL::Mixer::FADING_OUT * SDL::Mixer::FADING_IN * SDL::TRANSFORM_AA(for compatible with 1.x) * SDL::TRANSFORM_TMAP(for compatible with 1.x) * SDL::TRANSFORM_SAFE(for compatible with 1.x) $B%I%-%e%a%s%H$N=$@5(B $B8E$$%I%-%e%a%s%H$r:o=|(B version 2.1.0 $B0J2<$N%a%=%C%I$rDI2C(B * SDL::TTF#close * SDL::TTF#closed? * SDL::BMFont#close * SDL::BMFont#closed? * SDL::Kanji#close * SDL::Kanji#closed? * SDL::Surface#destroyed? * SDL::Joystick#closed? * SDL::Mixer::Wave#destroyed? * SDL::Mixer::Music#destroyed? * SDL::Kanji#get_coding_system $B%I%-%e%a%s%H$N=$@5(B $B0J2<$N%a%=%C%I$N8F$S$@$7Cf$K(B1.9$B$G%9%l%C%I@Z$jBX$(2DG=$KJQ99(B * SDL::Event#wait * SDL.delay $B0J2<$N%a%=%C%I$G(BRuby$B$N(Bm17n$B5!G=$rMxMQ$9$k$h$&$KJQ99(B * SDL::WM.set_caption * SDL::WM.caption * SDL::TTF#draw_solid * SDL::TTF#draw_blended * SDL::TTF#draw_shaded * SDL::TTF#render_solid * SDL::TTF#render_blended * SDL::TTF#render_shaded * SDL::Kanji#put * SDL::Kanji#putTate * SDL::SDLSKK#str $B0J2<$N%a%=%C%I$N%P%0$r=$@5(B * SDL::MPEG#move version 2.0.1b $B%5%s%W%k$N%P%0$r=$@5(B SDL::MPEG.info$B$r=$@5(B version 2.0.1 $B%3%s%Q%$%k$G$-$J$$>l9g$,$"$k$N$r=$@5(B SDL::Surface.blit$B$G%S%G%*%a%b%j$,%m%9%H$7$?>l9g$K(B $BNc30(BSDL::Surface::VideoMemoryLost$B$rH/@8$5$;$k$h$&$K$7$?!#(B version 2.0 ruby 1.9$B$G;H$($k$h$&$KJQ99(B SDL_RWops$BBP1~$r=$@5$7!"(BSDL::Mixer::Wave.load_from_io$B$,;H$($k$h$&$K$7$?!#(B $B%I%-%e%a%s%H$N2~A1(B($BFC$K1Q8lHG(B) $B0J2<$N%a%=%C%I$rDI2C(B * SDL::Surface#load_bmp_from_string * SDL::Surface#load_from_string * SDL::Mixer::Wave#load_from_string * SDL::Mixer.playing_channels version 2.0 alpha 1 $BFbIt9=B$$rBgI}$KJQ99(B SDL::Event2$B$r(BSDL::Event$B$KJQ99$7!"$+$D$F$N(BSDL::Event$B$OGQ;_(B $B0J2<$N%a%=%C%I$rGQ;_(B * SDL::Surface#draw_ellispe * SDL::Surface#draw_filled_ellispe * SDL::Surface#rotate_surface * SDL::Surface#rotate_scaled_surface * SDL.rotate * SDL.rotate_blit * SDL.rotate_scaled_blit * SDL.rotate_xy_scaled $B0J2<$N%a%=%C%I$rDI2C(B * SDL::Surface#destroy * SDL::Joystick#close * SDL::Mixer#close * SDL::Mixer::Wave#destroy * SDL::Mixer::Music#destroy SDL::GL$B%b%8%e!<%k$rDI2C(B SDL::PixelFormat(SDL::Surface::Format$B$N$[$&$,NI$$!)(B)$B$N SDL::Surface.auto_lock? * SDL.auto_lock_on -> SDL::Surface.auto_lock_on * SDL.auto_lock_off -> SDL::Surface.auto_lock_off * SDL.transform_blit -> SDL::Surface#transform_blit * SDL.blitSurface -> SDL::Surface.blit * SDL.get_video_surface -> SDL::Screen.get * SDL.set_video_mode -> SDL::Screen.open * SDL.check_video_mode -> SDL::Screen.check_mode * SDL.list_modes -> SDL::Screen.list_modes * SDL.set_gamma -> SDL::Screen.set_gamma * SDL.get_gamma_ramp -> SDL::Screen.get_gamma_ramp * SDL.set_gamma_ramp -> SDL::Screen.set_gamma_ramp * SDL.video_driver_name -> SDL::Screen.driver_name * SDL.video_info -> SDL::Screen.info * SDL::Surface#get_rgb -> SDL::PixelFormat#get_rgb * SDL::Surface#get_rgba -> SDL::PixelFormat#get_rgba * SDL::Surface#map_rgb -> SDL::PixelFormat#map_rgb * SDL::Surface#map_rgba -> SDL::PixelFormat#map_rgba * SDL::Surface#get_palette -> SDL::PixelFormat#palette * SDL::Surface#bpp -> SDL::PixelFormat#bpp * SDL::Surface#bytes_per_pixel -> SDL::PixelFormat#bytes_per_pixel * SDL::Surface#[RGBA]mask -> SDL::PixelFormat#[RGBA]mask * SDL::Surface#[RGBA]shift -> SDL::PixelFormat#[RGBA]shift * SDL::Surface#[RGBA]loss -> SDL::PixelFormat#[RGBA]loss * SDL::Surface#colorkey -> SDL::PixelFormat#colorkey * SDL::Surface#alpha -> SDL::PixelFormat#alpha * SDL.get_GL_attr -> SDL::GL.get_attr * SDL.set_GL_attr -> SDL::GL.set_attr * SDL.GL_swap_buffers -> SDL::GL.swap_buffers $B0J2<$N$h$&$KDj?t$r0\F0!#5lMh$N$b$N$bMxMQ$O$G$-$^$9!#(B * 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 OpenGL$B4XO"$N%I%-%e%a%s%H$rDI2C(B version 1.3.1 SMPEG$BM-!"(BSDL_mixer$BL5$N>l9g$NLdBj$r=$@5(B $B0J2<$N%a%=%C%I$rDI2C(B SDL::Surface#Rloss SDL::Surface#Gloss SDL::Surface#Bloss SDL::Surface#Aloss SDL::Surface#Rshift SDL::Surface#Gshift SDL::Surface#Bshift SDL::Surface#Ashift SDL::Surface#pitch SDL::Surface#bytes_per_pixel $B0J2<$N%a%=%C%I$r=$@5(B SDL::Surface.pixels version 1.3.0 $B%I%-%e%a%s%H$r=$@5(B/$B2~A1(B $BDj?t(BSDL::NOFRAME$B$,Dj5A$5$l$F$$$J$+$C$?$N$r=$@5(B $B0J2<$N%a%=%C%I$rDI2C(B SDL::Screen#update_rects SDL::Event2.pump SDL::Screen.open SDL::Surface.blit SDL::Mixer.driver_name $B0J2<$N%a%=%C%I$r=$@5(B SDL.video_driver_name version 1.2.0 $BF|K\8l$N%j%U%!%l%s%9$N(BMPEG$B$N9`L\$r2CI.(B $B0J2<$N%a%=%C%I$rDI2C(B SDL::MPEG#render_final SDL::Surface.load_bmp_from_io SDL::Surface.load_from_io SDL::Mixer::Wave.load_from_io SDL::Mixer::Music.load_from_string SMPEG$BM-!"(BSDL_mixer$BL5$N>l9g$K%3%s%Q%$%k$G$-$J$$%P%0$r=$@5(B version 1.1.0 $BF|K\8l$N%j%U%!%l%s%9$rA4LL2~D{(B $B0J2<$N%a%=%C%I$rDI2C(B SDL::CD.framesToMSF SDL::CD.MSFToFrames SDL::CD#in_drive? SDL::Mixer.playChannelTimed SDL::Mixer.fadeInChannel SDL::Mixer.fadeInChannelTimed SDL::Mixer.expire SDL::Mixer.fading SDL::Mixer.fadeOut SDL::Mixer.fadingMusic SDL::Mouse.show? SDL::CollisionMap#w SDL::CollisionMap#h SDL::BMFont#textSize SDL::TTF#init? $B0J2<$N%/%i%9$rDI2C(B SDL::Event2::VideoExpose $B0J2<$N%a%=%C%I$N%P%0$r=$@5(B SDL::Key.press? SDL::TTF#familyName SDL::TTF#styleName $B0J2<$N%/%i%9$N=*N;;~%P%0$r=$@5(B SDL::BMFont $B%-!<%j%T!<%H4XO"$NDj?t$rDI2C(B version 1.0.0 $B0J2<$N%a%=%C%I$rDI2C(B SDL::Surface#drawBezier SDL::Surface#drawAABezier SDL::Surface#drawBezierAlpha SDL::Surface#drawAABezierAlpha $B0J2<$N%a%=%C%I$N%P%0$r=$@5(B SDL::MPEG#setDisplay version 0.9.5 $B0J2<$N%a%=%C%I$N%P%0$r=$@5(B SDL::Surface#getPalette SDL::Surface#copyRect $B0J2<$N%a%=%C%I$rDI2C(B SDL::WM.grubInput SDL.quit SDL.putenv SDL.getenv $B$5$5$$$J(Btypo$B$r=$@5(B $B%I%-%e%a%s%H$r0lIt=$@5(B(SDL::TTF#textSize) version 0.9.4 SDL::Surface#pixels, SDL::Surface#[RGBA]mask, SDL::Surface.new_from$B$rDI2C(B SDL::Surface.new$B$r3HD%(B OpenGL$B4XO"$N%I%-%e%a%s%H$r:GDc8B$NJ,DI2C(B version 0.9.3 sge$B$N(Bbitmap font$BIA2h5!G=$rDI2C(B SDL_kanji$B$K$h$k(Bbdf font$BIA2h5!G=$rDI2C(B SDL::TTF#height, #ascent, #descent, #lineSkip$B$rDI2C(B SDL::Surface#copyRect$B$rDI2C(B warning$B$,$G$kE@$r=$@5(B SDLSKK$B%$%s%?!<%U%'!<%9$NCWL?E*$J%P%0$r=$@5(B OpenGL$B$r%G%U%)%k%H$GM-8z$K$7$?(B version 0.9.2 sge$B$N%"%k%U%!IU$-?^7AIA2h!"%"%s%A%(%$%j%"%:IU$-?^7AIA2h$r%5%]!<%H(B SDL.transformBlit$B$r(BsetAlpha$B$G$N(Balpha$B$N@_Dj$rM-8z$K$9$k(B version 0.9.1 SDL::Event$B$H(BSDL::Event2$B$NCWL?E*$J%P%0$r=$@5(B version 0.9 SDLSKK 0.4$B$r%5%]!<%H!"(B0.3$B$N%5%]!<%H$rDd;_(B $B>WFMH=Dj5!G=$rDI2C(B ( thanks to Wayne Conrad ) MPEG$B:F@85!G=$r6/2=!#J#?t$N(BMPEG$B%U%!%$%k$rFI$_$3$a$k$h$&$K$9$k!"(BSDL_Mixer$B$K$h$k(B $B2;@<:F@85!G=$H$N6&B8$r2DG=$K$9$k$J$I$NJQ99$r$7$?!#(B $B%5%s%W%k$rDI2C!#(B( thanks to Simon Strandgaard ) version 0.8.3 $B0J2<$N%a%=%C%I$rDI2C(B(typo$B$N$?$a(B) ( thanks to Wayne Conrad ) SDL::Surface#drawEllipse SDL::Surface#drawFilledEllipse $B0J2<$N%a%=%C%I$r=$@5(B( thanks to moumar ) SDL.videoInfo version 0.8.2 SDLSKK 0.3$B$r%5%]!<%H!"(B0.2$B0JA0$O%5%]!<%H$7$J$$$3$H$K$7$?(B Joystick$B5!G=$N%P%0$r=$@5(B $B0J2<$N%a%=%C%I$rDI2C(B SDL::Screen#toggleFullScreen SDL::Key.getKeyName $B%I%-%e%a%s%H$K(Balias$B$r5-=R(B version 0.8.1 $B%P%0=$@5(B version 0.8 SDLSKK$B$N%5%]!<%H$r2C$($k!#(B $B=*N;=hM}$NJQ99(B($B$?$`$i$5$s$N%Q%C%A$J$I$K$h$k(B) $B%"%s%@!<%P!<6h@Z$j$N%a%=%C%IL>$rMxMQ$G$-$k$h$&$K$7$?(B( blit_surface $B$J$I(B ) $B%a%=%C%IL>$rJQ99(B SDL::CD.name -> SDL::CD.indexName SDL::Joystick.name -> SDL::Joystick.indexName $B0J2<$N%a%=%C%I$NDI2C(B SDL::Mixer.allocateChannels SDL::TTF#renderSolidUTF8 SDL::TTF#renderBlendedUTF8 SDL::TTF#renderShadedUTF8 SDL::TTF#faces SDL::TTF#fixedWidth? SDL::TTF#familyName SDL::TTF#styleName SDL.videoDriverName SDL.getGammaRamp SDL.setGammaRamp SDL::Surface#saveBMP SDL::Surface#displayFormatAlpha SDL::Surface#getClipRect SDL.autoLock? SDL.autoLockON SDL.autoLockOFF $B0J2<$N%a%=%C%I$r3HD%(B SDL.blitSurface2 rubysdl-2.1.3/README.en0000644000175000017500000001034712241572166013117 0ustar ohaiohai Ruby/SDL 2.1.3 Ohbayashi Ippei = What's Ruby/SDL Ruby/SDL is the ruby extension library to use SDL. SDL(Simple DirectMedia Layer) is a cross-platform multimedia library designed to provide fast access to the graphics framebuffer and audio devices. See http://www.libsdl.org/ if you want to know SDL in detail. = Platform This library supports Linux, Win32, MacOS X. This library perhaps works on FreeBSD and other standard Unix-like systems. = Library Needed Ruby/SDL needs Ruby and SDL and optionally uses SDL_image, SDL_mixer, SDL_ttf, SGE, OpenGL and SMPEG. Indispensable Ruby http://www.ruby-lang.org/ SDL http://www.libsdl.org/ Optional SDL_mixer http://www.libsdl.org/projects/SDL_mixer/index.html SDL_ttf http://www.libsdl.org/projects/SDL_ttf/index.html SDL_image http://www.libsdl.org/projects/SDL_image/index.html SGE http://www.etek.chalmers.se/~e8cal1/sge/ SMPEG http://www.icculus.org/smpeg/ SDLSKK http://www.kmc.gr.jp/~ohai/sdlskk.en.html = INSTALL Some packages are available: Debian's .deb, FreeBSD's ports, or Windows' zipfile. RubyGems are also available. You can install Ruby/SDL: gem install rubysdl You can install from source code as follows: (1)install Ruby See Ruby's document and install. (2)install SDL Extract SDL's source and run './configure'. And run 'make','make install'. (3)install SGE Run 'make' and 'make install'. (4)install SDL_mixer, SDL_ttf, SDL_image, SMPEG and SDLSKK See documents of these libraries and install them . (5)install this extension library,Ruby/SDL Run 'ruby extconf.rb','make' and 'make install'. (6) (Mac OS X user only) install rsdl Run 'gem install rsdl'. rsdl is a wrapper of the Ruby interpreter. This wrapper prepares Cocoa framework before running the interpreter. = Use SGE without installing the library You can use SGE without intalling: gem install rubysdl -- --enable-imported-sge or ruby extconf.rb --enable-imported-sge However, please do not use this option if you have other way. Please install SGE separately if possible. = USE Ruby/SDL Write "require 'sdl'" in your Ruby script. If your system is OS X, you must use rsdl command as an interpreter instead of ruby command. See following documents and samples if you want to know the detail. sample/*.rb Ruby/SDL samples. In some scripts, you have to prepare data such as "sample.wav" and "sample.mpg". rubysdl_ref.en.html The reference manual rubysdl_ref.en.rd RD style reference manual(the contents is same as rubysdl_ref.en.html) documents of SDL This is in SDL archive. Please read this when you want to know what does't describe these documents. = OpenGL You can use OpenGL with this library. (1) Setup OpenGL and SDL. (2) Install ruby-opengl (http://ruby-opengl.rubyforge.org/) (3) Run "ruby extconf.rb", "make", and "make install" (4) Write "require 'sdl'; require 'opengl'" in your script. We use OpenGL through ruby-opengl. Please see SDL's document,OpenGL document and sample/testgl.rb . = LICENSE This library is distributed under GNU LGPL version 2.1 or later, which can be found in the file "LICENSE". But samples, the Ruby scripts sample/*.rb, are not under LGPL, and you can use their files freely. = Thanks Thanks to ... Tamura : some patches and advertising Akinori MUSHA : Porting on FreeBSD Danny van Bruggen : some ideas are from his library "RUDL" akira yamada : patch of SDL::TTF, making packages of Vine and Debian. Wayne Conrad : some patches Christian Neukirchen, Kent Dahl : send a patch Keffin Barnaby : some patches Rorien Dunn, Dennis Ranke, Keita Urashima : bug reports and useful information Yusuke TABATA : introduce me into SDL world SDLdoc Japanese translation project : base of Ruby/SDL's reference manual Hara Yutaka: Sample TrueTypeFont, MacOS X support Members of #sdl-fan-jp @ FriendChat: bug reports and advices Cyross Makoto: Windows support Dwayne C. Litzenberger: Some patches = OTHER Some functions, especially SDL::MPEG methods and pallete handling methods, are not tested. = AUTHORS Ippei Obayashi: main developer Cyross Makoto: Windows suppport yhara: MacOS X support Please send comments and bug reports to the author. Author's mail address: ohai@kmc.gr.jp rubysdl-2.1.3/README.ja0000644000175000017500000001406712241572166013112 0ustar ohaiohai Ruby/SDL 2.1.3 大林一平 = 概要 これは、RubyからSDLの機能を使うための拡張ライブラリです。 SDLとは、Win32,Linux,BeOS,MacOS,FreeBSD,Solaris等で動く、クロスプラットフォームなゲーム開発用ライブラリです。 = 動作環境 LinuxのX上、Win32 また、FreeBSDで動作が確認され、Portsが作られたそうです。 BeOS上でも動くそうです。 MacOSXでも動いたそうです。ただしRubyに手を入れる必要があるようです。 それ以外では確認していません。 = 必要なライブラリ このライブラリは、rubyの処理系の他、以下のライブラリを必要とします。 SDL_mixer,SDL_ttf,SDL_image,SGE,smpeg,SDLSKKはなくてもかまいません。 SDL(必須) http://www.libsdl.org/ SDL_mixer(オプション) http://www.libsdl.org/projects/SDL_mixer/index.html SDL_ttf(オプション) http://www.libsdl.org/projects/SDL_ttf/index.html SDL_image(オプション) http://www.libsdl.org/projects/SDL_image/index.html SGE(オプション) http://www.etek.chalmers.se/~e8cal1/sge/ SMPEG(オプション) http://www.icculus.org/smpeg/ SDLSKK(オプション) http://www.kmc.gr.jp/~ohai/sdlskk.html また、SDL_kanjiを利用していますが、これはアーカイブに含めているので 別に用意する必要はありません。 = インストール Linux上でのインストールを説明します。Unix系のOSならどれでも同じよう にできると思います。 Debian、Vine、その他様々なディストリビューションにはRuby/SDLのパッケージ があるのでそれを利用してもよいでしょう。 Windows上では別に用意しているバイナリを使用したほうが楽でしょう。 FreeBSDにはPortがあるのでそれを利用してください。 (1)rubyのインストール rubyのドキュメント等に従ってインストールしてください。 (2)SDLのインストール ソースを展開してコンパイルする場合は、以下の通りにしてください。 ./configure make make install (3)SGEのインストール make; make installでインストールされます。 (4)SDL_mixer,SDL_ttf,SDL_image,SMPEG,SDLSKKのインストール 附属のドキュメントに従ってインストールしてください。 (5)この拡張ライブラリ(Ruby/SDL)のインストール このライブラリのソースを展開したディレクトリ内で ruby extconf.rb make make install としてください。 (6) (MacOS Xのみ) rsdl のインストール gem install rsdl で rsdl をインストールしてください。 = Gemによるインストール gem でもインストールできます。 gem install rubysdl です。 = SGEをインストールせずに使う Ruby/SDLが内部で SGE を持っています。 gem install rubysdl -- --enable-imported-sge もしくは ruby extconf.rb --enable-imported-sge で使えます。 ただし、この仕組みはできれば使わないでください。 SGEが別にインストール可能ならそちらを使ってください。 = 使い方 require 'sdl'で使えます。 MacOS Xの場合のみ、 ruby コマンドでなく rsdl コマンドで インタプリタを起動してください。 詳しくは、以下のファイルやドキュメントを見てください。 sample/*.rb サンプル 以下のサンプルがあります。 testsprite.rb 画像表示のサンプル playwave.rb PCMファイル演奏のサンプル sample.wav が必要 movesp.rb キー入力のサンプル alpha.rb アルファブレンディングのサンプル sgetest.rb sgeのプリミティブ描画のサンプル font.rb True Type Fontのサンプル playmod.rb modファイル演奏のサンプル sample.it が必要 testgl.rb OpenGLのサンプル cursor.rb マウスカーソルを変更するサンプルp transformblit.rb 回転縮小拡大のサンプル joy2.rb ジョイパッド入力のサンプル plaympeg.rb mpeg表示のサンプル sample.mpgが必要 sdlskk.rb SDLSKKのサンプル。フォントや辞書等必要 詳しくはサンプルのコメントを見てください bfont.rb ビットマップフォント表示のサンプル kanji.rb SDL_Kanji機能のサンプル。8x16.bdfとjiskan16.bdf という2つのbdfファイルが必要 collision.rb 衝突検出機能のサンプル その他 rubysdl_ref.rd, rubysdl_ref.html リファレンス Ruby/SDLのリファレンスマニュアルです。 rubysdl_doc_old.rd 古いリファレンス 古いリファレンスです。 SDLのドキュメント SDLのインストールのときに展開したファイルの中にあるはずです。 また、 http://www.tacoworks.jp/software/SDLdoc-jp/index-j.html から日本語のドキュメントも手に入ります。 リファレンスに書かれていないことはこれを見てください。 doc/ Makefile rsd.rb *.rsd リファレンスマニュアルの元データです。 = OpenGLについて このライブラリによってOpenGLへのアクセスが可能になります。 (1) SDLからOpenGLを使えるように設定する。 (2) http://ruby-opengl.rubyforge.org/ をインストールする。 (3) ruby extconf.rb をするときに、--enable-opengl を指定する。 (4) make ; make install する。 この場合はRubyのスクリプト内でrequire 'opengl'をする必要があります。 インターフェースは ruby-opengl そのものなので、 これの使いかたは、SDLのドキュメント、OpenGLのドキュメント、 および sample/testgl.rb を見て調べてください。 = ライセンス GNU LGPL(GNU Lesser General Public License) version 2.1 以降に従います。 詳しくはLICENSEを見てください。 ただし、sample/ 以下にあるサンプルプログラムはこれには従わず、 自由に利用してよいです。 = 謝辞 以下の人達に感謝します。 * FreeBSDでの動作確認をし、Portsを作っていただいたAkinori MUSHAさん。 * さまざまな意見を送ってくださり、いくつものパッチを送ってくださったり したたむらさん。 * そしてもうひとつのSDLのRuby拡張ライブラリ"RUDL"の作者である Danny van Bruggen さん(いくつかのアイデアをこのライブラリから得ました)。 * rubysdl_ttf.cの機能拡張パッチやVine、Debianのパッケージ作成などを していただいたやまだあきらさん。 * いくつかのパッチを下さった Wayne Conrad さん、Christian Neukirchenさん、 Keffin Barnabyさん。 * サンプルを提供してくださった Simon Strandgaard さん。 * 有用な情報、バグレポートをくださった Rorien Dunnさん、Dennis Rankeさん、 Keita Urashima, Dwayne C. Litzenberger さん。 * SDLの存在を教えてくれ、Ruby/SDLを作るきっかけを与えてくれた田畑さん。 * SDLdoc 日本語翻訳プロジェクトにかかわったみなさま * サンプル用のフォントを提供してくれた原さん。 * #sdl-fan-jp@friend chat のみなさま * Windows版の管理をしてくださるサイロスさん = その他 まだテストされていない機能が多くあります(パレット関連 やMPEG関連のメソッドいくつかなど)。 = 作者 大林一平: いろいろ サイロス誠: Windowsサポート yhara: MacOS Xサポート 要望、バグ報告、使用した感想等は、ohai@kmc.gr.jpにメールを出して ください。 以上 rubysdl-2.1.3/SDL_kanji.c0000644000175000017500000002021712241572166013575 0ustar ohaiohai#include "SDL_kanji.h" #include #include #include #include #define BUF 256 static void InitFont(Kanji_Font* font) { int i; for (i = 0; i < 96*96 + 256; i++) { font->moji[i] = 0; } } Kanji_Font* Kanji_OpenFont(const char* file, int size) { Kanji_Font* font; font = (Kanji_Font*)malloc(sizeof(Kanji_Font)); font->k_size = size; font->a_size = size / 2; font->sys = KANJI_JIS; InitFont(font); if (0 == Kanji_AddFont(font, file)) { return font; } else { free(font); return 0; } } static void ParseChar(Kanji_Font* font, int index, FILE* fp, int shift) { char buf[BUF]; int y; /* [h */ if (font->moji[index] != 0) return; font->moji[index] = (Uint32*)malloc(sizeof(Uint32)*font->k_size); for (y = 0; y < font->k_size; y++) { fgets(buf, BUF, fp); font->moji[index][y] = (strtol(buf, 0, 16) >> shift); } } static int ParseFont(Kanji_Font* font, FILE* fp) { char buf[BUF], *p; int index; int k_rshift, a_rshift; int s; for (s = 8; s < font->k_size; s += 8) {} k_rshift = s - font->k_size; for (s = 8; s < font->a_size; s += 8) {} a_rshift = s - font->a_size; while (1) { if (fgets(buf, BUF, fp) == NULL) { break; } if (strstr(buf, "ENCODING") != NULL) { p = strchr(buf, ' '); index = strtol(p, 0, 10); while (strstr(buf, "BITMAP") == NULL) { fgets(buf, BUF, fp); } if (index > 255) { index = (((index & 0xff00) >> 8) - 0x20) * 96 + (index & 0xff) - 0x20 + 0xff; ParseChar(font, index, fp, k_rshift); } else { ParseChar(font, index, fp, a_rshift); } } } return 0; } int Kanji_AddFont(Kanji_Font* font, const char* file) { FILE* fp; fp = fopen(file, "r"); if(fp==NULL){ fprintf(stderr, "cant open [%s]\n", file); return -1; } if (0 != ParseFont(font, fp)) return -1; fclose(fp); return 0; } int Kanji_FontHeight(Kanji_Font* font) { return font->k_size; } int Kanji_FontWidth(Kanji_Font* font, const char* text) { if (text == 0) return font->a_size; else return strlen(text) * font->a_size; } static void KanjiPutpixel(SDL_Surface *s,int x,int y,Uint32 pixel){ Uint8 *p,bpp; if(SDL_MUSTLOCK(s)){ if(SDL_LockSurface(s)<0) return; } bpp=s->format->BytesPerPixel; p=(Uint8*)(s->pixels)+y*s->pitch+x*bpp; switch(bpp){ case 1: *((Uint8 *)p)=(Uint8)pixel; break; case 2: *((Uint16 *)p)=(Uint16)pixel; break; case 4: *((Uint32 *)p)=pixel; break; } if(SDL_MUSTLOCK(s)){ SDL_UnlockSurface(s); } } static void euc2jis(unsigned char *c1, unsigned char *c2) { *c1 &= 0x7f; *c2 &= 0x7f; } static void sjis2jis(unsigned char *c1, unsigned char *c2) { if( *c2 < 0x9f ) { if( *c1 < 0xa0 ) { *c1 -= 0x81; *c1 *= 2; *c1 += 0x21; } else { *c1 -= 0xe0; *c1 *= 2; *c1 += 0x5f; } if( *c2 > 0x7f ) -- *c2; *c2 -= 0x1f; } else { if( *c1 < 0xa0 ) { *c1 -= 0x81; *c1 *= 2; *c1 += 0x22; } else { *c1 -= 0xe0; *c1 *= 2; *c1 += 0x60; } *c2 -= 0x7e; } } static void ConvertCodingSystem(Kanji_Font* font, unsigned char *c1, unsigned char *c2) { if (font->sys == KANJI_SJIS) { sjis2jis(c1, c2); } else if (font->sys == KANJI_EUC) { euc2jis(c1, c2); } } int Kanji_PutText(Kanji_Font* font, int dx, int dy, SDL_Surface* dst, const char* txt, SDL_Color fg) { Uint32 fgcol; int index; int x, y, cx = dx, cy = dy; unsigned char high, low; int minx, miny, maxx, maxy; int nowKanji = 0; const unsigned char* text = (const unsigned char*)txt; fgcol = SDL_MapRGB(dst->format, fg.r, fg.g, fg.b); while (*text != 0) { if (font->sys == KANJI_JIS && *text == 0x1b) { if (*(text+1) == 0x24 && *(text+2) == 0x42) { nowKanji = 1; } else if (*(text+1) == 0x28 && *(text+2) == 0x42) { nowKanji = 0; } text += 3; continue; } if (font->sys != KANJI_JIS) nowKanji = !isprint(*text); if (!nowKanji) { index = *text; text++; if (font->moji[index] == 0) { cx += font->a_size; continue; } minx = (cx >= 0) ? 0 : -cx; miny = (cy >= 0) ? 0 : -cy; maxx = (cx+font->a_size <= dst->w) ? font->a_size : dst->w-cx; maxy = (cy+font->k_size <= dst->h) ? font->k_size : dst->h-cy; for (y = miny; y < maxy; y++) { for (x = minx; x < maxx; x++) { if (font->moji[index][y] & (1 << (font->a_size-x-1))) { KanjiPutpixel(dst, cx+x, cy+y, fgcol); } } } cx += font->a_size; } else { high = *text; low = *(text+1); ConvertCodingSystem(font, &high, &low); index = (high - 0x20) * 96 + low - 0x20 + 0xff; text += 2; if (font->moji[index] == 0) { cx += font->k_size; continue; } minx = (cx >= 0) ? 0 : -cx; miny = (cy >= 0) ? 0 : -cy; maxx = (cx+font->k_size <= dst->w) ? font->k_size : dst->w-cx; maxy = (cy+font->k_size <= dst->h) ? font->k_size : dst->h-cy; for (y = miny; y < maxy; y++) { for (x = minx; x < maxx; x++) { if (font->moji[index][y] & (1 << (font->k_size-x-1))) { KanjiPutpixel(dst, cx+x, cy+y, fgcol); } } } cx += font->k_size; } } return 0; } int Kanji_PutTextTate(Kanji_Font* font, int dx, int dy, SDL_Surface* dst, const char* txt, SDL_Color fg) { Uint32 fgcol; int index; int x, y, cx = dx, cy = dy; unsigned char high, low; int minx, miny, maxx, maxy; int nowKanji = 0; const unsigned char* text = (const unsigned char*)txt; fgcol = SDL_MapRGB(dst->format, fg.r, fg.g, fg.b); while (*text != 0) { if (font->sys == KANJI_JIS && *text == 0x1b) { if (*(text+1) == 0x24 && *(text+2) == 0x42) { nowKanji = 1; } else if (*(text+1) == 0x28 && *(text+2) == 0x42) { nowKanji = 0; } text += 3; continue; } if (font->sys != KANJI_JIS) nowKanji = !isprint(*text); /* ASCII */ if (!nowKanji) { text++; } else { high = *text; low = *(text+1); ConvertCodingSystem(font, &high, &low); index = (high - 0x20) * 96 + low - 0x20 + 0xff; text += 2; if (font->moji[index] == 0) { cy += font->k_size; continue; } if (high == 0x21 && (low >= 0x22 || low <= 0x25)) { cx += font->k_size * 0.6; cy -= font->k_size * 0.6; } minx = (cx >= 0) ? 0 : -cx; miny = (cy >= 0) ? 0 : -cy; maxx = (cx+font->k_size <= dst->w) ? font->k_size : dst->w-cx; maxy = (cy+font->k_size <= dst->h) ? font->k_size : dst->h-cy; for (y = miny; y < maxy; y++) { for (x = minx; x < maxx; x++) { if (font->moji[index][y] & (1 << (font->k_size-x-1))) { KanjiPutpixel(dst, cx+x, cy+y, fgcol); } } } if (high == 0x21 && (low >= 0x22 || low <= 0x25)) { cx -= font->k_size * 0.6; cy += font->k_size * 1.6; } else { cy += font->k_size; } } } return 0; } SDL_Surface* Kanji_CreateSurface(Kanji_Font* font, const char* text, SDL_Color fg, int bpp) { SDL_Surface* textbuf; int len; Uint32 bgcol; if (text == NULL) return NULL; if (*text == 0 ) return NULL; len = strlen(text); textbuf = SDL_AllocSurface(SDL_SWSURFACE, font->a_size*len, font->k_size, bpp, 0, 0, 0, 0); if (textbuf == NULL) { fprintf(stderr,"ERROR: at Kanji_RenderText\n"); return NULL; } bgcol = SDL_MapRGB(textbuf->format, 255-fg.r, 255-fg.g, 255-fg.b); SDL_FillRect(textbuf, NULL, bgcol); SDL_SetColorKey(textbuf, SDL_SRCCOLORKEY, bgcol); Kanji_PutText(font, 0, 0, textbuf, text, fg); return textbuf; } SDL_Surface* Kanji_CreateSurfaceTate(Kanji_Font* font, const char* text, SDL_Color fg, int bpp) { SDL_Surface* textbuf; int len; Uint32 bgcol; if (text == NULL) return NULL; if (*text == 0 ) return NULL; len = strlen(text); textbuf = SDL_AllocSurface(SDL_SWSURFACE, font->k_size, font->a_size*len, bpp, 0, 0, 0, 0); if (textbuf == NULL) { fprintf(stderr,"ERROR: at Kanji_RenderText\n"); return NULL; } bgcol = SDL_MapRGB(textbuf->format, 255-fg.r, 255-fg.g, 255-fg.b); SDL_FillRect(textbuf, NULL, bgcol); SDL_SetColorKey(textbuf, SDL_SRCCOLORKEY, bgcol); Kanji_PutTextTate(font, 0, 0, textbuf, text, fg); return textbuf; } void Kanji_CloseFont(Kanji_Font* font) { int i; for (i = 0; i < 96*96 + 256; i++) { if (font->moji[i] != 0) { free(font->moji[i]); } } free(font); } void Kanji_SetCodingSystem(Kanji_Font* font, Kanji_CodingSystem sys) { font->sys = sys; } rubysdl-2.1.3/SDL_kanji.h0000644000175000017500000000240312241572166013577 0ustar ohaiohai#ifndef SDLbdf_h_ #define SDLbdf_h_ #include /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus extern "C" { #endif typedef enum { KANJI_SJIS, KANJI_EUC, KANJI_JIS } Kanji_CodingSystem; typedef struct { int k_size; int a_size; Kanji_CodingSystem sys; /* AB */ Uint32* moji[96*96+256]; } Kanji_Font; Kanji_Font* Kanji_OpenFont(const char* file, int size); int Kanji_AddFont(Kanji_Font* font, const char* file); void Kanji_SetCodingSystem(Kanji_Font* font, Kanji_CodingSystem sys); int Kanji_FontHeight(Kanji_Font* font); /* text == 0 ASCII */ int Kanji_FontWidth(Kanji_Font* font, const char* text); SDL_Surface* Kanji_CreateSurface(Kanji_Font* font, const char* text, SDL_Color fg, int bpp); int Kanji_PutText(Kanji_Font* font, int dx, int dy, SDL_Surface* dst, const char* text, SDL_Color fg); SDL_Surface* Kanji_CreateSurfaceTate(Kanji_Font* font, const char* text, SDL_Color fg, int bpp); int Kanji_PutTextTate(Kanji_Font* font, int dx, int dy, SDL_Surface* dst, const char* text, SDL_Color fg); void Kanji_CloseFont(Kanji_Font* font); /* Ends C function definitions when using C++ */ #ifdef __cplusplus }; #endif #endif rubysdl-2.1.3/depend0000644000175000017500000000145412241572166013017 0ustar ohaiohairubysdl_event.o: rubysdl_event.c rubysdl.h rubysdl_event_key.o: rubysdl_event_key.c rubysdl.h rubysdl_main.o: rubysdl_main.c rubysdl.h rubysdl_video.o: rubysdl_video.c rubysdl.h rubysdl_mixer.o: rubysdl_mixer.c rubysdl.h rubysdl_time.o: rubysdl_time.c rubysdl.h rubysdl_wm.o: rubysdl_wm.c rubysdl.h rubysdl_mouse.o: rubysdl_mouse.c rubysdl.h rubysdl_sge_video.o: rubysdl_sge_video.c rubysdl.h rubysdl_image.o: rubysdl_image.c rubysdl.h rubysdl_ttf.o: rubysdl_ttf.c rubysdl.h rubysdl_joystick.o: rubysdl_joystick.c rubysdl.h rubysdl_cdrom.o: rubysdl_cdrom.c rubysdl.h rubysdl_pixel.o: rubysdl_pixel.c rubysdl.h rubysdl_smpeg.o: rubysdl_smpeg.c rubysdl.h rubysdl_sdlskk.o: rubysdl_sdlskk.c rubysdl.h rubysdl_kanji.o: rubysdl_kanji.c rubysdl.h SDL_kanji.h SDL_kanji.o: SDL_kanji.c SDL_kanji.h CLEANOBJS += sge/*.o rubysdl-2.1.3/doc/0000755000175000017500000000000012241573411012370 5ustar ohaiohairubysdl-2.1.3/doc/rubysdl_ref.rd0000644000175000017500000073107612241573411015255 0ustar ohaiohai= 目次 * ((<"Ruby/SDLの概要">)) * ((<初期化>)) * ((