├── .editorconfig ├── .github └── workflows │ ├── continuous-integration.yml │ └── update-docs.yml ├── .gitignore ├── CMakeLists.txt ├── CONTRIBUTORS.txt ├── LICENSE.txt ├── README.md ├── README.txt ├── README_android.txt ├── README_cmake.txt ├── README_iphone.txt ├── README_macosx.txt ├── README_make.txt ├── README_msvc.txt ├── README_packaging.txt ├── README_pkgconfig.txt ├── README_raspberrypi.txt ├── README_releasing.txt ├── README_sdl.txt ├── README_windows.txt ├── SECURITY.md ├── addons ├── CMakeLists.txt ├── acodec │ ├── CMakeLists.txt │ ├── acodec.c │ ├── acodec.h │ ├── allegro5 │ │ ├── allegro_acodec.h │ │ └── internal │ │ │ └── aintern_acodec_cfg.h.cmake │ ├── dumb.c │ ├── flac.c │ ├── helper.c │ ├── helper.h │ ├── modaudio.c │ ├── mp3.c │ ├── ogg.c │ ├── openmpt.c │ ├── opus.c │ ├── voc.c │ └── wav.c ├── audio │ ├── CMakeLists.txt │ ├── allegro5 │ │ ├── allegro_audio.h │ │ └── internal │ │ │ ├── aintern_audio.h │ │ │ └── aintern_audio_cfg.h.cmake │ ├── alsa.c │ ├── aqueue.m │ ├── audio.c │ ├── audio_io.c │ ├── dsound.cpp │ ├── kcm_dtor.c │ ├── kcm_instance.c │ ├── kcm_mixer.c │ ├── kcm_mixer_helpers.inc │ ├── kcm_sample.c │ ├── kcm_stream.c │ ├── kcm_voice.c │ ├── openal.c │ ├── opensl.c │ ├── oss.c │ ├── pulseaudio.c │ ├── recorder.c │ └── sdl_audio.c ├── color │ ├── CMakeLists.txt │ ├── allegro5 │ │ └── allegro_color.h │ └── color.c ├── font │ ├── CMakeLists.txt │ ├── allegro5 │ │ ├── allegro_font.h │ │ └── internal │ │ │ └── aintern_font.h │ ├── bmfont.c │ ├── font.c │ ├── font.h │ ├── fontbmp.c │ ├── stdfont.c │ ├── text.c │ ├── xml.c │ └── xml.h ├── image │ ├── CMakeLists.txt │ ├── allegro5 │ │ ├── allegro_image.h │ │ └── internal │ │ │ ├── aintern_image.h │ │ │ └── aintern_image_cfg.h.cmake │ ├── android.c │ ├── bmp.c │ ├── dds.c │ ├── freeimage.c │ ├── gdiplus.cpp │ ├── identify.c │ ├── iio.c │ ├── iio.h │ ├── iphone.m │ ├── jpg.c │ ├── macosx.m │ ├── pcx.c │ ├── png.c │ ├── tga.c │ └── webp.c ├── main │ ├── CMakeLists.txt │ ├── generic_main.c │ └── osx_main.m ├── memfile │ ├── CMakeLists.txt │ ├── allegro5 │ │ └── allegro_memfile.h │ └── memfile.c ├── native_dialog │ ├── CMakeLists.txt │ ├── allegro5 │ │ ├── allegro_native_dialog.h │ │ └── internal │ │ │ ├── aintern_native_dialog.h │ │ │ └── aintern_native_dialog_cfg.h.cmake │ ├── android_dialog.c │ ├── dialog.c │ ├── gtk_dialog.c │ ├── gtk_dialog.h │ ├── gtk_filesel.c │ ├── gtk_menu.c │ ├── gtk_msgbox.c │ ├── gtk_textlog.c │ ├── gtk_thread.c │ ├── gtk_xgtk.c │ ├── gtk_xgtk.h │ ├── iphone_dialog.m │ ├── menu.c │ ├── osx_dialog.m │ ├── textlog.c │ └── win_dialog.c ├── physfs │ ├── CMakeLists.txt │ ├── a5_physfs.c │ ├── a5_physfs_dir.c │ ├── allegro5 │ │ └── allegro_physfs.h │ └── allegro_physfs_intern.h ├── primitives │ ├── CMakeLists.txt │ ├── allegro5 │ │ ├── allegro_primitives.h │ │ └── internal │ │ │ ├── aintern_prim.h │ │ │ ├── aintern_prim_directx.h │ │ │ ├── aintern_prim_opengl.h │ │ │ └── aintern_prim_soft.h │ ├── directx_shaders.cpp │ ├── high_primitives.c │ ├── line_soft.c │ ├── nshader.cpp │ ├── nshader.fx │ ├── point_soft.c │ ├── polygon.c │ ├── polyline.c │ ├── precompiled_shaders.inc │ ├── prim_directx.cpp │ ├── prim_opengl.c │ ├── prim_soft.c │ ├── prim_util.c │ ├── primitives.c │ └── triangulator.c ├── ttf │ ├── CMakeLists.txt │ ├── allegro5 │ │ ├── allegro_ttf.h │ │ └── internal │ │ │ └── aintern_ttf_cfg.h.cmake │ └── ttf.c └── video │ ├── CMakeLists.txt │ ├── allegro5 │ ├── allegro_video.h │ └── internal │ │ ├── aintern_video.h │ │ └── aintern_video_cfg.h.cmake │ ├── ogv.c │ └── video.c ├── allegro5.cfg ├── android ├── CMakeLists.txt └── gradle_project │ ├── allegro │ ├── build.gradle │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── org │ │ └── liballeg │ │ └── android │ │ ├── AllegroAPKList.java │ │ ├── AllegroAPKStream.java │ │ ├── AllegroActivity.java │ │ ├── AllegroDialog.java │ │ ├── AllegroEGL.java │ │ ├── AllegroInputStream.java │ │ ├── AllegroJoystick.java │ │ ├── AllegroSurface.java │ │ ├── Clipboard.java │ │ ├── Const.java │ │ ├── ImageLoader.java │ │ ├── Key.java │ │ ├── KeyListener.java │ │ ├── Path.java │ │ ├── Reflect.java │ │ ├── ScreenLock.java │ │ ├── Sensors.java │ │ └── TouchListener.java │ ├── app │ ├── build.gradle │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── org │ │ └── liballeg │ │ └── app │ │ └── MainActivity.java │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── local.properties │ └── settings.gradle ├── appveyor.yml ├── cmake ├── AllegroConfig.cmake.in ├── AllegroFindFFMPEG.cmake ├── AllegroFindOSS.cmake ├── AndroidApp.cmake ├── Common.cmake ├── FileList.cmake ├── FindCg.cmake ├── FindDUMB.cmake ├── FindDXGuid.cmake ├── FindDirectX.cmake ├── FindENet.cmake ├── FindFLAC.cmake ├── FindFreeImage.cmake ├── FindGDIPLUS.cmake ├── FindHarfBuzz.cmake ├── FindMiniMP3.cmake ├── FindOgg.cmake ├── FindOpenGLES1.cmake ├── FindOpenGLES2.cmake ├── FindOpenGLES3.cmake ├── FindOpenMPT.cmake ├── FindOpenSL.cmake ├── FindOpus.cmake ├── FindSDL2.cmake ├── FindTheora.cmake ├── FindTremor.cmake ├── FindVorbis.cmake ├── FindWebP.cmake ├── PreventInSourceBuilds.cmake ├── Toolchain-iphone.cmake ├── Toolchain-mingw.cmake ├── Toolchain-openwiz.cmake └── Toolchain-raspberrypi.cmake ├── contrib └── luajit │ ├── CMakeLists.txt │ ├── README.txt │ └── generate_luajit_ffi.py ├── demos ├── cosmic_protector │ ├── CMakeLists.txt │ ├── data │ │ ├── gfx │ │ │ ├── Icon.icns │ │ │ ├── background.jpg │ │ │ ├── icon48.png │ │ │ ├── large_asteroid.png │ │ │ ├── large_bullet.png │ │ │ ├── large_explosion_0.png │ │ │ ├── large_explosion_1.png │ │ │ ├── large_explosion_2.png │ │ │ ├── large_explosion_3.png │ │ │ ├── large_explosion_4.png │ │ │ ├── large_font.png │ │ │ ├── life_powerup.png │ │ │ ├── logo.png │ │ │ ├── medium_asteroid.png │ │ │ ├── ship.png │ │ │ ├── ship_icon.tga │ │ │ ├── ship_trans.png │ │ │ ├── small_asteroid.png │ │ │ ├── small_bullet.png │ │ │ ├── small_explosion_0.png │ │ │ ├── small_explosion_1.png │ │ │ ├── small_explosion_2.png │ │ │ ├── small_explosion_3.png │ │ │ ├── small_explosion_4.png │ │ │ ├── small_font.png │ │ │ ├── trail.png │ │ │ ├── ufo0.png │ │ │ ├── ufo1.png │ │ │ ├── ufo2.png │ │ │ └── weapon_powerup.png │ │ └── sfx │ │ │ ├── big_explosion.ogg │ │ │ ├── collision.ogg │ │ │ ├── fire_large.ogg │ │ │ ├── fire_small.ogg │ │ │ ├── game_music.ogg │ │ │ ├── powerup.ogg │ │ │ ├── small_explosion.ogg │ │ │ └── title_music.ogg │ ├── include │ │ ├── Asteroid.hpp │ │ ├── BitmapResource.hpp │ │ ├── Bullet.hpp │ │ ├── ButtonWidget.hpp │ │ ├── Debug.hpp │ │ ├── DisplayResource.hpp │ │ ├── Entity.hpp │ │ ├── Explosion.hpp │ │ ├── FontResource.hpp │ │ ├── Game.hpp │ │ ├── Input.hpp │ │ ├── LargeAsteroid.hpp │ │ ├── LargeBullet.hpp │ │ ├── LargeSlowBullet.hpp │ │ ├── MediumAsteroid.hpp │ │ ├── Player.hpp │ │ ├── PowerUp.hpp │ │ ├── Resource.hpp │ │ ├── ResourceManager.hpp │ │ ├── SampleResource.hpp │ │ ├── SmallAsteroid.hpp │ │ ├── SmallBullet.hpp │ │ ├── StreamResource.hpp │ │ ├── UFO.hpp │ │ ├── Wave.hpp │ │ ├── Weapon.hpp │ │ ├── Widget.hpp │ │ ├── collision.hpp │ │ ├── cosmic_protector.hpp │ │ ├── cosmic_protector_objc.h │ │ ├── gui.hpp │ │ ├── joypad_c.h │ │ ├── joypad_handler.h │ │ ├── logic.hpp │ │ ├── render.hpp │ │ └── sound.hpp │ └── src │ │ ├── Asteroid.cpp │ │ ├── BitmapResource.cpp │ │ ├── Bullet.cpp │ │ ├── ButtonWidget.cpp │ │ ├── Debug.cpp │ │ ├── DisplayResource.cpp │ │ ├── Entity.cpp │ │ ├── Explosion.cpp │ │ ├── FontResource.cpp │ │ ├── GUI.cpp │ │ ├── Game.cpp │ │ ├── Input.cpp │ │ ├── LargeAsteroid.cpp │ │ ├── LargeBullet.cpp │ │ ├── LargeSlowBullet.cpp │ │ ├── MediumAsteroid.cpp │ │ ├── Player.cpp │ │ ├── PowerUp.cpp │ │ ├── Resource.cpp │ │ ├── ResourceManager.cpp │ │ ├── SampleResource.cpp │ │ ├── SmallAsteroid.cpp │ │ ├── SmallBullet.cpp │ │ ├── StreamResource.cpp │ │ ├── UFO.cpp │ │ ├── collision.cpp │ │ ├── cosmic_protector.cpp │ │ ├── cosmic_protector_objc.m │ │ ├── joypad_dummy.cpp │ │ ├── joypad_handler.m │ │ ├── logic.cpp │ │ ├── render.cpp │ │ ├── sound.cpp │ │ └── wave.cpp ├── shooter │ ├── CMakeLists.txt │ ├── aster.c │ ├── aster.h │ ├── bullet.c │ ├── bullet.h │ ├── data.c │ ├── data.h │ ├── data │ │ ├── AST.png │ │ ├── BOOM_SPL.wav │ │ ├── DEATH_SPL.wav │ │ ├── ENGINE1.png │ │ ├── ENGINE2.png │ │ ├── ENGINE3.png │ │ ├── ENGINE4.png │ │ ├── ENGINE5.png │ │ ├── ENGINE6.png │ │ ├── ENGINE7.png │ │ ├── ENGINE_SPL.wav │ │ ├── GAME_MUSIC.ogg │ │ ├── GO_BMP.png │ │ ├── INTRO_ANIM.png │ │ ├── INTRO_BMP_1.png │ │ ├── INTRO_BMP_2.png │ │ ├── INTRO_BMP_3.png │ │ ├── INTRO_BMP_4.png │ │ ├── INTRO_SPL.wav │ │ ├── ROCKET.png │ │ ├── SHIP1.png │ │ ├── SHIP2.png │ │ ├── SHIP3.png │ │ ├── SHIP4.png │ │ ├── SHIP5.png │ │ ├── SHOOT_SPL.wav │ │ ├── TITLE_BMP.png │ │ ├── WELCOME_SPL.wav │ │ └── text.ini │ ├── demo.c │ ├── demo.h │ ├── expl.c │ ├── expl.h │ ├── game.c │ ├── game.h │ ├── star.c │ ├── star.h │ ├── title.c │ └── title.h ├── skater │ ├── CMakeLists.txt │ ├── blender │ │ ├── ademo_export.py │ │ ├── level.blend.gz │ │ └── readme.txt │ ├── data │ │ ├── audio │ │ │ ├── ding.ogg │ │ │ ├── dooropen.ogg │ │ │ ├── pop.ogg │ │ │ ├── skating.ogg │ │ │ └── wave.ogg │ │ ├── graphics │ │ │ ├── bananas.png │ │ │ ├── cherries.png │ │ │ ├── cloud.png │ │ │ ├── dooropen.png │ │ │ ├── doorshut.png │ │ │ ├── exitsign.png │ │ │ ├── grass.png │ │ │ ├── ice.png │ │ │ ├── icecream.png │ │ │ ├── icetip.png │ │ │ ├── orange.png │ │ │ ├── skatefast.png │ │ │ ├── skatemed.png │ │ │ ├── skater1.png │ │ │ ├── skater2.png │ │ │ ├── skater3.png │ │ │ ├── skater4.png │ │ │ ├── skateslow.png │ │ │ ├── soil.png │ │ │ ├── sweet.png │ │ │ └── water.png │ │ ├── level.txt │ │ ├── menu │ │ │ ├── back.png │ │ │ ├── button.ogg │ │ │ ├── cancunsmall.png │ │ │ ├── endoflevel.ogg │ │ │ ├── intro_music.ogg │ │ │ ├── logofont.png │ │ │ ├── menu_music.ogg │ │ │ ├── skate2.ogg │ │ │ └── welcome.ogg │ │ ├── readme.txt │ │ └── thanks.txt │ └── src │ │ ├── anim.c │ │ ├── anim.h │ │ ├── background_scroller.c │ │ ├── background_scroller.h │ │ ├── credits.c │ │ ├── credits.h │ │ ├── defines.h │ │ ├── demodata.h │ │ ├── fps.c │ │ ├── fps.h │ │ ├── framework.c │ │ ├── framework.h │ │ ├── game.c │ │ ├── game.h │ │ ├── gamepad.c │ │ ├── gamepad.h │ │ ├── gamestate.h │ │ ├── global.c │ │ ├── global.h │ │ ├── intro.c │ │ ├── keyboard.c │ │ ├── keyboard.h │ │ ├── level.c │ │ ├── level.h │ │ ├── level_alloc.c │ │ ├── level_alloc.h │ │ ├── level_file.c │ │ ├── level_file.h │ │ ├── level_state.c │ │ ├── menu.c │ │ ├── menu.h │ │ ├── menu_about.c │ │ ├── menu_controls.c │ │ ├── menu_graphics.c │ │ ├── menu_main.c │ │ ├── menu_misc.c │ │ ├── menu_options.c │ │ ├── menu_sound.c │ │ ├── menu_success.c │ │ ├── menus.h │ │ ├── mouse.c │ │ ├── mouse.h │ │ ├── music.c │ │ ├── music.h │ │ ├── physics.c │ │ ├── physics.h │ │ ├── quadtree.c │ │ ├── quadtree.h │ │ ├── screenshot.c │ │ ├── screenshot.h │ │ ├── skater.c │ │ ├── token.c │ │ ├── token.h │ │ ├── transition.c │ │ ├── transition.h │ │ ├── vcontroller.c │ │ └── vcontroller.h └── speed │ ├── 29.txt │ ├── CMakeLists.txt │ ├── a4_aux.c │ ├── a4_aux.h │ ├── badguys.c │ ├── bullets.c │ ├── explode.c │ ├── hiscore.c │ ├── main.c │ ├── message.c │ ├── player.c │ ├── port.txt │ ├── sound.c │ ├── speed.h │ ├── speed.txt │ ├── title.c │ ├── update.pl │ └── view.c ├── docs ├── CMakeLists.txt ├── Refman.cmake ├── scripts │ ├── aatree.c │ ├── aatree.h │ ├── check_consistency │ ├── dawk.c │ ├── dawk.h │ ├── insert_timestamp.c │ ├── make_doc.c │ ├── make_doc.h │ ├── make_html_refs.c │ ├── make_index.c │ ├── make_man.c │ ├── make_protos.c │ ├── make_search_index.c │ ├── make_single.c │ ├── scan_examples.c │ ├── trex.c │ ├── trex.h │ └── trex.txt └── src │ ├── autosuggest.js │ ├── changes-5.0.txt │ ├── changes-5.1.txt │ ├── changes-5.2.txt │ ├── custom_header.html │ ├── pandoc.css │ └── refman │ ├── acodec.txt │ ├── allegro_version.tex.cmake │ ├── audio.txt │ ├── color.txt │ ├── config.txt │ ├── direct3d.txt │ ├── display.txt │ ├── events.txt │ ├── file.txt │ ├── fixed.txt │ ├── font.txt │ ├── fshook.txt │ ├── fullscreen_mode.txt │ ├── getting_started.txt │ ├── graphics.txt │ ├── haptic.txt │ ├── image.txt │ ├── images │ ├── LINE_CAP.png │ ├── LINE_CAP.svg │ ├── LINE_JOIN.png │ ├── LINE_JOIN.svg │ ├── audio.png │ ├── audio.svg │ ├── primitives1.png │ ├── primitives1.svg │ ├── primitives2.png │ └── primitives2.svg │ ├── inc.a.txt │ ├── inc.z.txt │ ├── index.txt │ ├── joystick.txt │ ├── keyboard.txt │ ├── latex.template │ ├── main.txt │ ├── memfile.txt │ ├── memory.txt │ ├── misc.txt │ ├── monitor.txt │ ├── mouse.txt │ ├── native_dialog.txt │ ├── opengl.txt │ ├── path.txt │ ├── physfs.txt │ ├── platform.txt │ ├── primitives.txt │ ├── shader.txt │ ├── state.txt │ ├── system.txt │ ├── threads.txt │ ├── time.txt │ ├── timer.txt │ ├── title.txt │ ├── touch.txt │ ├── transformations.txt │ ├── utf8.txt │ └── video.txt ├── examples ├── CMakeLists.txt ├── Helper.cmake ├── common.c ├── data │ ├── DejaVuSans.LICENSE │ ├── DejaVuSans.ttf │ ├── NotoColorEmoji.LICENSE │ ├── NotoColorEmoji_Animals.ttf │ ├── a4_font.fnt │ ├── a4_font.tga │ ├── alexlogo.bmp │ ├── alexlogo.png │ ├── allegro.pcx │ ├── bkg.png │ ├── blue_box.png │ ├── bmpfont.tga │ ├── cursor.tga │ ├── ex_physfs.zip │ ├── ex_prim_shader_pixel.glsl │ ├── ex_prim_shader_pixel.hlsl │ ├── ex_prim_shader_vertex.glsl │ ├── ex_prim_shader_vertex.hlsl │ ├── ex_prim_wrap_pixel.glsl │ ├── ex_prim_wrap_pixel.hlsl │ ├── ex_shader_multitex_pixel.glsl │ ├── ex_shader_multitex_pixel.hlsl │ ├── ex_shader_palette_pixel.glsl │ ├── ex_shader_pixel.glsl │ ├── ex_shader_pixel.hlsl │ ├── ex_shader_vertex.glsl │ ├── ex_shader_vertex.hlsl │ ├── ex_ttf.ini │ ├── exconfig.ini │ ├── fakeamp.bmp │ ├── fixed_font.tga │ ├── font.tga │ ├── gradient1.bmp │ ├── green.png │ ├── haiku │ │ ├── air_0.ogg │ │ ├── air_1.ogg │ │ ├── air_2.ogg │ │ ├── air_3.ogg │ │ ├── air_4.ogg │ │ ├── air_5.ogg │ │ ├── air_6.ogg │ │ ├── air_7.ogg │ │ ├── air_effect.png │ │ ├── black_bead_opaque_A.png │ │ ├── dropshadow.png │ │ ├── earth4.png │ │ ├── earth_0.ogg │ │ ├── earth_1.ogg │ │ ├── earth_2.ogg │ │ ├── earth_3.ogg │ │ ├── earth_4.ogg │ │ ├── earth_5.ogg │ │ ├── earth_6.ogg │ │ ├── earth_7.ogg │ │ ├── fire.png │ │ ├── fire_0.ogg │ │ ├── fire_1.ogg │ │ ├── fire_2.ogg │ │ ├── fire_3.ogg │ │ ├── fire_4.ogg │ │ ├── fire_5.ogg │ │ ├── fire_6.ogg │ │ ├── fire_7.ogg │ │ ├── flame2.png │ │ ├── healthy_glow.png │ │ ├── main_flame2.png │ │ ├── overlay_pretty.png │ │ ├── select.ogg │ │ ├── water.png │ │ ├── water_0.ogg │ │ ├── water_1.ogg │ │ ├── water_2.ogg │ │ ├── water_3.ogg │ │ ├── water_4.ogg │ │ ├── water_5.ogg │ │ ├── water_6.ogg │ │ ├── water_7.ogg │ │ ├── water_droplets.png │ │ └── wind3.png │ ├── icon.png │ ├── icon.tga │ ├── mask.pcx │ ├── mysha.pcx │ ├── mysha.tga │ ├── mysha256x256.png │ ├── mysha256x256.webp │ ├── mysha_dxt1.dds │ ├── mysha_dxt3.dds │ ├── mysha_dxt5.dds │ ├── mysha_pal.png │ ├── obp.jpg │ ├── planet.pcx │ ├── sample.cfg │ ├── texture.tga │ ├── texture2.tga │ ├── welcome.voc │ └── welcome.wav ├── enet_common.h ├── ex_acodec.c ├── ex_acodec_multi.c ├── ex_android.c ├── ex_audio_chain.cpp ├── ex_audio_devices.c ├── ex_audio_props.cpp ├── ex_audio_simple.c ├── ex_audio_timer.c ├── ex_bitmap.c ├── ex_bitmap_file.c ├── ex_bitmap_flip.c ├── ex_blend.c ├── ex_blend2.cpp ├── ex_blend_bench.c ├── ex_blend_target.c ├── ex_blend_test.c ├── ex_blit.c ├── ex_camera.c ├── ex_clip.c ├── ex_clipboard.c ├── ex_color.cpp ├── ex_color2.c ├── ex_color_gradient.c ├── ex_compressed.c ├── ex_config.c ├── ex_convert.c ├── ex_cpu.c ├── ex_curl.c ├── ex_d3d.cpp ├── ex_depth_mask.c ├── ex_depth_target.c ├── ex_dir.c ├── ex_disable_screensaver.c ├── ex_display_events.c ├── ex_display_options.c ├── ex_drag_and_drop.c ├── ex_draw.c ├── ex_draw_bitmap.c ├── ex_drawpixels.c ├── ex_dualies.c ├── ex_emoji.c ├── ex_enet_client.c ├── ex_enet_server.c ├── ex_expose.c ├── ex_file.c ├── ex_file_slice.c ├── ex_filter.c ├── ex_font.c ├── ex_font_justify.cpp ├── ex_font_multiline.cpp ├── ex_fs_resize.c ├── ex_fs_window.c ├── ex_get_path.c ├── ex_gldepth.c ├── ex_glext.c ├── ex_haiku.c ├── ex_haptic.c ├── ex_haptic2.cpp ├── ex_icon.c ├── ex_icon2.c ├── ex_inject_events.c ├── ex_joystick_events.c ├── ex_joystick_hotplugging.c ├── ex_kcm_direct.c ├── ex_keyboard_events.c ├── ex_keyboard_focus.c ├── ex_lines.c ├── ex_loading_thread.c ├── ex_lockbitmap.c ├── ex_logo.c ├── ex_membmp.c ├── ex_memfile.c ├── ex_menu.c ├── ex_mixer_chain.c ├── ex_mixer_pp.c ├── ex_monitorinfo.c ├── ex_mouse.c ├── ex_mouse_cursor.c ├── ex_mouse_events.c ├── ex_mouse_focus.c ├── ex_mouse_warp.c ├── ex_multisample.c ├── ex_multisample_target.c ├── ex_multiwin.c ├── ex_native_filechooser.c ├── ex_nodisplay.c ├── ex_noframe.c ├── ex_ogre3d.cpp ├── ex_opengl.c ├── ex_opengl_pixel_shader.c ├── ex_palette.c ├── ex_path.c ├── ex_path_test.c ├── ex_physfs.c ├── ex_pixelformat.cpp ├── ex_polygon.c ├── ex_premulalpha.c ├── ex_prim.c ├── ex_prim_shader.c ├── ex_prim_wrap.c ├── ex_projection.c ├── ex_projection2.c ├── ex_record.c ├── ex_record_name.c ├── ex_reparent.c ├── ex_resample_test.c ├── ex_resize.c ├── ex_resize2.c ├── ex_rotate.c ├── ex_saw.c ├── ex_scale.c ├── ex_shader.cpp ├── ex_shader_multitex.c ├── ex_shader_target.c ├── ex_stream_file.c ├── ex_stream_seek.c ├── ex_subbitmap.c ├── ex_synth.cpp ├── ex_threads.c ├── ex_threads2.c ├── ex_timedwait.c ├── ex_timer.c ├── ex_timer_pause.c ├── ex_touch_input.c ├── ex_transform.c ├── ex_ttf.c ├── ex_user_events.c ├── ex_utf8.c ├── ex_vertex_buffer.c ├── ex_video.c ├── ex_vsync.c ├── ex_window_constraints.c ├── ex_window_maximized.c ├── ex_window_title.c ├── ex_windows.c ├── ex_winfull.c ├── nihgui.cpp └── nihgui.hpp ├── include └── allegro5 │ ├── alcompat.h │ ├── allegro.h │ ├── allegro5.h │ ├── allegro_android.h │ ├── allegro_direct3d.h │ ├── allegro_iphone.h │ ├── allegro_iphone_objc.h │ ├── allegro_opengl.h │ ├── allegro_osx.h │ ├── allegro_windows.h │ ├── allegro_x.h │ ├── altime.h │ ├── base.h │ ├── bitmap.h │ ├── bitmap_draw.h │ ├── bitmap_io.h │ ├── bitmap_lock.h │ ├── blender.h │ ├── clipboard.h │ ├── color.h │ ├── config.h │ ├── cpu.h │ ├── debug.h │ ├── display.h │ ├── drawing.h │ ├── error.h │ ├── events.h │ ├── file.h │ ├── fixed.h │ ├── fmaths.h │ ├── fshook.h │ ├── fullscreen_mode.h │ ├── haptic.h │ ├── inline │ └── fmaths.inl │ ├── internal │ ├── aintern.h │ ├── aintern_aatree.h │ ├── aintern_android.h │ ├── aintern_atomicops.h │ ├── aintern_bitmap.h │ ├── aintern_blend.h │ ├── aintern_config.h │ ├── aintern_convert.h │ ├── aintern_debug.h │ ├── aintern_direct3d.h │ ├── aintern_display.h │ ├── aintern_driver.h │ ├── aintern_dtor.h │ ├── aintern_events.h │ ├── aintern_exitfunc.h │ ├── aintern_file.h │ ├── aintern_float.h │ ├── aintern_fshook.h │ ├── aintern_gp2xwiz.h │ ├── aintern_haptic.h │ ├── aintern_iphone.h │ ├── aintern_joystick.h │ ├── aintern_keyboard.h │ ├── aintern_list.h │ ├── aintern_ljoynu.h │ ├── aintern_memblit.h │ ├── aintern_memdraw.h │ ├── aintern_mouse.h │ ├── aintern_opengl.h │ ├── aintern_osxclipboard.h │ ├── aintern_path.h │ ├── aintern_pixels.h │ ├── aintern_raspberrypi.h │ ├── aintern_shader.h │ ├── aintern_system.h │ ├── aintern_thread.h │ ├── aintern_timer.h │ ├── aintern_tls.h │ ├── aintern_touch_input.h │ ├── aintern_transform.h │ ├── aintern_tri_soft.h │ ├── aintern_vector.h │ ├── aintern_wclipboard.h │ ├── aintern_wjoyall.h │ ├── aintern_wjoydxnu.h │ ├── aintern_wjoyxi.h │ ├── aintern_wunicode.h │ ├── aintern_x.h │ ├── aintern_xclipboard.h │ ├── aintern_xcursor.h │ ├── aintern_xdisplay.h │ ├── aintern_xdnd.h │ ├── aintern_xembed.h │ ├── aintern_xevents.h │ ├── aintern_xfullscreen.h │ ├── aintern_xglx_config.h │ ├── aintern_xkeyboard.h │ ├── aintern_xmouse.h │ ├── aintern_xsystem.h │ ├── aintern_xtouch.h │ ├── aintern_xwindow.h │ ├── alconfig.h │ └── bstrlib.h │ ├── joystick.h │ ├── keyboard.h │ ├── keycodes.h │ ├── memory.h │ ├── monitor.h │ ├── mouse.h │ ├── mouse_cursor.h │ ├── opengl │ ├── GLext │ │ ├── gl_ext_alias.h │ │ ├── gl_ext_api.h │ │ ├── gl_ext_defs.h │ │ ├── gl_ext_list.h │ │ ├── glx_ext_alias.h │ │ ├── glx_ext_api.h │ │ ├── glx_ext_defs.h │ │ ├── glx_ext_list.h │ │ ├── wgl_ext_alias.h │ │ ├── wgl_ext_api.h │ │ ├── wgl_ext_defs.h │ │ └── wgl_ext_list.h │ └── gl_ext.h │ ├── path.h │ ├── platform │ ├── aintandroid.h │ ├── aintiphone.h │ ├── aintlnx.h │ ├── aintosx.h │ ├── aintraspberrypi.h │ ├── aintunix.h │ ├── aintuthr.h │ ├── aintwin.h │ ├── aintwiz.h │ ├── aintwthr.h │ ├── aintxglx.h │ ├── alandroid.h │ ├── alandroidcfg.h │ ├── albcc32.h │ ├── aldmc.h │ ├── aliphone.h │ ├── aliphonecfg.h │ ├── allegro_internal_sdl.h │ ├── allegro_sdl_config.h │ ├── allegro_sdl_thread.h │ ├── almngw32.h │ ├── almsvc.h │ ├── alosx.h │ ├── alosxcfg.h │ ├── alplatf.h.cmake │ ├── alraspberrypi.h │ ├── alraspberrypicfg.h │ ├── alucfg.h │ ├── alunix.h │ ├── alwatcom.h │ ├── alwin.h │ ├── alwiz.h │ ├── alwizcfg.h │ ├── astdbool.h │ └── astdint.h │ ├── render_state.h │ ├── shader.h │ ├── system.h │ ├── threads.h │ ├── timer.h │ ├── tls.h │ ├── touch_input.h │ ├── transformations.h │ └── utf8.h ├── indent.pro ├── misc ├── Allegro5_iOS │ ├── Allegro5_iOS.xcodeproj │ │ └── project.pbxproj │ └── allegro5 │ │ ├── internal │ │ ├── aintern_image_cfg.h │ │ └── aintern_ttf_cfg.h │ │ └── platform │ │ └── alplatf.h ├── allegro.pc.in ├── allegro_acodec.pc.in ├── allegro_audio.pc.in ├── allegro_color.pc.in ├── allegro_dialog.pc.in ├── allegro_font.pc.in ├── allegro_image.pc.in ├── allegro_main.pc.in ├── allegro_memfile.pc.in ├── allegro_monolith.pc.in ├── allegro_physfs.pc.in ├── allegro_primitives.pc.in ├── allegro_ttf.pc.in ├── allegro_video.pc.in ├── askq.c ├── convert_line_endings.sh ├── coverage.sh ├── create_release_archives.sh ├── dtou.sh ├── embedman.bat ├── filter_animals_ttx.py ├── fixver.sh ├── gcc-uni.sh ├── gl_mkalias.sh ├── icon.png ├── icon.xpm ├── install_test.c ├── make_converters.py ├── make_icon.py ├── make_mixer_helpers.py ├── make_pixel_tables.py ├── make_scanline_drawers.py ├── mkunixdists.sh ├── msvchelp.c ├── regenerate.sh ├── utod.sh ├── vcvars.c ├── zipup.sh └── zipwin.sh ├── python ├── CMakeLists.txt ├── checkdocs.py ├── ex_draw_bitmap.py ├── generate_python_ctypes.py ├── pong.py └── readme.txt ├── src ├── allegro.c ├── android │ ├── android_apk_file.c │ ├── android_apk_fs.c │ ├── android_clipboard.c │ ├── android_display.c │ ├── android_image.c │ ├── android_input_stream.c │ ├── android_joystick.c │ ├── android_keyboard.c │ ├── android_mouse.c │ ├── android_sensors.c │ ├── android_system.c │ ├── android_touch.c │ └── jni_helpers.c ├── bitmap.c ├── bitmap_draw.c ├── bitmap_io.c ├── bitmap_lock.c ├── bitmap_pixel.c ├── bitmap_type.c ├── blenders.c ├── clipboard.c ├── config.c ├── convert.c ├── cpu.c ├── debug.c ├── display.c ├── display_settings.c ├── drawing.c ├── dtor.c ├── events.c ├── evtsrc.c ├── exitfunc.c ├── file.c ├── file_slice.c ├── file_stdio.c ├── fshook.c ├── fshook_stdio.c ├── fshook_win.inc ├── fullscreen_mode.c ├── gp2xwiz │ ├── wiz_display_fb.c │ ├── wiz_display_opengl.c │ ├── wiz_joystick.c │ └── wiz_system.c ├── haptic.c ├── inline.c ├── iphone │ ├── EAGLView.h │ ├── EAGLView.m │ ├── ViewController.h │ ├── ViewController.m │ ├── allegroAppDelegate.h │ ├── allegroAppDelegate.m │ ├── iphone.h │ ├── iphone_clipboard.m │ ├── iphone_display.m │ ├── iphone_joystick.m │ ├── iphone_keyboard.c │ ├── iphone_main.m │ ├── iphone_mouse.m │ ├── iphone_path.m │ ├── iphone_system.c │ └── iphone_touch_input.m ├── joynu.c ├── keybdnu.c ├── libc.c ├── linux │ ├── lhaptic.c │ ├── ljoynu.c │ ├── lkeybdnu.c │ ├── lmsedrv.c │ └── lmseev.c ├── macosx │ ├── hidjoy.m │ ├── hidman.m │ ├── keybd.m │ ├── osx_app_delegate.m │ ├── osxclipboard.m │ ├── osxgl.h │ ├── osxgl.m │ ├── qzmouse.m │ └── system.m ├── math.c ├── memblit.c ├── memdraw.c ├── memory.c ├── misc │ ├── aatree.c │ ├── bstrlib.c │ ├── bstrlib.txt │ ├── list.c │ └── vector.c ├── monitor.c ├── mouse_cursor.c ├── mousenu.c ├── opengl │ ├── extensions.c │ ├── ogl_bitmap.c │ ├── ogl_display.c │ ├── ogl_draw.c │ ├── ogl_fbo.c │ ├── ogl_helpers.h │ ├── ogl_lock.c │ ├── ogl_lock_es.c │ ├── ogl_render_state.c │ └── ogl_shader.c ├── path.c ├── pixel_tables.inc ├── pixels.c ├── raspberrypi │ ├── picursor.h │ ├── pidisplay.c │ └── pisystem.c ├── scanline_drawers.inc ├── sdl │ ├── sdl_display.c │ ├── sdl_event_hack.c │ ├── sdl_joystick.c │ ├── sdl_keyboard.c │ ├── sdl_mouse.c │ ├── sdl_system.c │ ├── sdl_thread.c │ ├── sdl_time.c │ └── sdl_touch.c ├── shader.c ├── shader_source.inc ├── system.c ├── threads.c ├── timernu.c ├── tls.c ├── tls_dll.inc ├── tls_native.inc ├── tls_pthread.inc ├── touch_input.c ├── transformations.c ├── tri_soft.c ├── unix │ ├── udrvlist.c │ ├── ufdwatch.c │ ├── ugfxdrv.c │ ├── uhapdrv.c │ ├── ujoydrv.c │ ├── ukeybd.c │ ├── umouse.c │ ├── upath.c │ ├── utime.c │ └── uxthread.c ├── utf8.c ├── win │ ├── d3d.h │ ├── d3d_bmp.cpp │ ├── d3d_d3dx9.cpp │ ├── d3d_disp.cpp │ ├── d3d_display_formats.cpp │ ├── d3d_render_state.cpp │ ├── d3d_shader.cpp │ ├── wclipboard.c │ ├── wgl.h │ ├── wgl_disp.c │ ├── whapall.c │ ├── whapdrv.c │ ├── whaptic.cpp │ ├── whapxi.c │ ├── wjoyall.c │ ├── wjoydrv.c │ ├── wjoydxnu.cpp │ ├── wjoyxi.c │ ├── wkeyboard.c │ ├── wmcursor.c │ ├── wmouse.c │ ├── wsystem.c │ ├── wthread.c │ ├── wtime.c │ ├── wtouch_input.c │ ├── wunicode.c │ ├── wwindow.c │ └── wxthread.c └── x │ ├── icon.inc │ ├── xclipboard.c │ ├── xcursor.c │ ├── xdisplay.c │ ├── xdnd.c │ ├── xevents.c │ ├── xfullscreen.c │ ├── xglx_config.c │ ├── xicon.h │ ├── xkeyboard.c │ ├── xmousenu.c │ ├── xrandr.c │ ├── xsystem.c │ ├── xtouch.c │ └── xwindow.c ├── tests ├── CMakeLists.txt ├── grab_bitmap_suites.sh ├── manual_bmpsuite1.ini ├── manual_bmpsuite2.ini ├── manual_bmpsuite3.ini ├── manual_bmpsuite4.ini ├── test_backbuffer.ini ├── test_bitmaps.ini ├── test_bitmaps2.ini ├── test_blend.ini ├── test_blend_target.ini ├── test_ciede2000.ini ├── test_compressed.ini ├── test_convert.ini ├── test_driver.c ├── test_driver.txt ├── test_fonts.ini ├── test_image.ini ├── test_list.c ├── test_locking.ini ├── test_locking2.ini ├── test_prim.ini └── test_prim2.ini └── tools ├── macosx └── fixbundle.c ├── win ├── wfixicon.c └── wfixicon.txt └── x11 ├── xf2pcx.c ├── xfixicon.sh ├── xkeymap.c └── xkeymap.txt /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = lf 5 | insert_final_newline = true 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | indent_style = space 9 | indent_size = 3 10 | 11 | [CMakeLists.txt] 12 | indent_size = 4 13 | 14 | [*.cmake] 15 | indent_size = 4 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # ignore the build/ directory 3 | build/ 4 | build_android_arm/ 5 | build_android_arm64-v8a/ 6 | build_android_armeabi-v7a/ 7 | build_android_mips64/ 8 | build_android_mips/ 9 | build_android_x86/ 10 | build_android_x86_64/ 11 | 12 | # build dependencies optionally go in deps/, ignore them 13 | deps/ 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | README.txt -------------------------------------------------------------------------------- /README_packaging.txt: -------------------------------------------------------------------------------- 1 | Note to packagers (e.g. for Linux distributions) 2 | ------------------------------------------------ 3 | 4 | Allegro 5.x is *not* source compatible with Allegro 4.2.x or 4.4.x. 5 | When packaging Allegro 5, please make it possible for users to install 6 | Allegro 4.x and 5.x simultaneously. For example, if you already have 7 | an 'allegro' package, then you might name the new package 'allegro5'. 8 | 9 | -------------------------------------------------------------------------------- /README_raspberrypi.txt: -------------------------------------------------------------------------------- 1 | Building 2 | -------- 3 | 4 | mkdir build 5 | cd build 6 | cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-raspberrypi.cmake 7 | make 8 | 9 | Virtual machine 10 | --------------- 11 | 12 | Building with a cross compiler is not yet documented. Building directly 13 | on a Raspberry Pi or in a Raspberry Pi VM is very similar to building on 14 | "regular" Linux. apt-get install the -dev packages you need, run cmake and 15 | make sure everything you need is found. 16 | 17 | For example, you can use an image from: 18 | 19 | http://www.raspberrypi.org/downloads 20 | 21 | and a kernel: 22 | 23 | http://xecdesign.com/downloads/linux-qemu/kernel-qemu 24 | 25 | With a qemu command line like: 26 | 27 | qemu-system-arm -kernel kernel-qemu -cpu arm1176 -m 256 -M versatilepb \ 28 | -no-reboot -serial stdio -append "root=/dev/sda2 panic=1" \ 29 | -hda 2012-12-16-wheezy-raspbian.img \ 30 | -redir tcp:2222::22 -net nic -net user 31 | 32 | You can ssh into the VM with: 33 | 34 | ssh -p 2222 pi@127.0.0.1 35 | 36 | Within the guest you can access the host at 10.0.2.2. 37 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Report a security issue 4 | 5 | The Allegro project team welcomes security reports and is committed to 6 | providing prompt attention to security issues. Security issues should be 7 | reported privately by using the Security tab on Github: 8 | . 9 | 10 | ## Version support 11 | 12 | | Version | Supported | 13 | | ------- | ------------------ | 14 | | >= 5.2.x| Yes | 15 | | < 5.2 | No | 16 | 17 | ## Security advisories 18 | 19 | Remediation of security vulnerabilities is prioritized by the project team 20 | based on the overall impact. The project team is committed to transparency in 21 | the disclosure process. The Allegro team announces security issues Allegro 22 | Release notes, as well as the Allegro website on a best-effort basis. 23 | -------------------------------------------------------------------------------- /addons/acodec/allegro5/internal/aintern_acodec_cfg.h.cmake: -------------------------------------------------------------------------------- 1 | #cmakedefine ALLEGRO_CFG_ACODEC_FLAC 2 | #cmakedefine ALLEGRO_CFG_ACODEC_DUMB 3 | #cmakedefine ALLEGRO_CFG_ACODEC_OPENMPT 4 | #cmakedefine ALLEGRO_CFG_ACODEC_VORBIS 5 | #cmakedefine ALLEGRO_CFG_ACODEC_TREMOR 6 | #cmakedefine ALLEGRO_CFG_ACODEC_OPUS 7 | #cmakedefine ALLEGRO_CFG_ACODEC_MP3 8 | 9 | 10 | /* Define if the library should be loaded dynamically. */ 11 | #cmakedefine ALLEGRO_CFG_ACODEC_FLAC_DLL "@ALLEGRO_CFG_ACODEC_FLAC_DLL@" 12 | #cmakedefine ALLEGRO_CFG_ACODEC_DUMB_DLL "@ALLEGRO_CFG_ACODEC_DUMB_DLL@" 13 | #cmakedefine ALLEGRO_CFG_ACODEC_VORBISFILE_DLL "@ALLEGRO_CFG_ACODEC_VORBISFILE_DLL@" 14 | #cmakedefine ALLEGRO_CFG_ACODEC_OPUSFILE_DLL "@ALLEGRO_CFG_ACODEC_OPUSFILE_DLL@" 15 | -------------------------------------------------------------------------------- /addons/acodec/helper.h: -------------------------------------------------------------------------------- 1 | #ifndef __al_included_acodec_helper_h 2 | #define __al_included_acodec_helper_h 3 | 4 | void _al_acodec_start_feed_thread(ALLEGRO_AUDIO_STREAM *stream); 5 | void _al_acodec_stop_feed_thread(ALLEGRO_AUDIO_STREAM *stream); 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /addons/audio/allegro5/internal/aintern_audio_cfg.h.cmake: -------------------------------------------------------------------------------- 1 | #cmakedefine ALLEGRO_CFG_KCM_ALSA 2 | #cmakedefine ALLEGRO_CFG_KCM_OPENAL 3 | #cmakedefine ALLEGRO_CFG_KCM_OPENSL 4 | #cmakedefine ALLEGRO_CFG_KCM_DSOUND 5 | #cmakedefine ALLEGRO_CFG_KCM_OSS 6 | #cmakedefine ALLEGRO_CFG_KCM_PULSEAUDIO 7 | #cmakedefine ALLEGRO_CFG_KCM_AQUEUE 8 | -------------------------------------------------------------------------------- /addons/color/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(COLOR_SOURCES color.c) 2 | 3 | set(COLOR_INCLUDE_FILES 4 | allegro5/allegro_color.h 5 | ) 6 | 7 | set_our_header_properties(${COLOR_INCLUDE_FILES}) 8 | 9 | add_our_addon_library(allegro_color 10 | AllegroColor-${ALLEGRO_SOVERSION} 11 | "${COLOR_SOURCES};${COLOR_INCLUDE_FILES}" 12 | "-DALLEGRO_COLOR_SRC" 13 | "${ALLEGRO_LINK_WITH}" 14 | ) 15 | 16 | install_our_headers(${COLOR_INCLUDE_FILES}) 17 | 18 | add_addon(color) 19 | 20 | #-----------------------------------------------------------------------------# 21 | # vi: set ts=8 sts=4 sw=4 et: 22 | -------------------------------------------------------------------------------- /addons/font/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(FONT_SOURCES font.c fontbmp.c stdfont.c text.c bmfont.c xml.c) 2 | 3 | set(FONT_INCLUDE_FILES allegro5/allegro_font.h) 4 | 5 | set_our_header_properties(${FONT_INCLUDE_FILES}) 6 | 7 | add_our_addon_library(allegro_font 8 | AllegroFont-${ALLEGRO_SOVERSION} 9 | "${FONT_SOURCES};${FONT_INCLUDE_FILES}" 10 | "-DALLEGRO_FONT_SRC" 11 | "${ALLEGRO_LINK_WITH}" 12 | ) 13 | 14 | install_our_headers(${FONT_INCLUDE_FILES}) 15 | 16 | add_addon(font) 17 | 18 | #-----------------------------------------------------------------------------# 19 | # vim: set ts=8 sts=4 sw=4 et: 20 | -------------------------------------------------------------------------------- /addons/font/font.h: -------------------------------------------------------------------------------- 1 | #ifndef __al_included_allegro5_font_h 2 | #define __al_included_allegro5_font_h 3 | 4 | #include "allegro5/internal/aintern_font.h" 5 | 6 | extern ALLEGRO_FONT_VTABLE _al_font_vtable_color; 7 | 8 | typedef struct ALLEGRO_FONT_COLOR_DATA 9 | { 10 | int begin, end; /* first char and one-past-the-end char */ 11 | ALLEGRO_BITMAP *glyphs; /* our glyphs */ 12 | ALLEGRO_BITMAP **bitmaps; /* sub bitmaps pointing to our glyphs */ 13 | struct ALLEGRO_FONT_COLOR_DATA *next; /* linked list structure */ 14 | } ALLEGRO_FONT_COLOR_DATA; 15 | 16 | ALLEGRO_FONT *_al_load_bitmap_font(const char *filename, 17 | int size, int flags); 18 | ALLEGRO_FONT *_al_load_bmfont_xml(const char *filename, 19 | int size, int flags); 20 | 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /addons/font/xml.h: -------------------------------------------------------------------------------- 1 | typedef enum { 2 | Outside, 3 | ElementName, 4 | AttributeName, 5 | AttributeStart, 6 | AttributeValue 7 | } XmlState; 8 | 9 | void _al_xml_parse(ALLEGRO_FILE *f, 10 | int (*callback)(XmlState state, char const *value, void *u), 11 | void *u); 12 | -------------------------------------------------------------------------------- /addons/image/allegro5/internal/aintern_image_cfg.h.cmake: -------------------------------------------------------------------------------- 1 | #cmakedefine ALLEGRO_CFG_WANT_NATIVE_IMAGE_LOADER 2 | 3 | /* which libraries are present and needed? */ 4 | #cmakedefine ALLEGRO_CFG_IIO_HAVE_FREEIMAGE 5 | #cmakedefine ALLEGRO_CFG_IIO_HAVE_GDIPLUS 6 | #cmakedefine ALLEGRO_CFG_IIO_HAVE_GDIPLUS_LOWERCASE_H 7 | #cmakedefine ALLEGRO_CFG_IIO_HAVE_ANDROID 8 | #cmakedefine ALLEGRO_CFG_IIO_HAVE_PNG 9 | #cmakedefine ALLEGRO_CFG_IIO_HAVE_JPG 10 | #cmakedefine ALLEGRO_CFG_IIO_HAVE_WEBP 11 | 12 | /* which formats are supported and wanted? */ 13 | #cmakedefine ALLEGRO_CFG_IIO_SUPPORT_PNG 14 | #cmakedefine ALLEGRO_CFG_IIO_SUPPORT_JPG 15 | #cmakedefine ALLEGRO_CFG_IIO_SUPPORT_WEBP 16 | -------------------------------------------------------------------------------- /addons/image/android.c: -------------------------------------------------------------------------------- 1 | #define ALLEGRO_INTERNAL_UNSTABLE 2 | #include "allegro5/allegro.h" 3 | #include "allegro5/allegro_image.h" 4 | #include "allegro5/internal/aintern_android.h" 5 | #include "allegro5/internal/aintern_image.h" 6 | 7 | ALLEGRO_BITMAP *_al_load_android_bitmap_f(ALLEGRO_FILE *fp, int flags) 8 | { 9 | return _al_android_load_image_f(fp, flags); 10 | } 11 | 12 | ALLEGRO_BITMAP *_al_load_android_bitmap(const char *filename, int flags) 13 | { 14 | return _al_android_load_image(filename, flags); 15 | } 16 | 17 | -------------------------------------------------------------------------------- /addons/image/identify.c: -------------------------------------------------------------------------------- 1 | #include "allegro5/allegro.h" 2 | #include "allegro5/allegro_image.h" 3 | #include "allegro5/internal/aintern_image.h" 4 | 5 | bool _al_identify_png(ALLEGRO_FILE *f) 6 | { 7 | uint8_t x[8]; 8 | al_fread(f, x, 8); 9 | if (memcmp(x, "\x89PNG\r\n\x1a\n", 8) != 0) 10 | return false; 11 | return true; 12 | } 13 | 14 | bool _al_identify_jpg(ALLEGRO_FILE *f) 15 | { 16 | uint8_t x[4]; 17 | uint16_t y; 18 | y = al_fread16be(f); 19 | if (y != 0xffd8) 20 | return false; 21 | al_fseek(f, 6 - 2, ALLEGRO_SEEK_CUR); 22 | al_fread(f, x, 4); 23 | if (memcmp(x, "JFIF", 4) != 0) 24 | return false; 25 | return true; 26 | } 27 | 28 | bool _al_identify_webp(ALLEGRO_FILE *f) 29 | { 30 | uint8_t x[4]; 31 | al_fread(f, x, 4); 32 | if (memcmp(x, "RIFF", 4) != 0) 33 | return false; 34 | al_fseek(f, 4, ALLEGRO_SEEK_CUR); 35 | al_fread(f, x, 4); 36 | if (memcmp(x, "WEBP", 4) != 0) 37 | return false; 38 | return true; 39 | } 40 | -------------------------------------------------------------------------------- /addons/image/iio.h: -------------------------------------------------------------------------------- 1 | #ifndef __al_included_allegro5_iio_h 2 | #define __al_included_allegro5_iio_h 3 | 4 | 5 | 6 | #include "allegro5/internal/aintern_image_cfg.h" 7 | 8 | 9 | 10 | typedef struct PalEntry { 11 | int r, g, b, a; 12 | } PalEntry; 13 | 14 | 15 | #endif 16 | 17 | -------------------------------------------------------------------------------- /addons/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if(ALLEGRO_MACOSX) 2 | set(MAIN_SOURCES osx_main.m) 3 | set(SUPPORT_ALLEGRO_MAIN 1) 4 | endif(ALLEGRO_MACOSX) 5 | 6 | if(NOT SUPPORT_ALLEGRO_MAIN) 7 | set(MAIN_SOURCES generic_main.c) 8 | set(SUPPORT_ALLEGRO_MAIN 1) 9 | endif(NOT SUPPORT_ALLEGRO_MAIN) 10 | 11 | add_our_addon_library(allegro_main 12 | AllegroMain-${ALLEGRO_SOVERSION} 13 | "${MAIN_SOURCES}" 14 | "-DALLEGRO_SRC" 15 | "${ALLEGRO_LINK_WITH}" 16 | ) 17 | 18 | add_addon(main) 19 | 20 | # vim: set sts=4 sw=4 et: 21 | -------------------------------------------------------------------------------- /addons/main/generic_main.c: -------------------------------------------------------------------------------- 1 | /* Empty file */ 2 | 3 | /* 4 | * MSVC will not generate an empty .lib file 5 | */ 6 | #ifdef _MSC_VER 7 | #include 8 | __declspec(dllexport) void _al_make_a_lib() 9 | { 10 | exit(1); 11 | } 12 | #endif 13 | -------------------------------------------------------------------------------- /addons/memfile/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | set(MEMFILE_SOURCES memfile.c) 3 | 4 | set(MEMFILE_INCLUDE_FILES allegro5/allegro_memfile.h) 5 | 6 | set_our_header_properties(${MEMFILE_INCLUDE_FILES}) 7 | 8 | add_our_addon_library(allegro_memfile 9 | AllegroMemfile-${ALLEGRO_SOVERSION} 10 | "${MEMFILE_SOURCES};${MEMFILE_INCLUDE_FILES}" 11 | "-DALLEGRO_MEMFILE_SRC" 12 | "${ALLEGRO_LINK_WITH}" 13 | ) 14 | 15 | install_our_headers(${MEMFILE_INCLUDE_FILES}) 16 | 17 | add_addon(memfile) 18 | 19 | #-----------------------------------------------------------------------------# 20 | # vi: set ts=8 sts=4 sw=4 et: 21 | -------------------------------------------------------------------------------- /addons/native_dialog/allegro5/internal/aintern_native_dialog_cfg.h.cmake: -------------------------------------------------------------------------------- 1 | #cmakedefine ALLEGRO_CFG_NATIVE_DIALOG_GTK 2 | #cmakedefine ALLEGRO_CFG_NATIVE_DIALOG_OSX 3 | #cmakedefine ALLEGRO_CFG_NATIVE_DIALOG_WINDOWS 4 | #cmakedefine ALLEGRO_CFG_NATIVE_DIALOG_ANDROID 5 | -------------------------------------------------------------------------------- /addons/native_dialog/gtk_xgtk.h: -------------------------------------------------------------------------------- 1 | #ifndef __al_included_allegro5_native_dialog_gtk_xgtk_h 2 | #define __al_included_allegro5_native_dialog_gtk_xgtk_h 3 | 4 | #include 5 | 6 | struct ALLEGRO_DISPLAY_XGLX_GTK { 7 | GtkWidget *gtkwindow; 8 | GtkWidget *gtksocket; 9 | }; 10 | 11 | bool _al_gtk_set_display_overridable_interface(bool on); 12 | GtkWidget *_al_gtk_get_window(ALLEGRO_DISPLAY *display); 13 | 14 | #endif 15 | 16 | /* vim: set sts=3 sw=3 et: */ 17 | -------------------------------------------------------------------------------- /addons/physfs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories(SYSTEM ${PHYSFS_INCLUDE_DIR}) 2 | 3 | set(PHYSFS_SOURCES a5_physfs.c a5_physfs_dir.c) 4 | 5 | set(PHYSFS_INCLUDE_FILES allegro5/allegro_physfs.h) 6 | 7 | # This allows the monolith build to find the files. 8 | set(PHYSFS_INCLUDE_DIRECTORIES ${PHYSFS_INCLUDE_DIR}) 9 | 10 | set_our_header_properties(${PHYSFS_INCLUDE_FILES}) 11 | 12 | add_our_addon_library(allegro_physfs 13 | AllegroPhysfs-${ALLEGRO_SOVERSION} 14 | "${PHYSFS_SOURCES};${PHYSFS_INCLUDE_FILES}" 15 | "-DALLEGRO_PHYSFS_SRC" 16 | "${ALLEGRO_LINK_WITH};${PHYSFS_LIBRARIES}" 17 | ) 18 | 19 | install_our_headers(${PHYSFS_INCLUDE_FILES}) 20 | 21 | add_addon(physfs) 22 | 23 | #-----------------------------------------------------------------------------# 24 | # vi: set ts=8 sts=4 sw=4 et: 25 | -------------------------------------------------------------------------------- /addons/physfs/allegro_physfs_intern.h: -------------------------------------------------------------------------------- 1 | #ifndef __al_included_allegro5_allegro_physfs_intern_h 2 | #define __al_included_allegro5_allegro_physfs_intern_h 3 | 4 | void _al_set_physfs_fs_interface(void); 5 | const ALLEGRO_FILE_INTERFACE *_al_get_phys_vtable(void); 6 | ALLEGRO_USTR *_al_physfs_process_path(const char *path); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /addons/primitives/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(PRIMITIVES_SOURCES 2 | high_primitives.c 3 | line_soft.c 4 | point_soft.c 5 | polygon.c 6 | polyline.c 7 | prim_directx.cpp 8 | prim_opengl.c 9 | prim_soft.c 10 | prim_util.c 11 | primitives.c 12 | triangulator.c 13 | ) 14 | 15 | if(WIN32) 16 | # Add this file conditionally. 17 | # The Debian folks want to remove it because it contains precompiled code. 18 | list(APPEND PRIMITIVES_SOURCES directx_shaders.cpp) 19 | endif(WIN32) 20 | 21 | set(PRIMITIVES_INCLUDE_FILES allegro5/allegro_primitives.h) 22 | 23 | set_our_header_properties(${PRIMITIVES_INCLUDE_FILES}) 24 | 25 | add_our_addon_library(allegro_primitives 26 | AllegroPrimitives-${ALLEGRO_SOVERSION} 27 | "${PRIMITIVES_SOURCES};${PRIMITIVES_INCLUDE_FILES}" 28 | "-DALLEGRO_PRIMITIVES_SRC" 29 | "${ALLEGRO_LINK_WITH}" 30 | ) 31 | 32 | install_our_headers(${PRIMITIVES_INCLUDE_FILES}) 33 | 34 | add_addon(primitives) 35 | 36 | #-----------------------------------------------------------------------------# 37 | # vi: set ts=8 sts=4 sw=4 et: 38 | -------------------------------------------------------------------------------- /addons/primitives/allegro5/internal/aintern_prim_soft.h: -------------------------------------------------------------------------------- 1 | #ifndef __al_included_allegro5_aintern_prim_soft_h 2 | #define __al_included_allegro5_aintern_prim_soft_h 3 | 4 | struct ALLEGRO_BITMAP; 5 | struct ALLEGRO_VERTEX; 6 | enum ALLEGRO_BITMAP_WRAP; 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | int _al_fix_texcoord(float var, int max_var, ALLEGRO_BITMAP_WRAP wrap); 13 | int _al_draw_prim_soft(ALLEGRO_BITMAP* texture, const void* vtxs, const ALLEGRO_VERTEX_DECL* decl, int start, int end, int type); 14 | int _al_draw_prim_indexed_soft(ALLEGRO_BITMAP* texture, const void* vtxs, const ALLEGRO_VERTEX_DECL* decl, const int* indices, int num_vtx, int type); 15 | 16 | void _al_line_2d(ALLEGRO_BITMAP* texture, ALLEGRO_VERTEX* v1, ALLEGRO_VERTEX* v2); 17 | void _al_point_2d(ALLEGRO_BITMAP* texture, ALLEGRO_VERTEX* v); 18 | 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /addons/ttf/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories(../font) 2 | include_directories(SYSTEM ${FREETYPE_INCLUDE_DIRS}) 3 | 4 | set(TTF_SOURCES ttf.c) 5 | 6 | set(TTF_INCLUDE_FILES allegro5/allegro_ttf.h) 7 | 8 | set_our_header_properties(${TTF_INCLUDE_FILES}) 9 | 10 | configure_file( 11 | allegro5/internal/aintern_ttf_cfg.h.cmake 12 | ${PROJECT_BINARY_DIR}/include/allegro5/internal/aintern_ttf_cfg.h 13 | ) 14 | 15 | add_our_addon_library(allegro_ttf 16 | AllegroTTF-${ALLEGRO_SOVERSION} 17 | "${TTF_SOURCES};${TTF_INCLUDE_FILES}" 18 | "-DALLEGRO_TTF_SRC" 19 | "${FONT_LINK_WITH};${TTF_LIBRARIES}" 20 | ) 21 | 22 | install_our_headers(${TTF_INCLUDE_FILES}) 23 | 24 | add_addon(ttf) 25 | 26 | #-----------------------------------------------------------------------------# 27 | # vi: set ts=8 sts=4 sw=4 et: 28 | -------------------------------------------------------------------------------- /addons/ttf/allegro5/internal/aintern_ttf_cfg.h.cmake: -------------------------------------------------------------------------------- 1 | #cmakedefine ALLEGRO_CFG_TTF_FREETYPE 2 | -------------------------------------------------------------------------------- /addons/video/allegro5/internal/aintern_video_cfg.h.cmake: -------------------------------------------------------------------------------- 1 | #cmakedefine ALLEGRO_CFG_VIDEO_HAVE_OGV 2 | -------------------------------------------------------------------------------- /android/gradle_project/allegro/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 33 5 | defaultConfig { 6 | minSdkVersion 15 7 | targetSdkVersion 33 8 | versionCode 1 9 | versionName "1.0" 10 | } 11 | buildTypes { 12 | release { 13 | minifyEnabled false 14 | } 15 | } 16 | namespace("org.liballeg") 17 | } 18 | 19 | -------------------------------------------------------------------------------- /android/gradle_project/allegro/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /android/gradle_project/allegro/src/main/java/org/liballeg/android/Path.java: -------------------------------------------------------------------------------- 1 | package org.liballeg.android; 2 | 3 | import android.text.TextUtils; 4 | import java.util.ArrayList; 5 | 6 | final class Path 7 | { 8 | // AssetManager does not interpret the path(!) so we do it here. 9 | static String simplifyPath(final String path) 10 | { 11 | final String[] pieces = path.split("/"); 12 | ArrayList keep = new ArrayList(); 13 | for (String piece : pieces) { 14 | if (piece.equals("")) 15 | continue; 16 | if (piece.equals(".")) 17 | continue; 18 | if (piece.equals("..")) { 19 | if (keep.size() > 0) 20 | keep.remove(keep.size() - 1); 21 | continue; 22 | } 23 | keep.add(piece); 24 | } 25 | return TextUtils.join("/", keep); 26 | } 27 | } 28 | 29 | /* vim: set sts=3 sw=3 et: */ 30 | -------------------------------------------------------------------------------- /android/gradle_project/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 33 5 | defaultConfig { 6 | applicationId "org.liballeg.${APP_ID}" 7 | minSdkVersion 15 8 | targetSdkVersion 33 9 | versionCode 1 10 | versionName "1.0" 11 | } 12 | buildTypes { 13 | release { 14 | minifyEnabled false 15 | } 16 | } 17 | namespace("org.liballeg.app") 18 | } 19 | 20 | dependencies { 21 | implementation fileTree(dir: 'libs', include: ['*.jar']) 22 | implementation "org.liballeg.android:allegro:1.0@aar" 23 | } 24 | 25 | -------------------------------------------------------------------------------- /android/gradle_project/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /android/gradle_project/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | dependencies { 7 | classpath "com.android.tools.build:gradle:8.8.0" 8 | } 9 | } 10 | 11 | allprojects { 12 | repositories { 13 | google() 14 | jcenter() 15 | flatDir { dirs 'libs' } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /android/gradle_project/gradle.properties: -------------------------------------------------------------------------------- 1 | #org.gradle.java.home=${JAVA_HOME} 2 | -------------------------------------------------------------------------------- /android/gradle_project/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/android/gradle_project/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /android/gradle_project/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /android/gradle_project/local.properties: -------------------------------------------------------------------------------- 1 | sdk.dir=${ANDROID_HOME} 2 | -------------------------------------------------------------------------------- /android/gradle_project/settings.gradle: -------------------------------------------------------------------------------- 1 | include ":${GRADLE_PROJECT}" 2 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | version: "{branch}-ci-{build}" 2 | clone_depth: 5 3 | 4 | install: 5 | - mkdir deps 6 | - mkdir deps\include 7 | - mkdir deps\lib 8 | - nuget install AllegroDeps -Version 1.5.0 -OutputDirectory deps -ExcludeVersion 9 | - ps: move deps\AllegroDeps\build\native\include\* deps\include -force 10 | - ps: move deps\AllegroDeps\build\native\v140\win32\deps\lib\* deps\lib -force 11 | 12 | build_script: 13 | - mkdir build 14 | - cd build 15 | - cmake .. -G "Visual Studio 14 2015" -DWANT_ACODEC_DYNAMIC_LOAD=off -DFLAC_STATIC=on 16 | - cmake --build . --config RelWithDebInfo 17 | -------------------------------------------------------------------------------- /cmake/AllegroConfig.cmake.in: -------------------------------------------------------------------------------- 1 | # 2 | # Allegro Package Config 3 | # 4 | @PACKAGE_INIT@ 5 | 6 | set(ALLEGRO_PKG_BUGREPORT "@PROJECT_HOMEPAGE_URL@/issues") 7 | 8 | # Allegro Targets 9 | set(ALLEGRO_PKG_TARGETS "@ALLEGRO_TARGETS@") 10 | 11 | # Allegro Package Version 12 | set(ALLEGRO_PKG_VERSION_MAJOR @PROJECT_VERSION_MAJOR@) 13 | set(ALLEGRO_PKG_VERSION_MINOR @PROJECT_VERSION_MINOR@) 14 | set(ALLEGRO_PKG_VERSION_PATCH @PROJECT_VERSION_PATCH@) 15 | set(ALLEGRO_PKG_VERSION @PROJECT_VERSION@) 16 | 17 | # Architecture, compiler and other low level flags 18 | set(ALLEGRO_PKG_LIBRARY_ARCHITECTURE "@CMAKE_LIBRARY_ARCHITECTURE@") 19 | set(ALLEGRO_PKG_COMPILER "@CMAKE_C_COMPILER_ID@") 20 | set(ALLEGRO_PKG_COMPILER_VERSION "@CMAKE_C_COMPILER_VERSION@") 21 | set(ALLEGRO_PKG_HOST_SYSTEM "@CMAKE_HOST_SYSTEM@") 22 | 23 | # Targets 24 | include("${CMAKE_CURRENT_LIST_DIR}/@PKG_TARGETS_NAME@.cmake") 25 | -------------------------------------------------------------------------------- /cmake/AllegroFindFFMPEG.cmake: -------------------------------------------------------------------------------- 1 | # - Find FFMPEG 2 | # 3 | # FFMPEG_FOUND - true if FFMPEG is found 4 | # FFMPEG_CFLAGS - required compiler flags 5 | # FFMPEG_LDFLAGS - required linker flags 6 | 7 | # -lavcodec -lavformat -lswscale 8 | 9 | if(ALLEGRO_UNIX) 10 | pkg_check_modules(FFMPEG libavcodec libavformat libswscale libavutil) 11 | endif() 12 | 13 | # TODO: Windos and OSX 14 | -------------------------------------------------------------------------------- /cmake/FindDUMB.cmake: -------------------------------------------------------------------------------- 1 | # - Find DUMB 2 | # Find the native DUMB includes and libraries 3 | # 4 | # DUMB_INCLUDE_DIR - where to find DUMB headers. 5 | # DUMB_LIBRARIES - List of libraries when using libDUMB. 6 | # DUMB_FOUND - True if libDUMB found. 7 | 8 | if(DUMB_INCLUDE_DIR) 9 | # Already in cache, be silent 10 | set(DUMB_FIND_QUIETLY TRUE) 11 | endif(DUMB_INCLUDE_DIR) 12 | 13 | find_path(DUMB_INCLUDE_DIR dumb.h) 14 | 15 | find_library(DUMB_LIBRARY NAMES dumb libdumb dumb_static libdumb_static) 16 | 17 | # Handle the QUIETLY and REQUIRED arguments and set DUMB_FOUND to TRUE if 18 | # all listed variables are TRUE. 19 | include(FindPackageHandleStandardArgs) 20 | set(FPHSA_NAME_MISMATCHED TRUE) 21 | find_package_handle_standard_args(DUMB DEFAULT_MSG 22 | DUMB_INCLUDE_DIR DUMB_LIBRARY) 23 | 24 | if(DUMB_FOUND) 25 | set(DUMB_LIBRARIES ${DUMB_LIBRARY}) 26 | if(NOT MSVC) 27 | set(DUMB_LIBRARIES ${DUMB_LIBRARIES};m) 28 | endif() 29 | else(DUMB_FOUND) 30 | set(DUMB_LIBRARIES) 31 | endif(DUMB_FOUND) 32 | 33 | mark_as_advanced(DUMB_INCLUDE_DIR DUMB_LIBRARY) 34 | -------------------------------------------------------------------------------- /cmake/FindDXGuid.cmake: -------------------------------------------------------------------------------- 1 | # - Find dxguid 2 | # Find the dxguid libraries 3 | # 4 | # DXGUID_LIBRARIES - List of libraries 5 | # DXGUID_FOUND - True if dxguid found. 6 | 7 | find_library(DXGUID_LIBRARY 8 | NAMES dxguid 9 | HINTS "$ENV{DXSDK_DIR}/Lib/$ENV{PROCESSOR_ARCHITECTURE}" 10 | ) 11 | 12 | # Handle the QUIETLY and REQUIRED arguments and set DXGUID_FOUND to TRUE if 13 | # all listed variables are TRUE. 14 | include(FindPackageHandleStandardArgs) 15 | set(FPHSA_NAME_MISMATCHED TRUE) 16 | find_package_handle_standard_args(DXGUID DEFAULT_MSG 17 | DXGUID_LIBRARY) 18 | 19 | if(DXGUID_FOUND) 20 | set(DXGUID_LIBRARIES ${DXGUID_LIBRARY}) 21 | else(DXGUID_FOUND) 22 | set(DXGUID_LIBRARIES) 23 | endif(DXGUID_FOUND) 24 | 25 | mark_as_advanced(DXGUID_INCLUDE_DIR DXGUID_LIBRARY) 26 | -------------------------------------------------------------------------------- /cmake/FindENet.cmake: -------------------------------------------------------------------------------- 1 | # - Find ENet 2 | # Find the native ENet includes and libraries 3 | # 4 | # ENET_INCLUDE_DIR - where to find ENet headers. 5 | # ENET_LIBRARIES - List of libraries when using libenet. 6 | # ENET_FOUND - True if libenet found. 7 | 8 | if(ENET_INCLUDE_DIR) 9 | # Already in cache, be silent 10 | set(ENET_FIND_QUIETLY TRUE) 11 | endif(ENET_INCLUDE_DIR) 12 | 13 | find_path(ENET_INCLUDE_DIR enet/enet.h) 14 | 15 | find_library(ENET_LIBRARY NAMES enet enet_static libenet libenet_static) 16 | 17 | # Handle the QUIETLY and REQUIRED arguments and set ENET_FOUND to TRUE if 18 | # all listed variables are TRUE. 19 | include(FindPackageHandleStandardArgs) 20 | set(FPHSA_NAME_MISMATCHED TRUE) 21 | find_package_handle_standard_args(ENET DEFAULT_MSG 22 | ENET_INCLUDE_DIR ENET_LIBRARY) 23 | 24 | if(ENET_FOUND) 25 | set(ENET_LIBRARIES ${ENET_LIBRARY}) 26 | else(ENET_FOUND) 27 | set(ENET_LIBRARIES) 28 | endif(ENET_FOUND) 29 | 30 | mark_as_advanced(ENET_INCLUDE_DIR ENET_LIBRARY) 31 | -------------------------------------------------------------------------------- /cmake/FindMiniMP3.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find MiniMP3 (https://github.com/lieff/minimp3) 2 | # Once done, this will define 3 | # 4 | # MINIMP3_FOUND - system has MiniMP3 5 | # MINIMP3_INCLUDE_DIRS - the MiniMP3 include directories 6 | 7 | # Look for the header file. 8 | find_path(MINIMP3_INCLUDE_DIRS 9 | NAMES minimp3.h minimp3_ex.h 10 | ) 11 | mark_as_advanced(MINIMP3_INCLUDE_DIRS) 12 | 13 | include(FindPackageHandleStandardArgs) 14 | set(FPHSA_NAME_MISMATCHED TRUE) 15 | find_package_handle_standard_args(MiniMP3 REQUIRED_VARS MINIMP3_INCLUDE_DIRS 16 | FOUND_VAR MINIMP3_FOUND) 17 | -------------------------------------------------------------------------------- /cmake/FindOgg.cmake: -------------------------------------------------------------------------------- 1 | # - Find ogg 2 | # Find the native ogg includes and libraries 3 | # 4 | # OGG_INCLUDE_DIR - where to find ogg.h, etc. 5 | # OGG_LIBRARIES - List of libraries when using ogg. 6 | # OGG_FOUND - True if ogg found. 7 | 8 | if(OGG_INCLUDE_DIR) 9 | # Already in cache, be silent 10 | set(OGG_FIND_QUIETLY TRUE) 11 | endif(OGG_INCLUDE_DIR) 12 | find_path(OGG_INCLUDE_DIR ogg/ogg.h) 13 | # MSVC built ogg may be named ogg_static. 14 | # The provided project files name the library with the lib prefix. 15 | find_library(OGG_LIBRARY NAMES ogg ogg_static libogg libogg_static) 16 | # Handle the QUIETLY and REQUIRED arguments and set OGG_FOUND 17 | # to TRUE if all listed variables are TRUE. 18 | include(FindPackageHandleStandardArgs) 19 | set(FPHSA_NAME_MISMATCHED TRUE) 20 | find_package_handle_standard_args(OGG DEFAULT_MSG OGG_INCLUDE_DIR OGG_LIBRARY) 21 | 22 | set(OGG_LIBRARIES ${OGG_LIBRARY}) 23 | 24 | mark_as_advanced(OGG_INCLUDE_DIR) 25 | mark_as_advanced(OGG_LIBRARY) 26 | -------------------------------------------------------------------------------- /cmake/FindOpenGLES1.cmake: -------------------------------------------------------------------------------- 1 | # - Find OpenGLES 2 | # Find the native OpenGLES includes and libraries 3 | # 4 | # OPENGLES1_INCLUDE_DIR - where to find GLES/gl.h, etc. 5 | # OPENGLES1_LIBRARIES - List of libraries when using OpenGLES. 6 | # OPENGLES1_FOUND - True if OpenGLES found. 7 | 8 | if(OPENGLES1_INCLUDE_DIR) 9 | # Already in cache, be silent 10 | set(OPENGLES1_FIND_QUIETLY TRUE) 11 | endif(OPENGLES1_INCLUDE_DIR) 12 | 13 | find_path(OPENGLES1_INCLUDE_DIR GLES/gl.h) 14 | 15 | find_library(OPENGLES1_gl_LIBRARY NAMES GLESv1_CM) 16 | 17 | # Handle the QUIETLY and REQUIRED arguments and set OPENGLES1_FOUND 18 | # to TRUE if all listed variables are TRUE. 19 | include(FindPackageHandleStandardArgs) 20 | set(FPHSA_NAME_MISMATCHED TRUE) 21 | find_package_handle_standard_args(OPENGLES1 DEFAULT_MSG 22 | OPENGLES1_INCLUDE_DIR OPENGLES1_gl_LIBRARY) 23 | 24 | set(OPENGLES1_LIBRARIES ${OPENGLES1_gl_LIBRARY}) 25 | 26 | mark_as_advanced(OPENGLES1_INCLUDE_DIR) 27 | mark_as_advanced(OPENGLES1_gl_LIBRARY) 28 | -------------------------------------------------------------------------------- /cmake/FindOpenMPT.cmake: -------------------------------------------------------------------------------- 1 | # - Find OPENMPT 2 | # Find the native OpenMPT includes and libraries 3 | # 4 | # OPENMPT_INCLUDE_DIR - where to find OpenMPT headers. 5 | # OPENMPT_LIBRARIES - List of libraries when using OpenMPT. 6 | # OPENMPT_FOUND - True if OpenMPT found. 7 | 8 | if(OPENMPT_INCLUDE_DIR) 9 | # Already in cache, be silent 10 | set(OPENMPT_FIND_QUIETLY TRUE) 11 | endif(OPENMPT_INCLUDE_DIR) 12 | 13 | find_path(OPENMPT_INCLUDE_DIR libopenmpt/libopenmpt.h) 14 | 15 | find_library(OPENMPT_LIBRARY NAMES openmpt) 16 | 17 | # Handle the QUIETLY and REQUIRED arguments and set OPENMPT_FOUND to TRUE if 18 | # all listed variables are TRUE. 19 | include(FindPackageHandleStandardArgs) 20 | set(FPHSA_NAME_MISMATCHED TRUE) 21 | find_package_handle_standard_args(OPENMPT DEFAULT_MSG 22 | OPENMPT_INCLUDE_DIR OGG_LIBRARY OPENMPT_LIBRARY) 23 | 24 | if(OPENMPT_FOUND) 25 | set(OPENMPT_LIBRARIES ${OPENMPT_LIBRARY}) 26 | else(OPENMPT_FOUND) 27 | set(OPENMPT_LIBRARIES) 28 | endif(OPENMPT_FOUND) 29 | 30 | mark_as_advanced(OPENMPT_INCLUDE_DIR OPENMPT_LIBRARY) 31 | -------------------------------------------------------------------------------- /cmake/FindOpenSL.cmake: -------------------------------------------------------------------------------- 1 | # - Find OpenSL (actually OpenSLES) 2 | # Find the OpenSLES includes and libraries 3 | # 4 | # OPENSL_INCLUDE_DIR - where to find dsound.h 5 | # OPENSL_LIBRARIES - List of libraries when using dsound. 6 | # OPENSL_FOUND - True if dsound found. 7 | 8 | if(OPENSL_INCLUDE_DIR) 9 | # Already in cache, be silent 10 | set(OPENSL_FIND_QUIETLY TRUE) 11 | endif(OPENSL_INCLUDE_DIR) 12 | 13 | find_path(OPENSL_INCLUDE_DIR SLES/OpenSLES.h) 14 | 15 | find_library(OPENSL_LIBRARY NAMES OpenSLES) 16 | 17 | # Handle the QUIETLY and REQUIRED arguments and set OPENSL_FOUND to TRUE if 18 | # all listed variables are TRUE. 19 | include(FindPackageHandleStandardArgs) 20 | set(FPHSA_NAME_MISMATCHED TRUE) 21 | find_package_handle_standard_args(OPENSL DEFAULT_MSG 22 | OPENSL_INCLUDE_DIR OPENSL_LIBRARY) 23 | 24 | if(OPENSL_FOUND) 25 | set(OPENSL_LIBRARIES ${OPENSL_LIBRARY}) 26 | else(OPENSL_FOUND) 27 | set(OPENSL_LIBRARIES) 28 | endif(OPENSL_FOUND) 29 | 30 | mark_as_advanced(OPENSL_INCLUDE_DIR OPENSL_LIBRARY) 31 | -------------------------------------------------------------------------------- /cmake/FindTremor.cmake: -------------------------------------------------------------------------------- 1 | # - Find Tremor 2 | # 3 | # TREMOR_INCLUDE_DIR - where to find Tremor headers. 4 | # TREMOR_LIBRAY - List of libraries when using libTremor. 5 | # TREMOR_FOUND - True if Tremor found. 6 | 7 | if(TREMOR_INCLUDE_DIR) 8 | # Already in cache, be silent 9 | set(TREMOR_FIND_QUIETLY TRUE) 10 | endif(TREMOR_INCLUDE_DIR) 11 | 12 | find_path(TREMOR_INCLUDE_DIR tremor/ivorbisfile.h) 13 | find_library(TREMOR_LIBRARY NAMES vorbisidec) 14 | 15 | # Handle the QUIETLY and REQUIRED arguments and set TREMOR_FOUND to TRUE if 16 | # all listed variables are TRUE. 17 | include(FindPackageHandleStandardArgs) 18 | set(FPHSA_NAME_MISMATCHED TRUE) 19 | find_package_handle_standard_args(TREMOR DEFAULT_MSG 20 | TREMOR_INCLUDE_DIR TREMOR_LIBRARY) 21 | 22 | mark_as_advanced(TREMOR_INCLUDE_DIR TREMOR_LIBRARY) 23 | 24 | if(TREMOR_FOUND) 25 | set(TREMOR_LIBRARIES ${TREMOR_LIBRARY} ${OGG_LIBRARY}) 26 | else(TREMOR_FOUND) 27 | set(TREMOR_LIBRARIES) 28 | endif(TREMOR_FOUND) 29 | 30 | mark_as_advanced(TREMOR_INCLUDE_DIR TREMOR_LIBRARY) 31 | -------------------------------------------------------------------------------- /cmake/PreventInSourceBuilds.cmake: -------------------------------------------------------------------------------- 1 | # This function will prevent in-source builds 2 | # Based on https://github.com/InsightSoftwareConsortium/ITK/blob/1b5da45dc706e6d6803b52740fa50e0e5e7705e9/CMake/PreventInSourceBuilds.cmake 3 | function(PreventInSourceBuilds) 4 | # make sure the user doesn't play dirty with symlinks 5 | get_filename_component(srcdir "${CMAKE_SOURCE_DIR}" REALPATH) 6 | get_filename_component(bindir "${CMAKE_BINARY_DIR}" REALPATH) 7 | 8 | # disallow in-source builds 9 | if("${srcdir}" STREQUAL "${bindir}") 10 | message(FATAL_ERROR 11 | "Allegro must not be configured to build in the source directory.\n" 12 | "Please refer to README.md\n" 13 | "Quitting configuration step") 14 | endif() 15 | endfunction() 16 | 17 | PreventInSourceBuilds() 18 | -------------------------------------------------------------------------------- /cmake/Toolchain-iphone.cmake: -------------------------------------------------------------------------------- 1 | set (IPHONE 1) 2 | set (ALLEGRO_CFG_OPENGLES 1) 3 | set (IOS_PLATFORM "iphoneos" CACHE STRING "iOS platform (iphoneos or iphonesimulator)") 4 | mark_as_advanced(IOS_PLATFORM) 5 | set (CMAKE_OSX_SYSROOT "${IOS_PLATFORM}") 6 | 7 | set (CMAKE_MACOSX_BUNDLE YES) 8 | set (CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO") 9 | -------------------------------------------------------------------------------- /cmake/Toolchain-openwiz.cmake: -------------------------------------------------------------------------------- 1 | SET(GP2XWIZ on) 2 | SET(CMAKE_SYSTEM_NAME Linux) 3 | SET(CMAKE_C_COMPILER arm-openwiz-linux-gnu-gcc) 4 | SET(CMAKE_CXX_COMPILER arm-openwiz-linux-gnu-g++) 5 | SET(CMAKE_FIND_ROOT_PATH /home/trent/arm-openwiz-linux-gnu) 6 | SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 7 | SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 8 | SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 9 | -------------------------------------------------------------------------------- /contrib/luajit/README.txt: -------------------------------------------------------------------------------- 1 | Luajit 2 | ====== 3 | 4 | The contents of this directory provides support for using Allegro5 from [Luajit][lj]. 5 | 6 | 7 | Usage 8 | ----- 9 | 10 | To create a Luajit FFI desciption we use the prototypes scraped using the checkdocs.py script. 11 | 12 | # output a file protos.txt 13 | ./python/checkdocs.py -p protos.txt -b build/ 14 | 15 | # use the prototypes to create Luajit datatypes for Allegro5 16 | ./contrib/luajit/generate_luajit_ffi.py -p protos.txt -o al5_ffi.lua 17 | 18 | See the Luajit docs on how to use this file. 19 | 20 | 21 | [lj]: http://luajit.org 22 | -------------------------------------------------------------------------------- /demos/cosmic_protector/data/gfx/Icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/cosmic_protector/data/gfx/Icon.icns -------------------------------------------------------------------------------- /demos/cosmic_protector/data/gfx/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/cosmic_protector/data/gfx/background.jpg -------------------------------------------------------------------------------- /demos/cosmic_protector/data/gfx/icon48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/cosmic_protector/data/gfx/icon48.png -------------------------------------------------------------------------------- /demos/cosmic_protector/data/gfx/large_asteroid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/cosmic_protector/data/gfx/large_asteroid.png -------------------------------------------------------------------------------- /demos/cosmic_protector/data/gfx/large_bullet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/cosmic_protector/data/gfx/large_bullet.png -------------------------------------------------------------------------------- /demos/cosmic_protector/data/gfx/large_explosion_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/cosmic_protector/data/gfx/large_explosion_0.png -------------------------------------------------------------------------------- /demos/cosmic_protector/data/gfx/large_explosion_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/cosmic_protector/data/gfx/large_explosion_1.png -------------------------------------------------------------------------------- /demos/cosmic_protector/data/gfx/large_explosion_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/cosmic_protector/data/gfx/large_explosion_2.png -------------------------------------------------------------------------------- /demos/cosmic_protector/data/gfx/large_explosion_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/cosmic_protector/data/gfx/large_explosion_3.png -------------------------------------------------------------------------------- /demos/cosmic_protector/data/gfx/large_explosion_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/cosmic_protector/data/gfx/large_explosion_4.png -------------------------------------------------------------------------------- /demos/cosmic_protector/data/gfx/large_font.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/cosmic_protector/data/gfx/large_font.png -------------------------------------------------------------------------------- /demos/cosmic_protector/data/gfx/life_powerup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/cosmic_protector/data/gfx/life_powerup.png -------------------------------------------------------------------------------- /demos/cosmic_protector/data/gfx/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/cosmic_protector/data/gfx/logo.png -------------------------------------------------------------------------------- /demos/cosmic_protector/data/gfx/medium_asteroid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/cosmic_protector/data/gfx/medium_asteroid.png -------------------------------------------------------------------------------- /demos/cosmic_protector/data/gfx/ship.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/cosmic_protector/data/gfx/ship.png -------------------------------------------------------------------------------- /demos/cosmic_protector/data/gfx/ship_icon.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/cosmic_protector/data/gfx/ship_icon.tga -------------------------------------------------------------------------------- /demos/cosmic_protector/data/gfx/ship_trans.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/cosmic_protector/data/gfx/ship_trans.png -------------------------------------------------------------------------------- /demos/cosmic_protector/data/gfx/small_asteroid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/cosmic_protector/data/gfx/small_asteroid.png -------------------------------------------------------------------------------- /demos/cosmic_protector/data/gfx/small_bullet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/cosmic_protector/data/gfx/small_bullet.png -------------------------------------------------------------------------------- /demos/cosmic_protector/data/gfx/small_explosion_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/cosmic_protector/data/gfx/small_explosion_0.png -------------------------------------------------------------------------------- /demos/cosmic_protector/data/gfx/small_explosion_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/cosmic_protector/data/gfx/small_explosion_1.png -------------------------------------------------------------------------------- /demos/cosmic_protector/data/gfx/small_explosion_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/cosmic_protector/data/gfx/small_explosion_2.png -------------------------------------------------------------------------------- /demos/cosmic_protector/data/gfx/small_explosion_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/cosmic_protector/data/gfx/small_explosion_3.png -------------------------------------------------------------------------------- /demos/cosmic_protector/data/gfx/small_explosion_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/cosmic_protector/data/gfx/small_explosion_4.png -------------------------------------------------------------------------------- /demos/cosmic_protector/data/gfx/small_font.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/cosmic_protector/data/gfx/small_font.png -------------------------------------------------------------------------------- /demos/cosmic_protector/data/gfx/trail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/cosmic_protector/data/gfx/trail.png -------------------------------------------------------------------------------- /demos/cosmic_protector/data/gfx/ufo0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/cosmic_protector/data/gfx/ufo0.png -------------------------------------------------------------------------------- /demos/cosmic_protector/data/gfx/ufo1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/cosmic_protector/data/gfx/ufo1.png -------------------------------------------------------------------------------- /demos/cosmic_protector/data/gfx/ufo2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/cosmic_protector/data/gfx/ufo2.png -------------------------------------------------------------------------------- /demos/cosmic_protector/data/gfx/weapon_powerup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/cosmic_protector/data/gfx/weapon_powerup.png -------------------------------------------------------------------------------- /demos/cosmic_protector/data/sfx/big_explosion.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/cosmic_protector/data/sfx/big_explosion.ogg -------------------------------------------------------------------------------- /demos/cosmic_protector/data/sfx/collision.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/cosmic_protector/data/sfx/collision.ogg -------------------------------------------------------------------------------- /demos/cosmic_protector/data/sfx/fire_large.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/cosmic_protector/data/sfx/fire_large.ogg -------------------------------------------------------------------------------- /demos/cosmic_protector/data/sfx/fire_small.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/cosmic_protector/data/sfx/fire_small.ogg -------------------------------------------------------------------------------- /demos/cosmic_protector/data/sfx/game_music.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/cosmic_protector/data/sfx/game_music.ogg -------------------------------------------------------------------------------- /demos/cosmic_protector/data/sfx/powerup.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/cosmic_protector/data/sfx/powerup.ogg -------------------------------------------------------------------------------- /demos/cosmic_protector/data/sfx/small_explosion.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/cosmic_protector/data/sfx/small_explosion.ogg -------------------------------------------------------------------------------- /demos/cosmic_protector/data/sfx/title_music.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/cosmic_protector/data/sfx/title_music.ogg -------------------------------------------------------------------------------- /demos/cosmic_protector/include/Asteroid.hpp: -------------------------------------------------------------------------------- 1 | #ifndef ASTEROID_HPP 2 | #define ASTEROID_HPP 3 | 4 | class Asteroid : public Entity 5 | { 6 | public: 7 | bool logic(int step); 8 | void render(int offx, int offy); 9 | 10 | void init(float x, float y, float speed_x, float speed_y, float da); 11 | 12 | Asteroid(float radius, int bitmapID); 13 | ~Asteroid(); 14 | protected: 15 | float da; 16 | float angle; 17 | float speed_x; 18 | float speed_y; 19 | ALLEGRO_BITMAP *bitmap; 20 | }; 21 | 22 | #endif // ASTEROID_HPP 23 | -------------------------------------------------------------------------------- /demos/cosmic_protector/include/BitmapResource.hpp: -------------------------------------------------------------------------------- 1 | #ifndef BMPRESOURCE_HPP 2 | #define BMPRESOURCE_HPP 3 | 4 | #include "cosmic_protector.hpp" 5 | 6 | class BitmapResource : public Resource { 7 | public: 8 | void destroy(void); 9 | bool load(void); 10 | void* get(void); 11 | BitmapResource(const char* filename); 12 | private: 13 | ALLEGRO_BITMAP *bitmap; 14 | std::string filename; 15 | }; 16 | 17 | #endif // BMPRESOURCE_HPP 18 | 19 | -------------------------------------------------------------------------------- /demos/cosmic_protector/include/Bullet.hpp: -------------------------------------------------------------------------------- 1 | #ifndef BULLET_HPP 2 | #define BULLET_HPP 3 | 4 | class Bullet : public Entity 5 | { 6 | public: 7 | bool logic(int step); 8 | 9 | Bullet(float x, float y, float radius, float speed, float angle, 10 | int lifetime, int damage, int bitmapID, Entity *shooter); 11 | ~Bullet(void); 12 | protected: 13 | ALLEGRO_BITMAP *bitmap; 14 | float speed; 15 | float angle; 16 | int lifetime; 17 | float cosa; 18 | float sina; 19 | Entity *shooter; 20 | int damage; 21 | bool playerOnly; 22 | }; 23 | 24 | #endif // BULLET_HPP 25 | 26 | -------------------------------------------------------------------------------- /demos/cosmic_protector/include/ButtonWidget.hpp: -------------------------------------------------------------------------------- 1 | #ifndef BUTTONWIDGET_HPP 2 | #define BUTTONWIDGET_HPP 3 | 4 | class ButtonWidget : public Widget 5 | { 6 | public: 7 | bool activate(void); 8 | void render(bool selected); 9 | 10 | ButtonWidget(int x, int y, bool center, const char *text); 11 | ~ButtonWidget() {}; 12 | protected: 13 | int x; 14 | int y; 15 | bool center; 16 | const char *text; 17 | }; 18 | 19 | #endif // BUTTONWIDGET_HPP 20 | 21 | -------------------------------------------------------------------------------- /demos/cosmic_protector/include/Debug.hpp: -------------------------------------------------------------------------------- 1 | #ifndef DEBUG_H 2 | #define DEBUG_H 3 | 4 | #include "cosmic_protector.hpp" 5 | 6 | void debug_message(const char *, ...); 7 | 8 | #endif 9 | 10 | -------------------------------------------------------------------------------- /demos/cosmic_protector/include/DisplayResource.hpp: -------------------------------------------------------------------------------- 1 | #ifndef DISPLAYRESOURCE_HPP 2 | #define DISPLAYRESOURCE_HPP 3 | 4 | #include "cosmic_protector.hpp" 5 | 6 | class DisplayResource : public Resource { 7 | public: 8 | void destroy(void); 9 | bool load(void); 10 | void* get(void); 11 | ALLEGRO_EVENT_QUEUE *getEventQueue(void); 12 | DisplayResource(void); 13 | private: 14 | ALLEGRO_DISPLAY *display; 15 | ALLEGRO_EVENT_QUEUE *events; 16 | }; 17 | 18 | extern bool useFullScreenMode; 19 | 20 | #endif // DISPLAYRESOURCE_HPP 21 | 22 | -------------------------------------------------------------------------------- /demos/cosmic_protector/include/Explosion.hpp: -------------------------------------------------------------------------------- 1 | #ifndef EXPLOSION_HPP 2 | #define EXPLOSION_HPP 3 | 4 | class Explosion : public Entity 5 | { 6 | public: 7 | static const int NUM_FRAMES = 5; 8 | static const int FRAME_TIME = 100; 9 | 10 | bool logic(int step); 11 | void render(int offx, int offy); 12 | 13 | Explosion(float x, float y, bool big); 14 | private: 15 | int frameCount; 16 | int currFrame; 17 | bool big; 18 | }; 19 | 20 | #endif // EXPLOSION_HPP 21 | 22 | -------------------------------------------------------------------------------- /demos/cosmic_protector/include/FontResource.hpp: -------------------------------------------------------------------------------- 1 | #ifndef FONTRESOURCE_HPP 2 | #define FONTRESOURCE_HPP 3 | 4 | class FontResource : public Resource 5 | { 6 | public: 7 | void destroy(void); 8 | bool load(void); 9 | void* get(void); 10 | FontResource(const char *filename); 11 | private: 12 | ALLEGRO_FONT *font; 13 | std::string filename; 14 | }; 15 | 16 | #endif // FONTRESOURCE_HPP 17 | -------------------------------------------------------------------------------- /demos/cosmic_protector/include/Game.hpp: -------------------------------------------------------------------------------- 1 | #ifndef GAME_HPP 2 | #define GAME_HPP 3 | 4 | #include "cosmic_protector.hpp" 5 | 6 | #ifdef ALLEGRO_MSVC 7 | /* MSVC (up to ver. 9 at least) ignores exception specifications */ 8 | #pragma warning( disable : 4290 ) 9 | #endif 10 | 11 | const char* getResource(const char* fmt, ...); 12 | bool loadResources(void); 13 | bool init(void); 14 | void done(void); 15 | float randf(float lo, float hi); 16 | 17 | extern bool kb_installed; 18 | extern bool joy_installed; 19 | 20 | 21 | #endif // GAME_HPP 22 | 23 | -------------------------------------------------------------------------------- /demos/cosmic_protector/include/LargeAsteroid.hpp: -------------------------------------------------------------------------------- 1 | #ifndef LARGEASTEROID_HPP 2 | #define LARGEASTEROID_HPP 3 | 4 | class LargeAsteroid : public Asteroid 5 | { 6 | public: 7 | void spawn(void); 8 | 9 | LargeAsteroid(); 10 | LargeAsteroid(float x, float y, float speed_x, float speed_y, float da); 11 | ~LargeAsteroid(); 12 | }; 13 | 14 | #endif // LARGEASTEROID_HPP 15 | 16 | -------------------------------------------------------------------------------- /demos/cosmic_protector/include/LargeBullet.hpp: -------------------------------------------------------------------------------- 1 | #ifndef LARGEBULLET_HPP 2 | #define LARGEBULLET_HPP 3 | 4 | class LargeBullet : public Bullet 5 | { 6 | public: 7 | void render(int offx, int offy); 8 | 9 | LargeBullet(float x, float y, float angle, Entity *shooter); 10 | }; 11 | 12 | #endif // LARGEBULLET_HPP 13 | 14 | -------------------------------------------------------------------------------- /demos/cosmic_protector/include/LargeSlowBullet.hpp: -------------------------------------------------------------------------------- 1 | #ifndef LARGESLOWBULLET_HPP 2 | #define LARGESLOWBULLET_HPP 3 | 4 | class LargeSlowBullet : public LargeBullet 5 | { 6 | public: 7 | LargeSlowBullet(float x, float y, float angle, Entity *shooter); 8 | }; 9 | 10 | #endif // LARGESLOWBULLET_HPP 11 | 12 | -------------------------------------------------------------------------------- /demos/cosmic_protector/include/MediumAsteroid.hpp: -------------------------------------------------------------------------------- 1 | #ifndef MEDIUMASTEROID_HPP 2 | #define MEDIUMASTEROID_HPP 3 | 4 | class MediumAsteroid : public Asteroid 5 | { 6 | public: 7 | void spawn(void); 8 | 9 | MediumAsteroid(); 10 | ~MediumAsteroid(); 11 | }; 12 | 13 | #endif // MEDIUMASTEROID_HPP 14 | 15 | -------------------------------------------------------------------------------- /demos/cosmic_protector/include/PowerUp.hpp: -------------------------------------------------------------------------------- 1 | #ifndef POWERUP_HPP 2 | #define POWERUP_HPP 3 | 4 | const int POWERUP_LIFE = 0; 5 | const int POWERUP_WEAPON = 1; 6 | 7 | class PowerUp : public Entity 8 | { 9 | public: 10 | const float SPIN_SPEED; 11 | 12 | bool logic(int step); 13 | void render(int offx, int offy); 14 | 15 | PowerUp(float x, float y, int type); 16 | private: 17 | int type; 18 | ALLEGRO_BITMAP *bitmap; 19 | float angle; 20 | float da; 21 | }; 22 | 23 | #endif // POWERUP_HPP 24 | 25 | -------------------------------------------------------------------------------- /demos/cosmic_protector/include/ResourceManager.hpp: -------------------------------------------------------------------------------- 1 | #ifndef RESOURCEMGR_HPP 2 | #define RESOURCEMGR_HPP 3 | 4 | #include "cosmic_protector.hpp" 5 | 6 | class ResourceManager { 7 | public: 8 | static ResourceManager& getInstance(void); 9 | 10 | void destroy(void); 11 | 12 | // Add with optional load 13 | bool add(Resource* res, bool load = true); 14 | Resource* getResource(int index); 15 | void* getData(int index); 16 | private: 17 | static ResourceManager *rm; 18 | ResourceManager(void); 19 | 20 | std::vector< Resource* > resources; 21 | }; 22 | 23 | #endif // RESOURCEMGR_HPP 24 | 25 | -------------------------------------------------------------------------------- /demos/cosmic_protector/include/SampleResource.hpp: -------------------------------------------------------------------------------- 1 | #ifndef SAMPLERESOURCE_HPP 2 | #define SAMPLERESOURCE_HPP 3 | 4 | #include "cosmic_protector.hpp" 5 | 6 | class SampleResource : public Resource { 7 | public: 8 | void destroy(void); 9 | bool load(void); 10 | void* get(void); 11 | SampleResource(const char* filename); 12 | private: 13 | ALLEGRO_SAMPLE *sample_data; 14 | std::string filename; 15 | }; 16 | 17 | #endif // SAMPLERESOURCE_HPP 18 | 19 | -------------------------------------------------------------------------------- /demos/cosmic_protector/include/SmallAsteroid.hpp: -------------------------------------------------------------------------------- 1 | #ifndef SMALLASTEROID_HPP 2 | #define SMALLASTEROID_HPP 3 | 4 | class SmallAsteroid : public Asteroid 5 | { 6 | public: 7 | SmallAsteroid(); 8 | ~SmallAsteroid(); 9 | }; 10 | 11 | #endif // SMALLASTEROID_HPP 12 | 13 | -------------------------------------------------------------------------------- /demos/cosmic_protector/include/SmallBullet.hpp: -------------------------------------------------------------------------------- 1 | #ifndef SMALLBULLET_HPP 2 | #define SMALLBULLET_HPP 3 | 4 | class SmallBullet : public Bullet 5 | { 6 | public: 7 | void render(int offx, int offy); 8 | 9 | SmallBullet(float x, float y, float angle, Entity *shooter); 10 | }; 11 | 12 | #endif // SMALLBULLET_HPP 13 | 14 | -------------------------------------------------------------------------------- /demos/cosmic_protector/include/StreamResource.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STREAMRESOURCE_HPP 2 | #define STREAMRESOURCE_HPP 3 | 4 | #include "cosmic_protector.hpp" 5 | 6 | class StreamResource : public Resource { 7 | public: 8 | void destroy(void); 9 | bool load(void); 10 | void* get(void); 11 | StreamResource(const char* filename); 12 | private: 13 | ALLEGRO_AUDIO_STREAM *stream; 14 | std::string filename; 15 | }; 16 | 17 | #endif // STREAMRESOURCE_HPP 18 | 19 | -------------------------------------------------------------------------------- /demos/cosmic_protector/include/UFO.hpp: -------------------------------------------------------------------------------- 1 | #ifndef UFO_HPP 2 | #define UFO_HPP 3 | 4 | class UFO : public Entity 5 | { 6 | public: 7 | const int SHOT_SPEED; 8 | const int ANIMATION_SPEED; 9 | 10 | bool logic(int step); 11 | void render(int offx, int offy); 12 | void render(int offx, int offy, ALLEGRO_COLOR tint); 13 | 14 | UFO(float x, float y, float dx, float dy); 15 | ~UFO(); 16 | protected: 17 | ALLEGRO_BITMAP *bitmaps[3]; 18 | int nextShot; 19 | int bitmapFrame; 20 | int bitmapFrameCount; 21 | float speed_x; 22 | float speed_y; 23 | }; 24 | 25 | #endif // UFO_HPP 26 | -------------------------------------------------------------------------------- /demos/cosmic_protector/include/Wave.hpp: -------------------------------------------------------------------------------- 1 | #ifndef WAVE_HPP 2 | #define WAVE_HPP 3 | 4 | class Wave 5 | { 6 | public: 7 | Wave(); 8 | bool next(void); 9 | 10 | private: 11 | int rippleNum; 12 | }; 13 | 14 | #endif // WAVE_HPP 15 | 16 | -------------------------------------------------------------------------------- /demos/cosmic_protector/include/Weapon.hpp: -------------------------------------------------------------------------------- 1 | #ifndef WEAPON_HPP 2 | #define WEAPON_HPP 3 | 4 | const int WEAPON_SMALL = 0; 5 | const int WEAPON_LARGE = 1; 6 | 7 | #endif // WEAPON_HPP 8 | 9 | -------------------------------------------------------------------------------- /demos/cosmic_protector/include/Widget.hpp: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_HPP 2 | #define WIDGET_HPP 3 | 4 | class Widget 5 | { 6 | public: 7 | // Returns false to destroy the gui 8 | virtual bool activate(void) = 0; 9 | virtual void render(bool selected) = 0; 10 | virtual ~Widget() {}; 11 | }; 12 | 13 | #endif // WIDGET_HPP 14 | 15 | -------------------------------------------------------------------------------- /demos/cosmic_protector/include/collision.hpp: -------------------------------------------------------------------------------- 1 | #ifndef COLLISION_HPP 2 | #define COLLISION_HPP 3 | 4 | bool checkCircleCollision(float x1, float y1, float r1, 5 | float x2, float y2, float r2); 6 | 7 | #endif // COLLISION_HPP 8 | -------------------------------------------------------------------------------- /demos/cosmic_protector/include/cosmic_protector_objc.h: -------------------------------------------------------------------------------- 1 | #ifdef __cplusplus 2 | extern "C" { 3 | #endif 4 | 5 | bool isMultitaskingSupported(void); 6 | 7 | #ifdef __cplusplus 8 | } 9 | #endif 10 | 11 | -------------------------------------------------------------------------------- /demos/cosmic_protector/include/gui.hpp: -------------------------------------------------------------------------------- 1 | #ifndef GUI_HPP 2 | #define GUI_HPP 3 | 4 | int do_menu(void); 5 | void do_highscores(int score); 6 | 7 | #endif // GUI_HPP 8 | 9 | -------------------------------------------------------------------------------- /demos/cosmic_protector/include/joypad_c.h: -------------------------------------------------------------------------------- 1 | #ifdef __cplusplus 2 | extern "C" { 3 | #endif 4 | 5 | void joypad_start(void); 6 | void joypad_find(void); 7 | void joypad_stop_finding(void); 8 | void get_joypad_state(bool *u, bool *d, bool *l, bool *r, bool *b, bool *esc); 9 | bool is_joypad_connected(void); 10 | 11 | #ifdef __cplusplus 12 | } 13 | #endif 14 | -------------------------------------------------------------------------------- /demos/cosmic_protector/include/joypad_handler.h: -------------------------------------------------------------------------------- 1 | #ifdef USE_JOYPAD 2 | 3 | #import "JoypadSDK.h" 4 | 5 | @interface joypad_handler : NSObject 6 | { 7 | JoypadManager *joypadManager; 8 | 9 | @public 10 | bool connected, left, right, up, down, ba, bb, bx, by, bl, br; 11 | bool finding; 12 | } 13 | 14 | -(void)start; 15 | -(void)find_devices; 16 | -(void)stop_finding_devices; 17 | 18 | @end 19 | 20 | #endif 21 | 22 | #include "joypad_c.h" 23 | -------------------------------------------------------------------------------- /demos/cosmic_protector/include/logic.hpp: -------------------------------------------------------------------------------- 1 | #ifndef LOGIC_HPP 2 | #define LOGIC_HPP 3 | 4 | bool logic(int step); 5 | 6 | extern std::list entities; 7 | extern std::list new_entities; 8 | extern long lastUFO; 9 | extern bool canUFO; 10 | 11 | #endif // LOGIC_HPP 12 | -------------------------------------------------------------------------------- /demos/cosmic_protector/include/render.hpp: -------------------------------------------------------------------------------- 1 | #ifndef RENDER_HPP 2 | #define RENDER_HPP 3 | 4 | void render(int step); 5 | void showWave(int num); 6 | void shake(void); 7 | 8 | #endif // RENDER_HPP 9 | 10 | -------------------------------------------------------------------------------- /demos/cosmic_protector/include/sound.hpp: -------------------------------------------------------------------------------- 1 | #ifndef SOUND_HPP 2 | #define SOUND_HPP 3 | 4 | void my_play_sample(int resourceID); 5 | 6 | #endif // SOUND_HPP 7 | -------------------------------------------------------------------------------- /demos/cosmic_protector/src/BitmapResource.cpp: -------------------------------------------------------------------------------- 1 | #include "cosmic_protector.hpp" 2 | 3 | void BitmapResource::destroy(void) 4 | { 5 | if (!bitmap) 6 | return; 7 | al_destroy_bitmap(bitmap); 8 | bitmap = 0; 9 | } 10 | 11 | bool BitmapResource::load(void) 12 | { 13 | al_set_new_bitmap_format(ALLEGRO_PIXEL_FORMAT_ANY_WITH_ALPHA); 14 | al_set_new_bitmap_flags(ALLEGRO_MIN_LINEAR | ALLEGRO_MAG_LINEAR); 15 | bitmap = al_load_bitmap(filename.c_str()); 16 | if (!bitmap) 17 | debug_message("Error loading bitmap %s\n", filename.c_str()); 18 | return bitmap != 0; 19 | } 20 | 21 | void* BitmapResource::get(void) 22 | { 23 | return bitmap; 24 | } 25 | 26 | BitmapResource::BitmapResource(const char* filename) : 27 | bitmap(0) 28 | { 29 | this->filename = std::string(filename); 30 | } 31 | 32 | -------------------------------------------------------------------------------- /demos/cosmic_protector/src/ButtonWidget.cpp: -------------------------------------------------------------------------------- 1 | #include "cosmic_protector.hpp" 2 | 3 | bool ButtonWidget::activate(void) 4 | { 5 | return false; 6 | } 7 | 8 | void ButtonWidget::render(bool selected) 9 | { 10 | ALLEGRO_FONT *myfont; 11 | ResourceManager& rm = ResourceManager::getInstance(); 12 | 13 | if (center) { 14 | if (selected) { 15 | myfont = (ALLEGRO_FONT *)rm.getData(RES_LARGEFONT); 16 | } 17 | else { 18 | myfont = (ALLEGRO_FONT *)rm.getData(RES_SMALLFONT); 19 | } 20 | al_draw_textf(myfont, al_map_rgb(255, 255, 255), x, y-al_get_font_line_height(myfont)/2, ALLEGRO_ALIGN_CENTRE, "%s", text); 21 | } 22 | } 23 | 24 | ButtonWidget::ButtonWidget(int x, int y, bool center, const char *text) : 25 | x(x), 26 | y(y), 27 | center(center), 28 | text(text) 29 | { 30 | } 31 | 32 | -------------------------------------------------------------------------------- /demos/cosmic_protector/src/Debug.cpp: -------------------------------------------------------------------------------- 1 | #include "cosmic_protector.hpp" 2 | 3 | void debug_message(const char * fmt, ...) 4 | { 5 | va_list ap; 6 | 7 | va_start(ap, fmt); 8 | vprintf(fmt, ap); 9 | va_end(ap); 10 | } 11 | 12 | -------------------------------------------------------------------------------- /demos/cosmic_protector/src/FontResource.cpp: -------------------------------------------------------------------------------- 1 | #include "cosmic_protector.hpp" 2 | 3 | void FontResource::destroy(void) 4 | { 5 | al_destroy_font(font); 6 | font = 0; 7 | } 8 | 9 | bool FontResource::load(void) 10 | { 11 | font = al_load_font(filename.c_str(), 0, 0); 12 | return font != 0; 13 | } 14 | 15 | void* FontResource::get(void) 16 | { 17 | return font; 18 | } 19 | 20 | FontResource::FontResource(const char *filename) : 21 | font(0), 22 | filename(filename) 23 | { 24 | } 25 | 26 | -------------------------------------------------------------------------------- /demos/cosmic_protector/src/LargeAsteroid.cpp: -------------------------------------------------------------------------------- 1 | #include "cosmic_protector.hpp" 2 | 3 | void LargeAsteroid::spawn(void) 4 | { 5 | // Break into small fragments 6 | for (int i = 0; i < 2; i++) { 7 | float dx = randf(0.06f, 0.12f); 8 | float dy = randf(0.04f, 0.08f); 9 | float da = randf(0.001, 0.005); 10 | if (rand() % 2) dx = -dx; 11 | if (rand() % 2) dy = -dy; 12 | if (rand() % 2) da = -da; 13 | MediumAsteroid *ma = new MediumAsteroid(); 14 | ma->init(x, y, dx, dy, da); 15 | new_entities.push_back(ma); 16 | } 17 | 18 | Entity::spawn(); 19 | } 20 | 21 | LargeAsteroid::LargeAsteroid() : 22 | Asteroid(32, RES_LARGEASTEROID) 23 | { 24 | hp = 6; 25 | points = 100; 26 | } 27 | 28 | LargeAsteroid::LargeAsteroid(float x, float y, float speed_x, float speed_y, float da) : 29 | Asteroid(32, RES_LARGEASTEROID) 30 | { 31 | init(x, y, speed_x, speed_y, da); 32 | hp = 6; 33 | points = 100; 34 | } 35 | 36 | LargeAsteroid::~LargeAsteroid() 37 | { 38 | } 39 | 40 | -------------------------------------------------------------------------------- /demos/cosmic_protector/src/LargeBullet.cpp: -------------------------------------------------------------------------------- 1 | #include "cosmic_protector.hpp" 2 | 3 | void LargeBullet::render(int offx, int offy) 4 | { 5 | al_draw_rotated_bitmap(bitmap, radius, radius, offx + x, offy + y, 6 | angle+(ALLEGRO_PI/2), 0); 7 | } 8 | 9 | LargeBullet::LargeBullet(float x, float y, float angle, Entity *shooter) : 10 | Bullet(x, y, 6, 0.6f, angle, 600, 2, RES_LARGEBULLET, shooter) 11 | { 12 | } 13 | 14 | -------------------------------------------------------------------------------- /demos/cosmic_protector/src/LargeSlowBullet.cpp: -------------------------------------------------------------------------------- 1 | #include "cosmic_protector.hpp" 2 | 3 | LargeSlowBullet::LargeSlowBullet(float x, float y, float angle, Entity *shooter) : 4 | LargeBullet(x, y, angle, shooter) 5 | { 6 | speed = 0.20f; 7 | lifetime += 1000; 8 | playerOnly = true; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /demos/cosmic_protector/src/MediumAsteroid.cpp: -------------------------------------------------------------------------------- 1 | #include "cosmic_protector.hpp" 2 | 3 | void MediumAsteroid::spawn(void) 4 | { 5 | // Break into small fragments 6 | for (int i = 0; i < 3; i++) { 7 | float dx = randf(0.06f, 0.12f); 8 | float dy = randf(0.04f, 0.08f); 9 | float da = randf(0.001, 0.005); 10 | if (rand() % 2) dx = -dx; 11 | if (rand() % 2) dy = -dy; 12 | if (rand() % 2) da = -da; 13 | SmallAsteroid *sa = new SmallAsteroid(); 14 | sa->init(x, y, dx, dy, da); 15 | new_entities.push_back(sa); 16 | } 17 | 18 | Entity::spawn(); 19 | } 20 | 21 | MediumAsteroid::MediumAsteroid() : 22 | Asteroid(20, RES_MEDIUMASTEROID) 23 | { 24 | hp = 4; 25 | points = 50; 26 | } 27 | 28 | MediumAsteroid::~MediumAsteroid() 29 | { 30 | } 31 | 32 | -------------------------------------------------------------------------------- /demos/cosmic_protector/src/SampleResource.cpp: -------------------------------------------------------------------------------- 1 | #include "cosmic_protector.hpp" 2 | 3 | void SampleResource::destroy(void) 4 | { 5 | al_destroy_sample(sample_data); 6 | sample_data = 0; 7 | } 8 | 9 | bool SampleResource::load(void) 10 | { 11 | if (!al_is_audio_installed()) { 12 | debug_message("Skipped loading sample %s\n", filename.c_str()); 13 | return true; 14 | } 15 | 16 | sample_data = al_load_sample(filename.c_str()); 17 | if (!sample_data) { 18 | debug_message("Error loading sample %s\n", filename.c_str()); 19 | return false; 20 | } 21 | 22 | return true; 23 | } 24 | 25 | void* SampleResource::get(void) 26 | { 27 | return sample_data; 28 | } 29 | 30 | SampleResource::SampleResource(const char* filename) : 31 | sample_data(0), 32 | filename(filename) 33 | { 34 | } 35 | 36 | -------------------------------------------------------------------------------- /demos/cosmic_protector/src/SmallAsteroid.cpp: -------------------------------------------------------------------------------- 1 | #include "cosmic_protector.hpp" 2 | 3 | SmallAsteroid::SmallAsteroid() : 4 | Asteroid(10, RES_SMALLASTEROID) 5 | { 6 | points = 10; 7 | } 8 | 9 | SmallAsteroid::~SmallAsteroid() 10 | { 11 | } 12 | 13 | -------------------------------------------------------------------------------- /demos/cosmic_protector/src/SmallBullet.cpp: -------------------------------------------------------------------------------- 1 | #include "cosmic_protector.hpp" 2 | 3 | void SmallBullet::render(int offx, int offy) 4 | { 5 | al_draw_rotated_bitmap(bitmap, radius, radius, offx + x, offy + y, 0.0f, 0); 6 | } 7 | 8 | SmallBullet::SmallBullet(float x, float y, float angle, Entity *shooter) : 9 | Bullet(x, y, 4, 0.5f, angle, 600, 1, RES_SMALLBULLET, shooter) 10 | { 11 | } 12 | 13 | -------------------------------------------------------------------------------- /demos/cosmic_protector/src/StreamResource.cpp: -------------------------------------------------------------------------------- 1 | #include "cosmic_protector.hpp" 2 | 3 | void StreamResource::destroy(void) 4 | { 5 | if (!stream) 6 | return; 7 | al_destroy_audio_stream(stream); 8 | stream = 0; 9 | } 10 | 11 | bool StreamResource::load(void) 12 | { 13 | if (!al_is_audio_installed()) { 14 | debug_message("Skipped loading stream %s\n", filename.c_str()); 15 | return true; 16 | } 17 | 18 | stream = al_load_audio_stream(filename.c_str(), 4, 1024); 19 | if (!stream) { 20 | debug_message("Error creating stream\n"); 21 | return false; 22 | } 23 | 24 | al_set_audio_stream_playing(stream, false); 25 | al_set_audio_stream_playmode(stream, ALLEGRO_PLAYMODE_LOOP); 26 | al_attach_audio_stream_to_mixer(stream, al_get_default_mixer()); 27 | 28 | return true; 29 | } 30 | 31 | void* StreamResource::get(void) 32 | { 33 | return stream; 34 | } 35 | 36 | StreamResource::StreamResource(const char* filename) : 37 | stream(0), 38 | filename(filename) 39 | { 40 | } 41 | 42 | -------------------------------------------------------------------------------- /demos/cosmic_protector/src/collision.cpp: -------------------------------------------------------------------------------- 1 | #include "cosmic_protector.hpp" 2 | 3 | bool checkCircleCollision(float x1, float y1, float r1, 4 | float x2, float y2, float r2) 5 | { 6 | float dx = x1-x2; 7 | float dy = y1-y2; 8 | float dist = sqrt(dx*dx + dy*dy); 9 | return dist < (r1+r2); 10 | } 11 | 12 | -------------------------------------------------------------------------------- /demos/cosmic_protector/src/cosmic_protector_objc.m: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #ifdef ALLEGRO_IPHONE 4 | 5 | #import 6 | #import 7 | 8 | #include "cosmic_protector_objc.h" 9 | 10 | bool isMultitaskingSupported(void) 11 | { 12 | NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; 13 | 14 | char buf[100]; 15 | strcpy(buf, [[[UIDevice currentDevice] systemVersion] UTF8String]); 16 | if (atof(buf) < 4.0) return false; 17 | 18 | [pool drain]; 19 | 20 | return [[UIDevice currentDevice] isMultitaskingSupported]; 21 | } 22 | #endif 23 | -------------------------------------------------------------------------------- /demos/cosmic_protector/src/joypad_dummy.cpp: -------------------------------------------------------------------------------- 1 | #include "joypad_c.h" 2 | 3 | /* Joypad is some iOS/MacOS X API. 4 | * This file is just a stub for when it isn't being used. 5 | * The real implementation is in joypad_handler.m. 6 | * Most platforms use the regular Allegro joystick API. 7 | */ 8 | #if !defined(USE_JOYPAD) 9 | 10 | void joypad_start(void) 11 | { 12 | } 13 | 14 | void joypad_find(void) 15 | { 16 | } 17 | 18 | void joypad_stop_finding(void) 19 | { 20 | } 21 | 22 | void get_joypad_state(bool *u, bool *d, bool *l, bool *r, bool *b, bool *esc) 23 | { 24 | *u = *d = *l = *r = *b = *esc = false; 25 | } 26 | 27 | bool is_joypad_connected(void) 28 | { 29 | return false; 30 | } 31 | 32 | #endif /* !USE_JOYPAD */ 33 | 34 | /* vim: set sts=3 sw=3 et: */ 35 | -------------------------------------------------------------------------------- /demos/cosmic_protector/src/sound.cpp: -------------------------------------------------------------------------------- 1 | #include "cosmic_protector.hpp" 2 | 3 | 4 | void my_play_sample(int resourceID) 5 | { 6 | ResourceManager &rm = ResourceManager::getInstance(); 7 | ALLEGRO_SAMPLE *s = (ALLEGRO_SAMPLE *)rm.getData(resourceID); 8 | if (s) { 9 | al_play_sample(s, 1.0, 0.0, 1.0, ALLEGRO_PLAYMODE_ONCE, NULL); 10 | } 11 | } 12 | 13 | -------------------------------------------------------------------------------- /demos/cosmic_protector/src/wave.cpp: -------------------------------------------------------------------------------- 1 | #include "cosmic_protector.hpp" 2 | 3 | Wave::Wave() : 4 | rippleNum(0) 5 | { 6 | } 7 | 8 | bool Wave::next(void) 9 | { 10 | rippleNum++; 11 | 12 | showWave(rippleNum); 13 | 14 | for (int i = 0; i < rippleNum+1; i++) { 15 | float x, y, dx, dy, da; 16 | if (rand() % 2) { 17 | x = -randf(32.0f, 100.0f); 18 | } 19 | else { 20 | x = BB_W+randf(32.0f, 100.0f); 21 | } 22 | if (rand() % 2) { 23 | y = -randf(32.0f, 70.0f); 24 | } 25 | else { 26 | y = BB_H+randf(32.0f, 70.0f); 27 | } 28 | dx = randf(0.06f, 0.12f); 29 | dy = randf(0.04f, 0.08f); 30 | da = randf(0.001f, 0.005f); 31 | if (rand() % 2) dx = -dx; 32 | if (rand() % 2) dy = -dy; 33 | if (rand() % 2) da = -da; 34 | LargeAsteroid *la = new LargeAsteroid(x, y, dx, dy, da); 35 | if ((rand() % 3) == 0) { 36 | la->setPowerUp(rand() % 2); 37 | } 38 | entities.push_back(la); 39 | } 40 | 41 | return true; 42 | } 43 | 44 | -------------------------------------------------------------------------------- /demos/shooter/aster.h: -------------------------------------------------------------------------------- 1 | #ifndef ASTER_H_INCLUDED 2 | #define ASTER_H_INCLUDED 3 | 4 | #include "demo.h" 5 | 6 | void init_asteroids(void); 7 | void add_asteroid(void); 8 | void move_asteroids(void); 9 | void scroll_asteroids(void); 10 | void draw_asteroids(void); 11 | int asteroid_collision(int x, int y, int s); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /demos/shooter/bullet.h: -------------------------------------------------------------------------------- 1 | #ifndef BULLET_H_INCLUDED 2 | #define BULLET_H_INCLUDED 3 | 4 | #include "demo.h" 5 | 6 | typedef struct BULLET { 7 | int x; 8 | int y; 9 | struct BULLET *next; 10 | } BULLET; 11 | 12 | extern BULLET *bullet_list; 13 | 14 | BULLET *add_bullet(int x, int y); 15 | BULLET *delete_bullet(BULLET * bullet); 16 | void draw_bullets(void); 17 | void move_bullets(void); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /demos/shooter/data/AST.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/shooter/data/AST.png -------------------------------------------------------------------------------- /demos/shooter/data/BOOM_SPL.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/shooter/data/BOOM_SPL.wav -------------------------------------------------------------------------------- /demos/shooter/data/DEATH_SPL.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/shooter/data/DEATH_SPL.wav -------------------------------------------------------------------------------- /demos/shooter/data/ENGINE1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/shooter/data/ENGINE1.png -------------------------------------------------------------------------------- /demos/shooter/data/ENGINE2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/shooter/data/ENGINE2.png -------------------------------------------------------------------------------- /demos/shooter/data/ENGINE3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/shooter/data/ENGINE3.png -------------------------------------------------------------------------------- /demos/shooter/data/ENGINE4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/shooter/data/ENGINE4.png -------------------------------------------------------------------------------- /demos/shooter/data/ENGINE5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/shooter/data/ENGINE5.png -------------------------------------------------------------------------------- /demos/shooter/data/ENGINE6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/shooter/data/ENGINE6.png -------------------------------------------------------------------------------- /demos/shooter/data/ENGINE7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/shooter/data/ENGINE7.png -------------------------------------------------------------------------------- /demos/shooter/data/ENGINE_SPL.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/shooter/data/ENGINE_SPL.wav -------------------------------------------------------------------------------- /demos/shooter/data/GAME_MUSIC.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/shooter/data/GAME_MUSIC.ogg -------------------------------------------------------------------------------- /demos/shooter/data/GO_BMP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/shooter/data/GO_BMP.png -------------------------------------------------------------------------------- /demos/shooter/data/INTRO_ANIM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/shooter/data/INTRO_ANIM.png -------------------------------------------------------------------------------- /demos/shooter/data/INTRO_BMP_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/shooter/data/INTRO_BMP_1.png -------------------------------------------------------------------------------- /demos/shooter/data/INTRO_BMP_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/shooter/data/INTRO_BMP_2.png -------------------------------------------------------------------------------- /demos/shooter/data/INTRO_BMP_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/shooter/data/INTRO_BMP_3.png -------------------------------------------------------------------------------- /demos/shooter/data/INTRO_BMP_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/shooter/data/INTRO_BMP_4.png -------------------------------------------------------------------------------- /demos/shooter/data/INTRO_SPL.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/shooter/data/INTRO_SPL.wav -------------------------------------------------------------------------------- /demos/shooter/data/ROCKET.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/shooter/data/ROCKET.png -------------------------------------------------------------------------------- /demos/shooter/data/SHIP1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/shooter/data/SHIP1.png -------------------------------------------------------------------------------- /demos/shooter/data/SHIP2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/shooter/data/SHIP2.png -------------------------------------------------------------------------------- /demos/shooter/data/SHIP3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/shooter/data/SHIP3.png -------------------------------------------------------------------------------- /demos/shooter/data/SHIP4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/shooter/data/SHIP4.png -------------------------------------------------------------------------------- /demos/shooter/data/SHIP5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/shooter/data/SHIP5.png -------------------------------------------------------------------------------- /demos/shooter/data/SHOOT_SPL.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/shooter/data/SHOOT_SPL.wav -------------------------------------------------------------------------------- /demos/shooter/data/TITLE_BMP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/shooter/data/TITLE_BMP.png -------------------------------------------------------------------------------- /demos/shooter/data/WELCOME_SPL.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/shooter/data/WELCOME_SPL.wav -------------------------------------------------------------------------------- /demos/shooter/demo.h: -------------------------------------------------------------------------------- 1 | #ifndef DEMO_H_INCLUDED 2 | #define DEMO_H_INCLUDED 3 | 4 | #define ALLEGRO_UNSTABLE 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include "../speed/a4_aux.h" 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include "data.h" 17 | 18 | extern int max_fps; 19 | extern int cheat; 20 | typedef struct PALETTE PALETTE; 21 | #define PAL_SIZE 256 22 | struct PALETTE { 23 | ALLEGRO_COLOR rgb[PAL_SIZE]; 24 | }; 25 | typedef ALLEGRO_FONT FONT; 26 | typedef ALLEGRO_SAMPLE SAMPLE; 27 | #define SCREEN_W (al_get_display_width(al_get_current_display())) 28 | #define SCREEN_H (al_get_display_height(al_get_current_display())) 29 | 30 | 31 | ALLEGRO_COLOR get_palette(int p); 32 | void set_palette(PALETTE *p); 33 | void fade_out(int divider); 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /demos/shooter/expl.h: -------------------------------------------------------------------------------- 1 | #ifndef EXPL_H_INCLUDED 2 | #define EXPL_H_INCLUDED 3 | 4 | #include "demo.h" 5 | 6 | /* explosion graphics */ 7 | #define EXPLODE_FLAG 100 8 | #define EXPLODE_FRAMES 64 9 | #define EXPLODE_SIZE 160 10 | 11 | extern RLE_SPRITE *explosion[EXPLODE_FRAMES]; 12 | 13 | void generate_explosions(void); 14 | void destroy_explosions(void); 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /demos/shooter/game.h: -------------------------------------------------------------------------------- 1 | #ifndef GAME_H_INCLUDED 2 | #define GAME_H_INCLUDED 3 | 4 | #include "demo.h" 5 | 6 | /* for doing stereo sound effects */ 7 | #define PAN(x) (((x) * 256) / SCREEN_W) 8 | #define SPEED_SHIFT 3 9 | 10 | extern int score; 11 | extern int player_x_pos; 12 | extern int player_hit; 13 | extern int ship_state; 14 | extern int skip_count; 15 | 16 | void play_game(void); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /demos/shooter/star.h: -------------------------------------------------------------------------------- 1 | #ifndef STAR_H_INCLUDED 2 | #define STAR_H_INCLUDED 3 | 4 | #include "demo.h" 5 | 6 | void init_starfield_2d(void); 7 | void starfield_2d(void); 8 | void scroll_stars(void); 9 | void draw_starfield_2d(void); 10 | 11 | void init_starfield_3d(void); 12 | void starfield_3d(void); 13 | void draw_starfield_3d(void); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /demos/shooter/title.h: -------------------------------------------------------------------------------- 1 | #ifndef TITLE_H_INCLUDED 2 | #define TITLE_H_INCLUDED 3 | 4 | #include "demo.h" 5 | 6 | int title_screen(void); 7 | void end_title(void); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /demos/skater/blender/level.blend.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/skater/blender/level.blend.gz -------------------------------------------------------------------------------- /demos/skater/blender/readme.txt: -------------------------------------------------------------------------------- 1 | To edit the level data of the Allegro demo game, we use the free and open source 2 | tool Blender. You can obtain it here: 3 | 4 | http://blender.org 5 | 6 | Instructions: 7 | 8 | 1) Place the file ademo_export.py into your Blender scripts folder. It is the 9 | export script which will convert from .blend format to the .txt format used by 10 | the demo game. Under unix, the path will be: 11 | 12 | ~/.blender/scripts/ademo_export.py 13 | 14 | 2) Load the .blend file in blender. Under unix, type this from the directory with 15 | the level.blend file: 16 | 17 | blender level.blend 18 | 19 | 3) Edit the level. In the menu, under 20 | 21 | Help -> Scripts Help Browser -> Export -> Allegro Demo Game Level 22 | 23 | you will find some useful tips. 24 | 25 | 4) Save the file (use compression before committing). Export it as .txt from the 26 | export menu, choosing Allegro Demo Game Level. 27 | 28 | 5) The new level.txt should appear in the game. 29 | -------------------------------------------------------------------------------- /demos/skater/data/audio/ding.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/skater/data/audio/ding.ogg -------------------------------------------------------------------------------- /demos/skater/data/audio/dooropen.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/skater/data/audio/dooropen.ogg -------------------------------------------------------------------------------- /demos/skater/data/audio/pop.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/skater/data/audio/pop.ogg -------------------------------------------------------------------------------- /demos/skater/data/audio/skating.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/skater/data/audio/skating.ogg -------------------------------------------------------------------------------- /demos/skater/data/audio/wave.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/skater/data/audio/wave.ogg -------------------------------------------------------------------------------- /demos/skater/data/graphics/bananas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/skater/data/graphics/bananas.png -------------------------------------------------------------------------------- /demos/skater/data/graphics/cherries.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/skater/data/graphics/cherries.png -------------------------------------------------------------------------------- /demos/skater/data/graphics/cloud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/skater/data/graphics/cloud.png -------------------------------------------------------------------------------- /demos/skater/data/graphics/dooropen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/skater/data/graphics/dooropen.png -------------------------------------------------------------------------------- /demos/skater/data/graphics/doorshut.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/skater/data/graphics/doorshut.png -------------------------------------------------------------------------------- /demos/skater/data/graphics/exitsign.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/skater/data/graphics/exitsign.png -------------------------------------------------------------------------------- /demos/skater/data/graphics/grass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/skater/data/graphics/grass.png -------------------------------------------------------------------------------- /demos/skater/data/graphics/ice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/skater/data/graphics/ice.png -------------------------------------------------------------------------------- /demos/skater/data/graphics/icecream.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/skater/data/graphics/icecream.png -------------------------------------------------------------------------------- /demos/skater/data/graphics/icetip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/skater/data/graphics/icetip.png -------------------------------------------------------------------------------- /demos/skater/data/graphics/orange.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/skater/data/graphics/orange.png -------------------------------------------------------------------------------- /demos/skater/data/graphics/skatefast.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/skater/data/graphics/skatefast.png -------------------------------------------------------------------------------- /demos/skater/data/graphics/skatemed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/skater/data/graphics/skatemed.png -------------------------------------------------------------------------------- /demos/skater/data/graphics/skater1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/skater/data/graphics/skater1.png -------------------------------------------------------------------------------- /demos/skater/data/graphics/skater2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/skater/data/graphics/skater2.png -------------------------------------------------------------------------------- /demos/skater/data/graphics/skater3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/skater/data/graphics/skater3.png -------------------------------------------------------------------------------- /demos/skater/data/graphics/skater4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/skater/data/graphics/skater4.png -------------------------------------------------------------------------------- /demos/skater/data/graphics/skateslow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/skater/data/graphics/skateslow.png -------------------------------------------------------------------------------- /demos/skater/data/graphics/soil.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/skater/data/graphics/soil.png -------------------------------------------------------------------------------- /demos/skater/data/graphics/sweet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/skater/data/graphics/sweet.png -------------------------------------------------------------------------------- /demos/skater/data/graphics/water.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/skater/data/graphics/water.png -------------------------------------------------------------------------------- /demos/skater/data/menu/back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/skater/data/menu/back.png -------------------------------------------------------------------------------- /demos/skater/data/menu/button.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/skater/data/menu/button.ogg -------------------------------------------------------------------------------- /demos/skater/data/menu/cancunsmall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/skater/data/menu/cancunsmall.png -------------------------------------------------------------------------------- /demos/skater/data/menu/endoflevel.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/skater/data/menu/endoflevel.ogg -------------------------------------------------------------------------------- /demos/skater/data/menu/intro_music.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/skater/data/menu/intro_music.ogg -------------------------------------------------------------------------------- /demos/skater/data/menu/logofont.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/skater/data/menu/logofont.png -------------------------------------------------------------------------------- /demos/skater/data/menu/menu_music.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/skater/data/menu/menu_music.ogg -------------------------------------------------------------------------------- /demos/skater/data/menu/skate2.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/skater/data/menu/skate2.ogg -------------------------------------------------------------------------------- /demos/skater/data/menu/welcome.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/skater/data/menu/welcome.ogg -------------------------------------------------------------------------------- /demos/skater/data/readme.txt: -------------------------------------------------------------------------------- 1 | = Introduction 2 | 3 | Allegro is a cross-platform library intended for use in computer games 4 | and other types of multimedia programming. It was initially conceived on 5 | the Atari ST, but that platform sadly died during childbirth. After a 6 | brief stay with Borland C, it was adopted by the fantastic djgpp 7 | compiler, where it grew to maturity. In the fullness of time it gave 8 | birth to children of its own, who went to live in such exotic locations 9 | as DirectX and the X Server, but the entire family is now back together 10 | again, living in harmony as a single portable entity. How about that for 11 | a mixture of metaphors? :-) 12 | 13 | A wide range of extension packages and add-on modules are also available, 14 | which can be found in the "Library Extensions" section of the Allegro.cc 15 | website, http://www.allegro.cc/. 16 | 17 | According to the Oxford Companion to Music, Allegro is the Italian for 18 | "quick, lively, bright". It is also a recursive acronym which stands for 19 | "Allegro Low Level Game Routines". 20 | 21 | 22 | -------------------------------------------------------------------------------- /demos/skater/data/thanks.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/demos/skater/data/thanks.txt -------------------------------------------------------------------------------- /demos/skater/src/anim.h: -------------------------------------------------------------------------------- 1 | #ifndef __DEMO_ANIM_H__ 2 | #define __DEMO_ANIM_H__ 3 | 4 | #include "global.h" 5 | 6 | struct Animation { 7 | ALLEGRO_BITMAP *Animation[3], *Still, *Slow, *Medium, *Fast, *CBitmap; 8 | ALLEGRO_SAMPLE_INSTANCE *SkateVoice; 9 | double TimeCount; 10 | }; 11 | 12 | extern ALLEGRO_BITMAP *GetCurrentBitmap(struct Animation *); 13 | extern void AdvanceAnimation(struct Animation *, double Distance, 14 | int OnPlatform); 15 | extern struct Animation *SeedPlayerAnimation(void); 16 | extern void FreePlayerAnimation(struct Animation *Anim); 17 | extern void PauseAnimation(struct Animation *Anim); 18 | extern void UnpauseAnimation(struct Animation *Anim); 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /demos/skater/src/background_scroller.h: -------------------------------------------------------------------------------- 1 | #ifndef __DEMO_BACK_SCROLLER__ 2 | #define __DEMO_BACK_SCROLLER__ 3 | 4 | #include 5 | 6 | void init_background(void); 7 | void update_background(void); 8 | void draw_background(void); 9 | 10 | #endif /* __DEMO_BACK_SCROLLER__ */ 11 | -------------------------------------------------------------------------------- /demos/skater/src/credits.h: -------------------------------------------------------------------------------- 1 | #ifndef __DEMO_CREDITS_H__ 2 | #define __DEMO_CREDITS_H__ 3 | 4 | void init_credits(void); 5 | void update_credits(void); 6 | void draw_credits(void); 7 | void destroy_credits(void); 8 | 9 | 10 | #endif /* __DEMO_CREDITS_H__ */ 11 | -------------------------------------------------------------------------------- /demos/skater/src/demodata.h: -------------------------------------------------------------------------------- 1 | #ifndef __DEMODATA_H__ 2 | #define __DEMODATA_H__ 3 | 4 | enum { 5 | DEMO_BMP_BACK, 6 | DEMO_FONT, 7 | DEMO_FONT_LOGO, 8 | DEMO_MIDI_INGAME, 9 | DEMO_MIDI_INTRO, 10 | DEMO_MIDI_MENU, 11 | DEMO_MIDI_SUCCESS, 12 | DEMO_SAMPLE_BUTTON, 13 | DEMO_SAMPLE_WELCOME, 14 | DEMO_SAMPLE_SKATING, 15 | DEMO_SAMPLE_WAVE, 16 | DEMO_SAMPLE_DING, 17 | DEMO_SAMPLE_DOOROPEN, 18 | DEMO_SAMPLE_POP, 19 | 20 | DEMO_BMP_BANANAS, 21 | DEMO_BMP_CHERRIES, 22 | DEMO_BMP_CLOUD, 23 | DEMO_BMP_DOOROPEN, 24 | DEMO_BMP_DOORSHUT, 25 | DEMO_BMP_EXITSIGN, 26 | DEMO_BMP_GRASS, 27 | DEMO_BMP_ICECREAM, 28 | DEMO_BMP_ICE, 29 | DEMO_BMP_ICETIP, 30 | DEMO_BMP_ORANGE, 31 | DEMO_BMP_SKATEFAST, 32 | DEMO_BMP_SKATEMED, 33 | DEMO_BMP_SKATER1, 34 | DEMO_BMP_SKATER2, 35 | DEMO_BMP_SKATER3, 36 | DEMO_BMP_SKATER4, 37 | DEMO_BMP_SKATESLOW, 38 | DEMO_BMP_SOIL, 39 | DEMO_BMP_SWEET, 40 | DEMO_BMP_WATER, 41 | 42 | DEMO_DATA_COUNT 43 | }; 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /demos/skater/src/game.h: -------------------------------------------------------------------------------- 1 | #ifndef __GAME_H__ 2 | #define __GAME_H__ 3 | 4 | /* functions for Miran's framework */ 5 | #include "gamestate.h" /* gamestate.h */ 6 | #include "global.h" 7 | extern void create_new_game(GAMESTATE * state); 8 | extern void create_continue_game(GAMESTATE * game); 9 | extern void destroy_game(void); 10 | 11 | extern char *load_game_resources(const char *data_path); 12 | extern void unload_game_resources(void); 13 | 14 | /* global game state defines and variables */ 15 | #define KEYFLAG_LEFT 0x01 16 | #define KEYFLAG_RIGHT 0x02 17 | #define KEYFLAG_JUMP 0x04 18 | #define KEYFLAG_JUMP_ISSUED 0x08 19 | #define KEYFLAG_JUMPING 0x10 20 | #define KEYFLAG_FLIP 0x20 21 | extern int KeyFlags; 22 | extern double Pusher; 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /demos/skater/src/gamepad.h: -------------------------------------------------------------------------------- 1 | #ifndef __DEMO_GAMEPAD_H__ 2 | #define __DEMO_GAMEPAD_H__ 3 | 4 | #include 5 | #include "vcontroller.h" 6 | 7 | VCONTROLLER *create_gamepad_controller(const char *config_path); 8 | void gamepad_event(ALLEGRO_EVENT *event); 9 | bool gamepad_button(void); 10 | 11 | #endif /* __DEMO_GAMEPAD_H__ */ 12 | -------------------------------------------------------------------------------- /demos/skater/src/keyboard.h: -------------------------------------------------------------------------------- 1 | #ifndef __DEMO_KEYBOARD_H__ 2 | #define __DEMO_KEYBOARD_H__ 3 | 4 | #include 5 | #include "vcontroller.h" 6 | 7 | VCONTROLLER *create_keyboard_controller(const char *config_path); 8 | 9 | bool key_down(int k); 10 | bool key_pressed(int k); 11 | void keyboard_event(ALLEGRO_EVENT *event); 12 | void keyboard_tick(void); 13 | int unicode_char(bool remove); 14 | 15 | #endif /* __DEMO_KEYBOARD_H__ */ 16 | -------------------------------------------------------------------------------- /demos/skater/src/level.h: -------------------------------------------------------------------------------- 1 | #ifndef __LEVEL_H 2 | #define __LEVEL_H 3 | 4 | #include 5 | #include "quadtree.h" 6 | 7 | extern struct Level *LoadLevel(char const *name, int collradius); 8 | extern void FreeLevel(struct Level *lvl); 9 | extern char *GetLevelError(void); 10 | 11 | extern void SetInitialState(struct Level *lvl); 12 | 13 | extern void DrawLevelBackground(struct Level *lev, 14 | double *pos); 15 | extern void DrawLevelForeground(struct Level *lev); 16 | 17 | /* level state struct, which stores the current state of the level - perfect for any future implementation 18 | of loading/saving games */ 19 | struct LevelState { 20 | int Length; 21 | uint32_t *Data; 22 | int DoorOpen; 23 | }; 24 | extern void SetDoorOpen(struct Level *Lvl); 25 | extern struct LevelState *BorrowState(struct Level *); 26 | extern void ReturnState(struct Level *, struct LevelState *); 27 | extern void FreeState(struct LevelState *); 28 | 29 | extern ALLEGRO_BITMAP *ObtainBitmap(const char *name); 30 | extern ALLEGRO_SAMPLE *ObtainSample(const char *name); 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /demos/skater/src/level_alloc.h: -------------------------------------------------------------------------------- 1 | #ifndef __LVLALLOC_H 2 | #define __LVLALLOC_H 3 | 4 | #include "level.h" 5 | 6 | extern struct Level *NewLevel(void); 7 | extern struct Material *NewMaterial(void); 8 | extern struct ObjectType *NewObjectType(void); 9 | extern struct Triangle *NewTriangle(void); 10 | extern struct Object *NewObject(void); 11 | extern struct Edge *NewEdge(void); 12 | extern struct Vertex *NewVertex(void); 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /demos/skater/src/level_file.h: -------------------------------------------------------------------------------- 1 | #ifndef __LVLFILE_H 2 | #define __LVLFILE_H 3 | 4 | #include "level.h" 5 | 6 | void LoadMaterials(struct Level *NewLev); 7 | void LoadVertices(struct Level *NewLev); 8 | void LoadTriangles(struct Level *NewLev, int radius); 9 | void LoadObjectTypes(struct Level *NewLev, int radius); 10 | void LoadObjects(struct Level *NewLev); 11 | void LoadStats(struct Level *NewLev); 12 | 13 | extern int GetNormal(struct Edge *e, double *v1, double *v2); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /demos/skater/src/menus.h: -------------------------------------------------------------------------------- 1 | #ifndef __DEMO_GAME_MENUS_H__ 2 | #define __DEMO_GAME_MENUS_H__ 3 | 4 | #include "gamestate.h" /* gamestate.h */ 5 | 6 | void create_main_menu(GAMESTATE * state); 7 | void create_options_menu(GAMESTATE * state); 8 | void create_gfx_menu(GAMESTATE * state); 9 | void create_sound_menu(GAMESTATE * state); 10 | void create_controls_menu(GAMESTATE * state); 11 | void create_misc_menu(GAMESTATE * state); 12 | void create_about_menu(GAMESTATE * state); 13 | void create_success_menu(GAMESTATE * state); 14 | void create_intro(GAMESTATE * state); 15 | 16 | void enable_continue_game(void); 17 | void disable_continue_game(void); 18 | 19 | #endif /* __DEMO_GAME_MENUS_H__ */ 20 | -------------------------------------------------------------------------------- /demos/skater/src/mouse.h: -------------------------------------------------------------------------------- 1 | #include "global.h" 2 | 3 | bool mouse_button_down(int b); 4 | bool mouse_button_pressed(int b); 5 | int mouse_x(void); 6 | int mouse_y(void); 7 | /* 'mouse_event' conflicts with winuser.h */ 8 | void mouse_handle_event(ALLEGRO_EVENT *event); 9 | void mouse_tick(void); 10 | -------------------------------------------------------------------------------- /demos/skater/src/music.h: -------------------------------------------------------------------------------- 1 | #ifndef __DEMO_MUSIC_PLAYER_H__ 2 | #define __DEMO_MUSIC_PLAYER_H__ 3 | 4 | #include "global.h" 5 | 6 | void play_music(int id, int loop); 7 | void stop_music(void); 8 | void play_sound(ALLEGRO_SAMPLE *s, int vol, int pan, int freq, int loop); 9 | void play_sound_id(int id, int vol, int pan, int freq, int loop); 10 | void set_music_volume(double v); 11 | void set_sound_volume(double v); 12 | 13 | #endif /* __DEMO_MUSIC_PLAYER_H__ */ 14 | -------------------------------------------------------------------------------- /demos/skater/src/physics.h: -------------------------------------------------------------------------------- 1 | #ifndef __PHYSICS_H 2 | #define __PHYSICS_H 3 | 4 | #include "anim.h" 5 | #include "level.h" 6 | 7 | extern struct QuadTreeNode *RunPhysics(struct Level *lvl, double *pos, 8 | double *vec, double TimeToGo, 9 | struct Animation *PAnim); 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /demos/skater/src/skater.c: -------------------------------------------------------------------------------- 1 | /* ______ ___ ___ 2 | * /\ _ \ /\_ \ /\_ \ 3 | * \ \ \L\ \\//\ \ \//\ \ __ __ _ __ ___ 4 | * \ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\/\`'__\/ __`\ 5 | * \ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ \ \//\ \L\ \ 6 | * \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/ 7 | * \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Demo game. 12 | * 13 | * By Miran Amon, Nick Davies, Elias Pschernig, Thomas Harte, 14 | * Jakub Wasilewski. 15 | * 16 | * See readme.txt for copyright information. 17 | */ 18 | 19 | #include 20 | #include "framework.h" 21 | 22 | 23 | int main(int argc, char **argv) 24 | { 25 | (void)argc; 26 | (void)argv; 27 | 28 | if (init_framework() != DEMO_OK) { 29 | return 1; 30 | } 31 | 32 | run_framework(); 33 | shutdown_framework(); 34 | 35 | return 0; 36 | } 37 | 38 | -------------------------------------------------------------------------------- /demos/skater/src/transition.h: -------------------------------------------------------------------------------- 1 | #ifndef __DEMO_TRANSITION_H__ 2 | #define __DEMO_TRANSITION_H__ 3 | 4 | #include 5 | #include "gamestate.h" /* gamestate.h */ 6 | 7 | 8 | typedef struct TRANSITION { 9 | GAMESTATE *from; 10 | GAMESTATE *to; 11 | double duration; 12 | double progress; 13 | ALLEGRO_BITMAP *from_bmp; 14 | ALLEGRO_BITMAP *to_bmp; 15 | } TRANSITION; 16 | 17 | 18 | TRANSITION *create_transition(GAMESTATE * from, GAMESTATE * to, 19 | double duration); 20 | void destroy_transition(TRANSITION * t); 21 | int update_transition(TRANSITION * t); 22 | void draw_transition(TRANSITION * t); 23 | 24 | #endif /* __DEMO_TRANSITION_H__ */ 25 | -------------------------------------------------------------------------------- /demos/skater/src/vcontroller.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "vcontroller.h" 4 | 5 | 6 | void destroy_vcontroller(VCONTROLLER * controller, const char *config_path) 7 | { 8 | if (controller == 0) { 9 | return; 10 | } 11 | 12 | /* save assignments */ 13 | if (controller->write_config != 0) { 14 | controller->write_config(controller, config_path); 15 | } 16 | 17 | /* free private data */ 18 | if (controller->private_data != 0) { 19 | free(controller->private_data); 20 | controller->private_data = 0; 21 | } 22 | 23 | /* free the actual pointer */ 24 | free(controller); 25 | controller = 0; 26 | } 27 | -------------------------------------------------------------------------------- /demos/speed/port.txt: -------------------------------------------------------------------------------- 1 | 2 | SPEED: Simultaneous Projections Employing an Ensemble of Displays. 3 | 4 | By Shawn Hargreaves, November 1999. 5 | 6 | Allegro 5 port by Peter Wang, April 2010 7 | 8 | 9 | This is a port of SPEED to Allegro 5. a4_aux.c contains a small 10 | "compatibility" layer so that the original code did not need to be 11 | disturbed too much. 12 | 13 | See speed.txt for the original information about the game. 14 | 15 | Have fun! 16 | 17 | 18 | 19 | User-visible changes from the original 20 | -------------------------------------- 21 | 22 | - The game now defaults to a 640x480 screen resolution if you do not 23 | supply any command line arguments. 24 | 25 | - The bpp (colour depth) command line option was removed. 26 | 27 | - The intersection points in the game grid only appear half as bright 28 | as in the original. I'm not sure why, unless it was a bug in Allegro 4.x. 29 | Admittedly the brighter pixels looked cooler. 30 | 31 | -------------------------------------------------------------------------------- /docs/scripts/aatree.h: -------------------------------------------------------------------------------- 1 | #ifndef __included_aatree_h 2 | #define __included_aatree_h 3 | 4 | typedef struct Aatree Aatree; 5 | struct Aatree { 6 | int level; 7 | Aatree *left; 8 | Aatree *right; 9 | char *key; 10 | char *value; 11 | }; 12 | 13 | extern Aatree aa_nil; 14 | 15 | Aatree *aa_singleton(const char *key, const char *value); 16 | Aatree *aa_insert(Aatree *T, const char *key, const char *value); 17 | const char *aa_search(const Aatree *T, const char *key); 18 | void aa_destroy(Aatree *T); 19 | 20 | #endif 21 | 22 | /* vim: set sts=3 sw=3 et: */ 23 | -------------------------------------------------------------------------------- /docs/scripts/make_doc.h: -------------------------------------------------------------------------------- 1 | #ifndef __included_make_doc_h 2 | #define __included_make_doc_h 3 | 4 | #include "dawk.h" 5 | 6 | extern dstr pandoc; 7 | extern dstr pandoc_options; 8 | extern dstr protos_file; 9 | extern dstr to_format; 10 | extern bool raise_sections; 11 | extern dstr tmp_preprocess_output; 12 | extern dstr tmp_pandoc_output; 13 | 14 | #define streq(a, b) (0 == strcmp((a), (b))) 15 | 16 | const char *lookup_prototype(const char *name); 17 | const char *lookup_source(const char *name); 18 | const char *lookup_example(const char *name); 19 | const char* example_source(dstr buffer, const char *file_name, const char *line_number); 20 | extern void call_pandoc(const char *input, const char *output, 21 | const char *extra_options); 22 | extern void make_single_doc(int argc, char *argv[]); 23 | extern void make_man_pages(int argc, char *argv[]); 24 | char *load_allegro5_cfg(void); 25 | 26 | #endif 27 | 28 | /* vim: set sts=3 sw=3 et: */ 29 | -------------------------------------------------------------------------------- /docs/scripts/make_html_refs.c: -------------------------------------------------------------------------------- 1 | /* 2 | * make_html_refs DOC-FILE... 3 | * 4 | * Generate a file containing (HTML-specific) link definitions for each API 5 | * entry found. e.g. if foo.txt contains "# API: bar" then we generate: 6 | * 7 | * [bar]: foo.html#bar 8 | */ 9 | 10 | #include 11 | #include "dawk.h" 12 | 13 | /* Replicate pandoc's function to create a label anchor from the section 14 | * name. 15 | */ 16 | static void replace_spaces(char *s) 17 | { 18 | while (*s) { 19 | if (*s == ' ') *s = '-'; 20 | s++; 21 | } 22 | } 23 | 24 | int main(int argc, char *argv[]) 25 | { 26 | dstr line; 27 | dstr file; 28 | const char *name; 29 | dstr sec_id; 30 | 31 | d_init(argc, argv); 32 | 33 | while (d_getline(line)) { 34 | if (d_match(line, "^#+( API:| ) *")) { 35 | d_basename(d_filename, ".html", file); 36 | name = d_after_match; 37 | d_tolower(name, sec_id); 38 | replace_spaces(sec_id); 39 | d_printf("[%s]: %s#%s\n", name, file, sec_id); 40 | } 41 | } 42 | 43 | return 0; 44 | } 45 | 46 | /* vim: set sts=3 sw=3 et: */ 47 | -------------------------------------------------------------------------------- /docs/src/custom_header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /docs/src/refman/allegro_version.tex.cmake: -------------------------------------------------------------------------------- 1 | @ALLEGRO_VERSION@ 2 | -------------------------------------------------------------------------------- /docs/src/refman/images/LINE_CAP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/docs/src/refman/images/LINE_CAP.png -------------------------------------------------------------------------------- /docs/src/refman/images/LINE_JOIN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/docs/src/refman/images/LINE_JOIN.png -------------------------------------------------------------------------------- /docs/src/refman/images/audio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/docs/src/refman/images/audio.png -------------------------------------------------------------------------------- /docs/src/refman/images/primitives1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/docs/src/refman/images/primitives1.png -------------------------------------------------------------------------------- /docs/src/refman/images/primitives2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/docs/src/refman/images/primitives2.png -------------------------------------------------------------------------------- /docs/src/refman/inc.z.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /docs/src/refman/main.txt: -------------------------------------------------------------------------------- 1 | # Main addon 2 | 3 | The `main` addon has no public API, but contains functionality to enable 4 | programs using Allegro to build and run without platform-specific changes. 5 | 6 | On platforms that require this functionality (e.g. OSX) this addon contains a 7 | C `main` function that invokes [al_run_main] with the user's own `main` 8 | function, where the user's `main` function has had its name mangled to 9 | something else. The file that defines the user `main` function must include 10 | the header file `allegro5/allegro.h`; that header performs the name mangling 11 | using some macros. 12 | 13 | If the user `main` function is defined in C++, then it must have the 14 | following signature for this addon to work: 15 | 16 | ~~~~c 17 | int main(int argc, char **argv) 18 | ~~~~ 19 | 20 | This addon does nothing on platforms that don't require its functionality, but 21 | you should keep it in mind in case you need to port to platforms that do 22 | require it. 23 | 24 | Link with allegro_main. 25 | -------------------------------------------------------------------------------- /docs/src/refman/misc.txt: -------------------------------------------------------------------------------- 1 | # Miscellaneous routines 2 | 3 | These functions are declared in the main Allegro header file: 4 | 5 | ~~~~c 6 | #include 7 | ~~~~ 8 | 9 | ## API: ALLEGRO_PI 10 | 11 | C99 compilers have no predefined value like M_PI for the constant π, but 12 | you can use this one instead. 13 | 14 | ## API: al_run_main 15 | 16 | This function is useful in cases where you don't have a main() function but 17 | want to run Allegro (mostly useful in a wrapper library). Under Windows and 18 | Linux this is no problem because you simply can call [al_install_system]. But 19 | some other system (like OSX) don't allow calling [al_install_system] in the main 20 | thread. al_run_main will know what to do in that case. 21 | 22 | The passed argc and argv will simply be passed on to user_main and the return 23 | value of user_main will be returned. 24 | -------------------------------------------------------------------------------- /docs/src/refman/title.txt: -------------------------------------------------------------------------------- 1 | % Allegro 5 reference manual 2 | -------------------------------------------------------------------------------- /examples/data/DejaVuSans.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/DejaVuSans.ttf -------------------------------------------------------------------------------- /examples/data/NotoColorEmoji_Animals.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/NotoColorEmoji_Animals.ttf -------------------------------------------------------------------------------- /examples/data/a4_font.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/a4_font.tga -------------------------------------------------------------------------------- /examples/data/alexlogo.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/alexlogo.bmp -------------------------------------------------------------------------------- /examples/data/alexlogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/alexlogo.png -------------------------------------------------------------------------------- /examples/data/allegro.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/allegro.pcx -------------------------------------------------------------------------------- /examples/data/bkg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/bkg.png -------------------------------------------------------------------------------- /examples/data/blue_box.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/blue_box.png -------------------------------------------------------------------------------- /examples/data/bmpfont.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/bmpfont.tga -------------------------------------------------------------------------------- /examples/data/cursor.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/cursor.tga -------------------------------------------------------------------------------- /examples/data/ex_physfs.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/ex_physfs.zip -------------------------------------------------------------------------------- /examples/data/ex_prim_shader_pixel.hlsl: -------------------------------------------------------------------------------- 1 | float3 light_position; 2 | float4 diffuse_color; 3 | float alpha; 4 | 5 | /* Ported from ex_prim_shader_pixel.glsl. See that file for the comments. */ 6 | 7 | #define AMBIENT_COLOR float4(1, 1, 1, 1) 8 | #define AMBIENT_INTENSITY 0.01 9 | #define SPECULAR_COLOR float4(1, 1, 1, 1) 10 | 11 | float4 ps_main(VS_OUTPUT Input) : COLOR0 12 | { 13 | float3 light_vector = light_position - Input.PixelPosition; 14 | float3 light_dir = normalize(light_vector); 15 | float3 normal_vector = normalize(Input.Normal); 16 | 17 | float reflectance = dot(light_dir, normal_vector); 18 | reflectance = max(reflectance, 0.0f); 19 | 20 | float specular_intensity = dot((2 * reflectance * normal_vector - light_dir), float3(0, 0, 1)); 21 | specular_intensity = max(0, specular_intensity); 22 | specular_intensity = pow(specular_intensity, alpha); 23 | 24 | float diffuse_intensity = reflectance * 10000.0 / dot(light_vector, light_vector); 25 | 26 | return AMBIENT_COLOR * AMBIENT_INTENSITY + diffuse_color * diffuse_intensity + SPECULAR_COLOR * specular_intensity; 27 | } 28 | -------------------------------------------------------------------------------- /examples/data/ex_prim_shader_vertex.glsl: -------------------------------------------------------------------------------- 1 | attribute vec4 al_pos; 2 | attribute vec3 al_user_attr_0; 3 | 4 | uniform mat4 al_projview_matrix; 5 | 6 | /* pixel_position and normal are used to compute the reflections in the pixel shader */ 7 | varying vec3 pixel_position; 8 | varying vec3 normal; 9 | 10 | void main() 11 | { 12 | pixel_position = al_pos.xyz; 13 | normal = al_user_attr_0; 14 | gl_Position = al_projview_matrix * al_pos; 15 | } 16 | -------------------------------------------------------------------------------- /examples/data/ex_prim_shader_vertex.hlsl: -------------------------------------------------------------------------------- 1 | struct VS_INPUT 2 | { 3 | float4 Position : POSITION0; 4 | float3 Normal : TEXCOORD2; 5 | }; 6 | struct VS_OUTPUT 7 | { 8 | float4 Position : POSITION0; 9 | /* pixel_position and normal are used to compute the reflections in the pixel shader */ 10 | float3 PixelPosition : TEXCOORD0; 11 | float3 Normal : TEXCOORD1; 12 | }; 13 | 14 | float4x4 al_projview_matrix; 15 | 16 | VS_OUTPUT vs_main(VS_INPUT Input) 17 | { 18 | VS_OUTPUT Output; 19 | 20 | Output.Position = mul(Input.Position, al_projview_matrix); 21 | Output.PixelPosition = Input.Position.xyz; 22 | Output.Normal = Input.Normal; 23 | return Output; 24 | } 25 | -------------------------------------------------------------------------------- /examples/data/ex_prim_wrap_pixel.glsl: -------------------------------------------------------------------------------- 1 | #ifdef GL_ES 2 | precision mediump float; 3 | #endif 4 | uniform sampler2D al_tex; 5 | uniform sampler2D tex2; 6 | varying vec2 varying_texcoord; 7 | void main() 8 | { 9 | gl_FragColor = texture2D(al_tex, varying_texcoord) * texture2D(tex2, varying_texcoord); 10 | } 11 | -------------------------------------------------------------------------------- /examples/data/ex_prim_wrap_pixel.hlsl: -------------------------------------------------------------------------------- 1 | texture al_tex; 2 | sampler2D s1 : register(s0) = sampler_state { 3 | texture = ; 4 | }; 5 | texture tex2; 6 | sampler2D s2 : register(s1) = sampler_state { 7 | texture = ; 8 | }; 9 | 10 | float4 ps_main(VS_OUTPUT Input) : COLOR0 11 | { 12 | return tex2D(s1, Input.TexCoord) * tex2D(s2, Input.TexCoord); 13 | } 14 | -------------------------------------------------------------------------------- /examples/data/ex_shader_multitex_pixel.glsl: -------------------------------------------------------------------------------- 1 | /* Simple fragment shader which uses the fractional texture coordinate to 2 | * look up the color of the second texture (scaled down by factor 100). 3 | */ 4 | #ifdef GL_ES 5 | precision mediump float; 6 | #endif 7 | uniform sampler2D al_tex; 8 | uniform sampler2D tex2; 9 | varying vec2 varying_texcoord; 10 | void main() 11 | { 12 | vec4 color = texture2D(tex2, fract(varying_texcoord * 100.0)); 13 | gl_FragColor = color * texture2D(al_tex, varying_texcoord); 14 | } 15 | -------------------------------------------------------------------------------- /examples/data/ex_shader_multitex_pixel.hlsl: -------------------------------------------------------------------------------- 1 | texture al_tex; 2 | sampler2D s1 = sampler_state { 3 | texture = ; 4 | }; 5 | texture tex2; 6 | sampler2D s2 = sampler_state { 7 | texture = ; 8 | }; 9 | 10 | float4 ps_main(VS_OUTPUT Input) : COLOR0 11 | { 12 | float4 color = tex2D(s2, frac(Input.TexCoord * 100)); 13 | return color * tex2D(s1, Input.TexCoord); 14 | } 15 | -------------------------------------------------------------------------------- /examples/data/ex_shader_palette_pixel.glsl: -------------------------------------------------------------------------------- 1 | #ifdef GL_ES 2 | precision mediump float; 3 | #endif 4 | 5 | uniform sampler2D al_tex; 6 | uniform sampler2D pal_tex; 7 | uniform float pal_set_1; 8 | uniform float pal_set_2; 9 | uniform float pal_interp; 10 | varying vec4 varying_color; 11 | varying vec2 varying_texcoord; 12 | 13 | void main() 14 | { 15 | float index = texture2D(al_tex, varying_texcoord).r; 16 | if (index == 0.0) discard; 17 | 18 | // Although the palette texture was defined to be 7 pixels tall, 19 | // allegro forces textures to be at least 16. 20 | vec4 col_1 = texture2D(pal_tex, vec2(index, pal_set_1 / 15.0)); 21 | vec4 col_2 = texture2D(pal_tex, vec2(index, pal_set_2 / 15.0)); 22 | gl_FragColor = vec4(mix(col_1, col_2, pal_interp).rgb, 1.0); 23 | } 24 | -------------------------------------------------------------------------------- /examples/data/ex_shader_pixel.glsl: -------------------------------------------------------------------------------- 1 | #ifdef GL_ES 2 | precision mediump float; 3 | #endif 4 | uniform sampler2D al_tex; 5 | uniform vec3 tint; 6 | varying vec4 varying_color; 7 | varying vec2 varying_texcoord; 8 | void main() 9 | { 10 | vec4 tmp = varying_color * texture2D(al_tex, varying_texcoord); 11 | tmp.r *= tint.r; 12 | tmp.g *= tint.g; 13 | tmp.b *= tint.b; 14 | gl_FragColor = tmp; 15 | } 16 | -------------------------------------------------------------------------------- /examples/data/ex_shader_pixel.hlsl: -------------------------------------------------------------------------------- 1 | texture al_tex; 2 | sampler2D s = sampler_state { 3 | texture = ; 4 | }; 5 | float3 tint; 6 | float4 ps_main(VS_OUTPUT Input) : COLOR0 7 | { 8 | float4 pixel = tex2D(s, Input.TexCoord.xy); 9 | pixel.r *= tint.r; 10 | pixel.g *= tint.g; 11 | pixel.b *= tint.b; 12 | return pixel; 13 | } 14 | -------------------------------------------------------------------------------- /examples/data/ex_shader_vertex.glsl: -------------------------------------------------------------------------------- 1 | attribute vec4 al_pos; 2 | attribute vec4 al_color; 3 | attribute vec2 al_texcoord; 4 | uniform mat4 al_projview_matrix; 5 | varying vec4 varying_color; 6 | varying vec2 varying_texcoord; 7 | void main() 8 | { 9 | varying_color = al_color; 10 | varying_texcoord = al_texcoord; 11 | gl_Position = al_projview_matrix * al_pos; 12 | } 13 | -------------------------------------------------------------------------------- /examples/data/ex_shader_vertex.hlsl: -------------------------------------------------------------------------------- 1 | struct VS_INPUT 2 | { 3 | float4 Position : POSITION0; 4 | float2 TexCoord : TEXCOORD0; 5 | float4 Color : TEXCOORD1; 6 | }; 7 | struct VS_OUTPUT 8 | { 9 | float4 Position : POSITION0; 10 | float4 Color : COLOR0; 11 | float2 TexCoord : TEXCOORD0; 12 | }; 13 | 14 | float4x4 al_projview_matrix; 15 | 16 | VS_OUTPUT vs_main(VS_INPUT Input) 17 | { 18 | VS_OUTPUT Output; 19 | Output.Position = mul(Input.Position, al_projview_matrix); 20 | Output.Color = Input.Color; 21 | Output.TexCoord = Input.TexCoord; 22 | return Output; 23 | } 24 | -------------------------------------------------------------------------------- /examples/data/ex_ttf.ini: -------------------------------------------------------------------------------- 1 | # There are problems with UTF-8 string literals under MSVC. 2 | # There appear to be two cases: 3 | # 1. It thinks our source file use the local file encoding. This mostly 4 | # works okay: the UTF-8 strings look like strings in an 8-bit charset and 5 | # will be passed through directly. But in other locales (e.g. East Asian) 6 | # it won't work. 7 | # 2. If we add a UTF-8 byte order mark (signature) then MSVC will recognise 8 | # the source file as UTF-8, but will then try to re-encode the strings 9 | # into the local charset. 10 | # So, unfortunately, for portability to MSVC, we have to externalise UTF-8 11 | # strings or write them out using escape codes. 12 | 13 | symbols1=■□▢▣▤▥▦▧▨▩▪▫▬▭▮▯▰▱ 14 | symbols2=▲△▴▵▶▷▸▹►▻▼▽▾▿◀◁◂◃◄◅◆◇◈◉◊ 15 | symbols3=○◌◍◎●◐◑◒◓◔◕◖◗◘◙ 16 | substr1=«Thís»|you 17 | substr2=should|‘ìş’ 18 | substr3=not|“cøünt”|see 19 | substr4=réstrïçteđ…|this. 20 | -------------------------------------------------------------------------------- /examples/data/exconfig.ini: -------------------------------------------------------------------------------- 1 | # The ini file consists of sections 2 | # which are marked by [ NAME OF SECTION ] 3 | [graphics] 4 | 5 | # mode: 6 | # width height bits per pixel 7 | mode= 640 480 8 8 | 9 | # Whether or not the program should run windowed 10 | windowed= TRUE 11 | 12 | 13 | # the actual content of the screen 14 | [content] 15 | 16 | # the header line 17 | headline= Welcome to Allegro 18 | # and it's color in RGB 19 | headercolor= 255 255 255 20 | 21 | # the image to display 22 | image= mysha.pcx 23 | 24 | # kind of image display 25 | # - 0 : stretch the image to size of screen 26 | # - 1 : center the image on screen 27 | # - 2 : tile the image on screen 28 | display= 0 29 | -------------------------------------------------------------------------------- /examples/data/fakeamp.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/fakeamp.bmp -------------------------------------------------------------------------------- /examples/data/fixed_font.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/fixed_font.tga -------------------------------------------------------------------------------- /examples/data/font.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/font.tga -------------------------------------------------------------------------------- /examples/data/gradient1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/gradient1.bmp -------------------------------------------------------------------------------- /examples/data/green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/green.png -------------------------------------------------------------------------------- /examples/data/haiku/air_0.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/haiku/air_0.ogg -------------------------------------------------------------------------------- /examples/data/haiku/air_1.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/haiku/air_1.ogg -------------------------------------------------------------------------------- /examples/data/haiku/air_2.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/haiku/air_2.ogg -------------------------------------------------------------------------------- /examples/data/haiku/air_3.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/haiku/air_3.ogg -------------------------------------------------------------------------------- /examples/data/haiku/air_4.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/haiku/air_4.ogg -------------------------------------------------------------------------------- /examples/data/haiku/air_5.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/haiku/air_5.ogg -------------------------------------------------------------------------------- /examples/data/haiku/air_6.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/haiku/air_6.ogg -------------------------------------------------------------------------------- /examples/data/haiku/air_7.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/haiku/air_7.ogg -------------------------------------------------------------------------------- /examples/data/haiku/air_effect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/haiku/air_effect.png -------------------------------------------------------------------------------- /examples/data/haiku/black_bead_opaque_A.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/haiku/black_bead_opaque_A.png -------------------------------------------------------------------------------- /examples/data/haiku/dropshadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/haiku/dropshadow.png -------------------------------------------------------------------------------- /examples/data/haiku/earth4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/haiku/earth4.png -------------------------------------------------------------------------------- /examples/data/haiku/earth_0.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/haiku/earth_0.ogg -------------------------------------------------------------------------------- /examples/data/haiku/earth_1.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/haiku/earth_1.ogg -------------------------------------------------------------------------------- /examples/data/haiku/earth_2.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/haiku/earth_2.ogg -------------------------------------------------------------------------------- /examples/data/haiku/earth_3.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/haiku/earth_3.ogg -------------------------------------------------------------------------------- /examples/data/haiku/earth_4.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/haiku/earth_4.ogg -------------------------------------------------------------------------------- /examples/data/haiku/earth_5.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/haiku/earth_5.ogg -------------------------------------------------------------------------------- /examples/data/haiku/earth_6.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/haiku/earth_6.ogg -------------------------------------------------------------------------------- /examples/data/haiku/earth_7.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/haiku/earth_7.ogg -------------------------------------------------------------------------------- /examples/data/haiku/fire.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/haiku/fire.png -------------------------------------------------------------------------------- /examples/data/haiku/fire_0.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/haiku/fire_0.ogg -------------------------------------------------------------------------------- /examples/data/haiku/fire_1.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/haiku/fire_1.ogg -------------------------------------------------------------------------------- /examples/data/haiku/fire_2.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/haiku/fire_2.ogg -------------------------------------------------------------------------------- /examples/data/haiku/fire_3.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/haiku/fire_3.ogg -------------------------------------------------------------------------------- /examples/data/haiku/fire_4.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/haiku/fire_4.ogg -------------------------------------------------------------------------------- /examples/data/haiku/fire_5.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/haiku/fire_5.ogg -------------------------------------------------------------------------------- /examples/data/haiku/fire_6.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/haiku/fire_6.ogg -------------------------------------------------------------------------------- /examples/data/haiku/fire_7.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/haiku/fire_7.ogg -------------------------------------------------------------------------------- /examples/data/haiku/flame2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/haiku/flame2.png -------------------------------------------------------------------------------- /examples/data/haiku/healthy_glow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/haiku/healthy_glow.png -------------------------------------------------------------------------------- /examples/data/haiku/main_flame2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/haiku/main_flame2.png -------------------------------------------------------------------------------- /examples/data/haiku/overlay_pretty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/haiku/overlay_pretty.png -------------------------------------------------------------------------------- /examples/data/haiku/select.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/haiku/select.ogg -------------------------------------------------------------------------------- /examples/data/haiku/water.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/haiku/water.png -------------------------------------------------------------------------------- /examples/data/haiku/water_0.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/haiku/water_0.ogg -------------------------------------------------------------------------------- /examples/data/haiku/water_1.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/haiku/water_1.ogg -------------------------------------------------------------------------------- /examples/data/haiku/water_2.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/haiku/water_2.ogg -------------------------------------------------------------------------------- /examples/data/haiku/water_3.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/haiku/water_3.ogg -------------------------------------------------------------------------------- /examples/data/haiku/water_4.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/haiku/water_4.ogg -------------------------------------------------------------------------------- /examples/data/haiku/water_5.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/haiku/water_5.ogg -------------------------------------------------------------------------------- /examples/data/haiku/water_6.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/haiku/water_6.ogg -------------------------------------------------------------------------------- /examples/data/haiku/water_7.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/haiku/water_7.ogg -------------------------------------------------------------------------------- /examples/data/haiku/water_droplets.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/haiku/water_droplets.png -------------------------------------------------------------------------------- /examples/data/haiku/wind3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/haiku/wind3.png -------------------------------------------------------------------------------- /examples/data/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/icon.png -------------------------------------------------------------------------------- /examples/data/icon.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/icon.tga -------------------------------------------------------------------------------- /examples/data/mask.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/mask.pcx -------------------------------------------------------------------------------- /examples/data/mysha.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/mysha.pcx -------------------------------------------------------------------------------- /examples/data/mysha.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/mysha.tga -------------------------------------------------------------------------------- /examples/data/mysha256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/mysha256x256.png -------------------------------------------------------------------------------- /examples/data/mysha256x256.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/mysha256x256.webp -------------------------------------------------------------------------------- /examples/data/mysha_dxt1.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/mysha_dxt1.dds -------------------------------------------------------------------------------- /examples/data/mysha_dxt3.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/mysha_dxt3.dds -------------------------------------------------------------------------------- /examples/data/mysha_dxt5.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/mysha_dxt5.dds -------------------------------------------------------------------------------- /examples/data/mysha_pal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/mysha_pal.png -------------------------------------------------------------------------------- /examples/data/obp.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/obp.jpg -------------------------------------------------------------------------------- /examples/data/planet.pcx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/planet.pcx -------------------------------------------------------------------------------- /examples/data/texture.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/texture.tga -------------------------------------------------------------------------------- /examples/data/texture2.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/texture2.tga -------------------------------------------------------------------------------- /examples/data/welcome.voc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/welcome.voc -------------------------------------------------------------------------------- /examples/data/welcome.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/examples/data/welcome.wav -------------------------------------------------------------------------------- /examples/ex_audio_devices.c: -------------------------------------------------------------------------------- 1 | /* This example lists the available audio devices. 2 | */ 3 | #define ALLEGRO_UNSTABLE 4 | 5 | #include 6 | #include "allegro5/allegro.h" 7 | #include "allegro5/allegro_audio.h" 8 | 9 | #include "common.c" 10 | 11 | int main(int argc, char **argv) 12 | { 13 | (void)argc; 14 | (void)argv; 15 | 16 | if (!al_init()) { 17 | abort_example("Could not init Allegro.\n"); 18 | } 19 | 20 | if (!al_install_audio()) { 21 | abort_example("Could not init sound!\n"); 22 | } 23 | 24 | open_log(); 25 | 26 | int count = al_get_num_audio_output_devices(); 27 | if (count < 0) { 28 | log_printf("Platform not supported.\n"); 29 | goto done; 30 | } 31 | 32 | for (int i = 0; i < count; i++) { 33 | const ALLEGRO_AUDIO_DEVICE* device = al_get_audio_output_device(i); 34 | log_printf("%s\n", al_get_audio_device_name(device)); 35 | } 36 | 37 | done: 38 | close_log(true); 39 | } 40 | -------------------------------------------------------------------------------- /include/allegro5/alcompat.h: -------------------------------------------------------------------------------- 1 | #ifndef __al_included_allegro5_alcompat_h 2 | #define __al_included_allegro5_alcompat_h 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | 9 | #define ALLEGRO_DST_COLOR (ALLEGRO_DEST_COLOR) 10 | #define ALLEGRO_INVERSE_DST_COLOR (ALLEGRO_INVERSE_DEST_COLOR) 11 | 12 | #define al_convert_bitmaps() (al_convert_memory_bitmaps()) 13 | #define al_current_time() (al_get_time()) 14 | #define al_event_queue_is_empty(q) (al_is_event_queue_empty(q)) 15 | #define al_toggle_display_flag(d, f, o) (al_set_display_flag((d), (f), (o))) 16 | 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | 22 | #endif 23 | 24 | /* vim: set sts=3 sw=3 et: */ 25 | -------------------------------------------------------------------------------- /include/allegro5/allegro5.h: -------------------------------------------------------------------------------- 1 | #include "allegro.h" 2 | 3 | -------------------------------------------------------------------------------- /include/allegro5/allegro_iphone_objc.h: -------------------------------------------------------------------------------- 1 | /* ______ ___ ___ 2 | * /\ _ \ /\_ \ /\_ \ 3 | * \ \ \L\ \\//\ \ \//\ \ __ __ _ __ ___ 4 | * \ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\/\`'__\/ __`\ 5 | * \ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ \ \//\ \L\ \ 6 | * \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/ 7 | * \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | */ 12 | 13 | 14 | #ifndef A5_IPHONE_ALLEGRO_OBJC_H 15 | #define A5_IPHONE_ALLEGRO_OBJC_H 16 | 17 | /* 18 | * Public Objective-C iPhone-related API 19 | */ 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | AL_FUNC(UIWindow *, al_iphone_get_window, (ALLEGRO_DISPLAY *d)); 26 | AL_FUNC(UIView *, al_iphone_get_view, (ALLEGRO_DISPLAY *d)); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | 32 | #endif /* A5_IPHONE_ALLEGRO_OBJC_H */ 33 | -------------------------------------------------------------------------------- /include/allegro5/allegro_osx.h: -------------------------------------------------------------------------------- 1 | /* ______ ___ ___ 2 | * /\ _ \ /\_ \ /\_ \ 3 | * \ \ \L\ \\//\ \ \//\ \ __ __ _ __ ___ 4 | * \ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\/\`'__\/ __`\ 5 | * \ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ \ \//\ \L\ \ 6 | * \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/ 7 | * \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | */ 12 | 13 | 14 | #ifndef A5_OSX_ALLEGRO_H 15 | #define A5_OSX_ALLEGRO_H 16 | 17 | /* 18 | * Public Objective-C OSX-related API 19 | */ 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | AL_FUNC(NSWindow *, al_osx_get_window, (ALLEGRO_DISPLAY *d)); 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | 30 | #endif /* A5_OSX_ALLEGRO_H */ 31 | -------------------------------------------------------------------------------- /include/allegro5/altime.h: -------------------------------------------------------------------------------- 1 | #ifndef __al_included_allegro5_altime_h 2 | #define __al_included_allegro5_altime_h 3 | 4 | #include "allegro5/base.h" 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | /* Type: ALLEGRO_TIMEOUT 11 | */ 12 | typedef struct ALLEGRO_TIMEOUT ALLEGRO_TIMEOUT; 13 | struct ALLEGRO_TIMEOUT { 14 | uint64_t __pad1__; 15 | uint64_t __pad2__; 16 | }; 17 | 18 | 19 | 20 | AL_FUNC(double, al_get_time, (void)); 21 | AL_FUNC(void, al_rest, (double seconds)); 22 | AL_FUNC(void, al_init_timeout, (ALLEGRO_TIMEOUT *timeout, double seconds)); 23 | 24 | 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /include/allegro5/cpu.h: -------------------------------------------------------------------------------- 1 | /* ______ ___ ___ 2 | * /\ _ \ /\_ \ /\_ \ 3 | * \ \ \L\ \\//\ \ \//\ \ __ __ _ __ ___ 4 | * \ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\/\`'__\/ __`\ 5 | * \ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ \ \//\ \L\ \ 6 | * \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/ 7 | * \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * CPU and system information handling. 12 | * 13 | * See readme.txt for copyright information. 14 | */ 15 | 16 | #ifndef __al_included_allegro5_cpu_h 17 | #define __al_included_allegro5_cpu_h 18 | 19 | #include "allegro5/base.h" 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | AL_FUNC(int, al_get_cpu_count, (void)); 26 | AL_FUNC(int, al_get_ram_size, (void)); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | 32 | #endif 33 | 34 | /* 35 | * Local Variables: 36 | * c-basic-offset: 3 37 | * indent-tabs-mode: nil 38 | * End: 39 | */ 40 | -------------------------------------------------------------------------------- /include/allegro5/drawing.h: -------------------------------------------------------------------------------- 1 | #ifndef __al_included_allegro5_drawing_h 2 | #define __al_included_allegro5_drawing_h 3 | 4 | #include "allegro5/color.h" 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | 11 | /* Drawing primitives */ 12 | AL_FUNC(void, al_clear_to_color, (ALLEGRO_COLOR color)); 13 | AL_FUNC(void, al_clear_depth_buffer, (float x)); 14 | AL_FUNC(void, al_draw_pixel, (float x, float y, ALLEGRO_COLOR color)); 15 | 16 | 17 | #ifdef __cplusplus 18 | } 19 | #endif 20 | 21 | #endif 22 | /* vim: set ts=8 sts=3 sw=3 et: */ 23 | -------------------------------------------------------------------------------- /include/allegro5/error.h: -------------------------------------------------------------------------------- 1 | /* ______ ___ ___ 2 | * /\ _ \ /\_ \ /\_ \ 3 | * \ \ \L\ \\//\ \ \//\ \ __ __ _ __ ___ 4 | * \ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\/\`'__\/ __`\ 5 | * \ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ \ \//\ \L\ \ 6 | * \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/ 7 | * \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Error handling. 12 | * 13 | * See readme.txt for copyright information. 14 | */ 15 | 16 | #ifndef __al_included_allegro5_error_h 17 | #define __al_included_allegro5_error_h 18 | 19 | #include "allegro5/base.h" 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | AL_FUNC(int, al_get_errno, (void)); 26 | AL_FUNC(void, al_set_errno, (int errnum)); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | 32 | #endif 33 | 34 | /* 35 | * Local Variables: 36 | * c-basic-offset: 3 37 | * indent-tabs-mode: nil 38 | * End: 39 | */ 40 | -------------------------------------------------------------------------------- /include/allegro5/fixed.h: -------------------------------------------------------------------------------- 1 | /* ______ ___ ___ 2 | * /\ _ \ /\_ \ /\_ \ 3 | * \ \ \L\ \\//\ \ \//\ \ __ __ _ __ ___ 4 | * \ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\/\`'__\/ __`\ 5 | * \ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ \ \//\ \L\ \ 6 | * \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/ 7 | * \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Fixed point type. 12 | * 13 | * By Shawn Hargreaves. 14 | * 15 | * See readme.txt for copyright information. 16 | */ 17 | 18 | 19 | #ifndef __al_included_allegro5_fixed_h 20 | #define __al_included_allegro5_fixed_h 21 | 22 | #include "allegro5/base.h" 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Type: al_fixed 29 | */ 30 | typedef int32_t al_fixed; 31 | 32 | AL_VAR(const al_fixed, al_fixtorad_r); 33 | AL_VAR(const al_fixed, al_radtofix_r); 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | 39 | #endif 40 | 41 | 42 | -------------------------------------------------------------------------------- /include/allegro5/fullscreen_mode.h: -------------------------------------------------------------------------------- 1 | #ifndef __al_included_allegro5_fullscreen_mode_h 2 | #define __al_included_allegro5_fullscreen_mode_h 3 | 4 | #include "allegro5/base.h" 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | 11 | /* Type: ALLEGRO_DISPLAY_MODE 12 | */ 13 | typedef struct ALLEGRO_DISPLAY_MODE 14 | { 15 | int width; 16 | int height; 17 | int format; 18 | int refresh_rate; 19 | } ALLEGRO_DISPLAY_MODE; 20 | 21 | 22 | AL_FUNC(int, al_get_num_display_modes, (void)); 23 | AL_FUNC(ALLEGRO_DISPLAY_MODE*, al_get_display_mode, (int index, 24 | ALLEGRO_DISPLAY_MODE *mode)); 25 | 26 | 27 | #ifdef __cplusplus 28 | } 29 | #endif 30 | 31 | #endif 32 | 33 | /* vim: set ts=8 sts=3 sw=3 et: */ 34 | -------------------------------------------------------------------------------- /include/allegro5/internal/aintern_aatree.h: -------------------------------------------------------------------------------- 1 | #ifndef __al_included_allegro5_aintern_aatree_h 2 | #define __al_included_allegro5_aintern_aatree_h 3 | 4 | typedef struct _AL_AATREE _AL_AATREE; 5 | 6 | struct _AL_AATREE 7 | { 8 | int level; 9 | _AL_AATREE *left; 10 | _AL_AATREE *right; 11 | const void *key; 12 | void *value; 13 | }; 14 | 15 | typedef int (*_al_cmp_t)(const void *a, const void *b); 16 | 17 | _AL_AATREE *_al_aa_insert(_AL_AATREE *T, const void *key, void *value, _al_cmp_t compare); 18 | void *_al_aa_search(const _AL_AATREE *T, const void *key, _al_cmp_t compare); 19 | _AL_AATREE *_al_aa_delete(_AL_AATREE *T, const void *key, _al_cmp_t compare, void **ret_value); 20 | void _al_aa_free(_AL_AATREE *T); 21 | 22 | #endif 23 | 24 | /* vim: set sts=3 sw=3 et: */ 25 | -------------------------------------------------------------------------------- /include/allegro5/internal/aintern_config.h: -------------------------------------------------------------------------------- 1 | #ifndef __al_included_allegro5_aintern_config_h 2 | #define __al_included_allegro5_aintern_config_h 3 | 4 | #include "allegro5/internal/aintern_aatree.h" 5 | 6 | struct ALLEGRO_CONFIG_ENTRY { 7 | bool is_comment; 8 | ALLEGRO_USTR *key; /* comment if is_comment is true */ 9 | ALLEGRO_USTR *value; 10 | ALLEGRO_CONFIG_ENTRY *prev, *next; 11 | }; 12 | 13 | struct ALLEGRO_CONFIG_SECTION { 14 | ALLEGRO_USTR *name; 15 | ALLEGRO_CONFIG_ENTRY *head; 16 | ALLEGRO_CONFIG_ENTRY *last; 17 | _AL_AATREE *tree; 18 | ALLEGRO_CONFIG_SECTION *prev, *next; 19 | }; 20 | 21 | struct ALLEGRO_CONFIG { 22 | ALLEGRO_CONFIG_SECTION *head; 23 | ALLEGRO_CONFIG_SECTION *last; 24 | _AL_AATREE *tree; 25 | }; 26 | 27 | 28 | #endif 29 | 30 | -------------------------------------------------------------------------------- /include/allegro5/internal/aintern_debug.h: -------------------------------------------------------------------------------- 1 | #ifndef __al_included_allegro5_aintern_debug_h 2 | #define __al_included_allegro5_aintern_debug_h 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | 9 | void _al_configure_logging(void); 10 | void _al_shutdown_logging(void); 11 | 12 | 13 | #ifdef __cplusplus 14 | } 15 | #endif 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /include/allegro5/internal/aintern_driver.h: -------------------------------------------------------------------------------- 1 | #ifndef __al_included_allegro5_internal_aintern_driver_h 2 | #define __al_included_allegro5_internal_aintern_driver_h 3 | 4 | 5 | typedef struct _AL_DRIVER_INFO /* info about a hardware driver */ 6 | { 7 | int id; /* integer ID */ 8 | void *driver; /* the driver structure */ 9 | int autodetect; /* set to allow autodetection */ 10 | } _AL_DRIVER_INFO; 11 | 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /include/allegro5/internal/aintern_exitfunc.h: -------------------------------------------------------------------------------- 1 | #ifndef __al_included_allegro5_aintern_exitfunc_h 2 | #define __al_included_allegro5_aintern_exitfunc_h 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | 9 | /* list of functions to call at program cleanup */ 10 | AL_FUNC(void, _al_add_exit_func, (AL_METHOD(void, func, (void)), const char *desc)); 11 | AL_FUNC(void, _al_remove_exit_func, (AL_METHOD(void, func, (void)))); 12 | AL_FUNC(void, _al_run_exit_funcs, (void)); 13 | 14 | 15 | #ifdef __cplusplus 16 | } 17 | #endif 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /include/allegro5/internal/aintern_file.h: -------------------------------------------------------------------------------- 1 | #ifndef __al_included_allegro5_aintern_file_h 2 | #define __al_included_allegro5_aintern_file_h 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | 9 | extern const ALLEGRO_FILE_INTERFACE _al_file_interface_stdio; 10 | 11 | #define ALLEGRO_UNGETC_SIZE 16 12 | 13 | struct ALLEGRO_FILE 14 | { 15 | const ALLEGRO_FILE_INTERFACE *vtable; 16 | void *userdata; 17 | unsigned char ungetc[ALLEGRO_UNGETC_SIZE]; 18 | int ungetc_len; 19 | }; 20 | 21 | #ifdef __cplusplus 22 | } 23 | #endif 24 | 25 | #endif 26 | 27 | /* vim: set sts=3 sw=3 et: */ 28 | -------------------------------------------------------------------------------- /include/allegro5/internal/aintern_float.h: -------------------------------------------------------------------------------- 1 | #ifndef __al_included_allegro5_aintern_float_h 2 | #define __al_included_allegro5_aintern_float_h 3 | 4 | /* This file used to contain a tricky function that sped up float->int 5 | * conversions on x86 machines when the SSE instruction CVTTSS2SI wasn't 6 | * available (or when SSE wasn't enabled in the compiler). 7 | * 8 | * However, it performed rounding instead of truncating like (int)f, which 9 | * did cause problems. If an alternative is found we could define this 10 | * macro once again. 11 | */ 12 | #define _al_fast_float_to_int(f) ((int)(f)) 13 | 14 | #endif 15 | 16 | /* vim: set sts=3 sw=3 et: */ 17 | -------------------------------------------------------------------------------- /include/allegro5/internal/aintern_fshook.h: -------------------------------------------------------------------------------- 1 | /* ______ ___ ___ 2 | * /\ _ \ /\_ \ /\_ \ 3 | * \ \ \L\ \\//\ \ \//\ \ __ __ _ __ ___ 4 | * \ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\/\`'__\/ __`\ 5 | * \ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ \ \//\ \L\ \ 6 | * \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/ 7 | * \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Internal File System Hook support. 12 | * 13 | * See readme.txt for copyright information. 14 | */ 15 | 16 | #ifndef __al_included_allegro5_aintern_fshook_h 17 | #define __al_included_allegro5_aintern_fshook_h 18 | 19 | #include "allegro5/base.h" 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | 26 | extern struct ALLEGRO_FS_INTERFACE _al_fs_interface_stdio; 27 | 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /include/allegro5/internal/aintern_memblit.h: -------------------------------------------------------------------------------- 1 | #ifndef __al_included_allegro5_aintern_memblit_h 2 | #define __al_included_allegro5_aintern_memblit_h 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | 9 | void _al_draw_bitmap_region_memory(ALLEGRO_BITMAP *bitmap, 10 | ALLEGRO_COLOR tint, 11 | int sx, int sy, int sw, int sh, int dx, int dy, int flags); 12 | 13 | 14 | #ifdef __cplusplus 15 | } 16 | #endif 17 | 18 | #endif 19 | 20 | /* vim: set sts=3 sw=3 et: */ 21 | -------------------------------------------------------------------------------- /include/allegro5/internal/aintern_memdraw.h: -------------------------------------------------------------------------------- 1 | #ifndef __al_included_allegro5_aintern_memdraw_h 2 | #define __al_included_allegro5_aintern_memdraw_h 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | 9 | void _al_clear_bitmap_by_locking(ALLEGRO_BITMAP *bitmap, ALLEGRO_COLOR *color); 10 | void _al_draw_pixel_memory(ALLEGRO_BITMAP *bmp, float x, float y, ALLEGRO_COLOR *color); 11 | 12 | 13 | #ifdef __cplusplus 14 | } 15 | #endif 16 | 17 | #endif 18 | 19 | /* vim: set sts=3 sw=3 et: */ 20 | -------------------------------------------------------------------------------- /include/allegro5/internal/aintern_osxclipboard.h: -------------------------------------------------------------------------------- 1 | #ifndef __al_included_allegro5_aintern_osxclipboard_h 2 | #define __al_included_allegro5_aintern_osxclipboard_h 3 | 4 | 5 | #include "allegro5/internal/aintern_display.h" 6 | 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | void _al_osx_add_clipboard_functions(ALLEGRO_DISPLAY_INTERFACE *vt); 13 | 14 | #ifdef __cplusplus 15 | } 16 | #endif 17 | 18 | 19 | #endif 20 | 21 | /* vim: set sts=3 sw=3 et: */ 22 | -------------------------------------------------------------------------------- /include/allegro5/internal/aintern_path.h: -------------------------------------------------------------------------------- 1 | #ifndef __al_included_allegro5_aintern_path_h 2 | #define __al_included_allegro5_aintern_path_h 3 | 4 | struct ALLEGRO_PATH { 5 | ALLEGRO_USTR *drive; 6 | ALLEGRO_USTR *filename; 7 | _AL_VECTOR segments; /* vector of ALLEGRO_USTR * */ 8 | ALLEGRO_USTR *basename; 9 | ALLEGRO_USTR *full_string; 10 | }; 11 | 12 | #endif 13 | 14 | /* vim: set sts=3 sw=3 et: */ 15 | -------------------------------------------------------------------------------- /include/allegro5/internal/aintern_timer.h: -------------------------------------------------------------------------------- 1 | #ifndef __al_included_allegro5_aintern_timer_h 2 | #define __al_included_allegro5_aintern_timer_h 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | void _al_init_timers(void); 9 | int _al_get_active_timers_count(void); 10 | double _al_timer_thread_handle_tick(double interval); 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | 16 | #endif 17 | 18 | /* vim: set sts=3 sw=3 et: */ 19 | -------------------------------------------------------------------------------- /include/allegro5/internal/aintern_tls.h: -------------------------------------------------------------------------------- 1 | #ifndef __al_included_allegro5_aintern_tls_h 2 | #define __al_included_allegro5_aintern_tls_h 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | 9 | void _al_tls_init_once(void); 10 | void _al_reinitialize_tls_values(void); 11 | 12 | int *_al_tls_get_dtor_owner_count(void); 13 | 14 | 15 | #ifdef __cplusplus 16 | } 17 | #endif 18 | 19 | #endif 20 | 21 | /* vim: set ts=8 sts=3 sw=3 et: */ 22 | -------------------------------------------------------------------------------- /include/allegro5/internal/aintern_touch_input.h: -------------------------------------------------------------------------------- 1 | #ifndef __al_included_allegro5_aintern_touch_input_h 2 | #define __al_included_allegro5_aintern_touch_input_h 3 | 4 | #include "allegro5/internal/aintern_driver.h" 5 | #include "allegro5/internal/aintern_events.h" 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | 12 | typedef struct ALLEGRO_TOUCH_INPUT_DRIVER 13 | { 14 | int id; 15 | AL_METHOD(bool, init_touch_input, (void)); 16 | AL_METHOD(void, exit_touch_input, (void)); 17 | AL_METHOD(ALLEGRO_TOUCH_INPUT*, get_touch_input, (void)); 18 | AL_METHOD(void, get_touch_input_state, (ALLEGRO_TOUCH_INPUT_STATE *ret_state)); 19 | AL_METHOD(void, set_mouse_emulation_mode, (int mode)); 20 | AL_METHOD(int, get_mouse_emulation_mode, (void)); 21 | } ALLEGRO_TOUCH_INPUT_DRIVER; 22 | 23 | 24 | struct ALLEGRO_TOUCH_INPUT 25 | { 26 | ALLEGRO_EVENT_SOURCE es; 27 | ALLEGRO_EVENT_SOURCE mouse_emulation_es; 28 | int mouse_emulation_mode; 29 | }; 30 | 31 | extern _AL_DRIVER_INFO _al_touch_input_driver_list[]; 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /include/allegro5/internal/aintern_transform.h: -------------------------------------------------------------------------------- 1 | #ifndef __al_included_allegro5_aintern_transform_h 2 | #define __al_included_allegro5_aintern_transform_h 3 | 4 | 5 | bool _al_transform_is_translation(const ALLEGRO_TRANSFORM* trans, 6 | float *dx, float *dy); 7 | 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /include/allegro5/internal/aintern_tri_soft.h: -------------------------------------------------------------------------------- 1 | #ifndef __al_included_allegro5_aintern_tri_soft_h 2 | #define __al_included_allegro5_aintern_tri_soft_h 3 | 4 | struct ALLEGRO_BITMAP; 5 | 6 | /* Duplicated in allegro_primitives.h */ 7 | #ifndef _ALLEGRO_VERTEX_DEFINED 8 | #define _ALLEGRO_VERTEX_DEFINED 9 | 10 | typedef struct ALLEGRO_VERTEX ALLEGRO_VERTEX; 11 | 12 | struct ALLEGRO_VERTEX { 13 | float x, y, z; 14 | float u, v; 15 | ALLEGRO_COLOR color; 16 | }; 17 | #endif 18 | 19 | AL_FUNC(void, _al_triangle_2d, (ALLEGRO_BITMAP* texture, ALLEGRO_VERTEX* v1, ALLEGRO_VERTEX* v2, ALLEGRO_VERTEX* v3)); 20 | AL_FUNC(void, _al_draw_soft_triangle, ( 21 | ALLEGRO_VERTEX* v1, ALLEGRO_VERTEX* v2, ALLEGRO_VERTEX* v3, uintptr_t state, 22 | void (*init)(uintptr_t, ALLEGRO_VERTEX*, ALLEGRO_VERTEX*, ALLEGRO_VERTEX*), 23 | void (*first)(uintptr_t, int, int, int, int), 24 | void (*step)(uintptr_t, int), 25 | void (*draw)(uintptr_t, int, int, int))); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /include/allegro5/internal/aintern_wclipboard.h: -------------------------------------------------------------------------------- 1 | #ifndef __al_included_allegro5_aintern_wclipboard_h 2 | #define __al_included_allegro5_aintern_wclipboard_h 3 | 4 | 5 | #include "allegro5/internal/aintern_display.h" 6 | 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | void _al_win_add_clipboard_functions(ALLEGRO_DISPLAY_INTERFACE *vt); 13 | 14 | #ifdef __cplusplus 15 | } 16 | #endif 17 | 18 | 19 | #endif 20 | 21 | /* vim: set sts=3 sw=3 et: */ 22 | -------------------------------------------------------------------------------- /include/allegro5/internal/aintern_wjoyall.h: -------------------------------------------------------------------------------- 1 | #ifndef __al_included_allegro_aintern_wjoydxnu_h 2 | #define __al_included_allegro_aintern_wjoydxnu_h 3 | 4 | 5 | /** Part of the Windows joystick wrapper driver 6 | * types are shared here for use by the haptic susbystem. */ 7 | 8 | typedef struct ALLEGRO_JOYSTICK_WINDOWS_ALL { 9 | ALLEGRO_JOYSTICK parent; /* must be first */ 10 | bool active; 11 | int index; 12 | ALLEGRO_JOYSTICK * handle; 13 | ALLEGRO_JOYSTICK_DRIVER * driver; 14 | } ALLEGRO_JOYSTICK_WINDOWS_ALL; 15 | 16 | #endif 17 | 18 | /* vim: set sts=3 sw=3 et: */ 19 | -------------------------------------------------------------------------------- /include/allegro5/internal/aintern_x.h: -------------------------------------------------------------------------------- 1 | #ifndef __al_included_allegro5_aintern_x_h 2 | #define __al_included_allegro5_aintern_x_h 3 | 4 | #include 5 | 6 | typedef struct ALLEGRO_SYSTEM_XGLX ALLEGRO_SYSTEM_XGLX; 7 | typedef struct ALLEGRO_DISPLAY_XGLX ALLEGRO_DISPLAY_XGLX; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /include/allegro5/internal/aintern_xclipboard.h: -------------------------------------------------------------------------------- 1 | #ifndef __al_included_allegro5_aintern_xclipboard_h 2 | #define __al_included_allegro5_aintern_xclipboard_h 3 | 4 | 5 | #include "allegro5/internal/aintern_display.h" 6 | 7 | void _al_xwin_display_selection_notify(ALLEGRO_DISPLAY *display, XSelectionEvent *xselection); 8 | void _al_xwin_display_selection_request(ALLEGRO_DISPLAY *display, XSelectionRequestEvent *xselectionrequest); 9 | void _al_xwin_add_clipboard_functions(ALLEGRO_DISPLAY_INTERFACE *vt); 10 | 11 | #endif 12 | 13 | /* vim: set sts=3 sw=3 et: */ 14 | -------------------------------------------------------------------------------- /include/allegro5/internal/aintern_xcursor.h: -------------------------------------------------------------------------------- 1 | #ifndef __al_included_allegro5_aintern_xcursor_h 2 | #define __al_included_allegro5_aintern_xcursor_h 3 | 4 | #ifdef ALLEGRO_XWINDOWS_WITH_XCURSOR 5 | #include 6 | #endif 7 | 8 | #include "allegro5/internal/aintern_display.h" 9 | 10 | typedef struct ALLEGRO_MOUSE_CURSOR_XWIN ALLEGRO_MOUSE_CURSOR_XWIN; 11 | 12 | struct ALLEGRO_MOUSE_CURSOR_XWIN 13 | { 14 | Cursor cursor; 15 | }; 16 | 17 | ALLEGRO_MOUSE_CURSOR *_al_xwin_create_mouse_cursor(ALLEGRO_BITMAP *bmp, 18 | int x_focus, int y_focus); 19 | void _al_xwin_destroy_mouse_cursor(ALLEGRO_MOUSE_CURSOR *cursor); 20 | void _al_xwin_add_cursor_functions(ALLEGRO_DISPLAY_INTERFACE *vt); 21 | 22 | #endif 23 | 24 | /* vim: set sts=3 sw=3 et: */ 25 | -------------------------------------------------------------------------------- /include/allegro5/internal/aintern_xdnd.h: -------------------------------------------------------------------------------- 1 | #ifndef __al_included_allegro5_aintern_xdnd_h 2 | #define __al_included_allegro5_aintern_xdnd_h 3 | 4 | typedef struct { 5 | Atom XdndEnter; 6 | Atom XdndPosition; 7 | Atom XdndStatus; 8 | Atom XdndTypeList; 9 | Atom XdndActionCopy; 10 | Atom XdndDrop; 11 | Atom XdndFinished; 12 | Atom XdndSelection; 13 | Atom XdndLeave; 14 | Atom PRIMARY; 15 | 16 | Atom xdnd_req; 17 | Window xdnd_source; 18 | } DndInfo; 19 | 20 | void _al_display_xglx_init_dnd_atoms(ALLEGRO_SYSTEM_XGLX *s); 21 | void _al_xwin_accept_drag_and_drop(ALLEGRO_DISPLAY *display, bool accept); 22 | bool _al_display_xglx_handle_drag_and_drop(ALLEGRO_SYSTEM_XGLX *s, 23 | ALLEGRO_DISPLAY_XGLX *allegro_display, XEvent *event); 24 | bool _al_display_xglx_handle_drag_and_drop_selection(ALLEGRO_SYSTEM_XGLX *s, 25 | ALLEGRO_DISPLAY_XGLX *allegro_display, XEvent *xevent); 26 | 27 | #endif 28 | 29 | /* vim: set sts=3 sw=3 et: */ 30 | -------------------------------------------------------------------------------- /include/allegro5/internal/aintern_xevents.h: -------------------------------------------------------------------------------- 1 | #ifndef __al_included_allegro5_aintern_xevents_h 2 | #define __al_included_allegro5_aintern_xevents_h 3 | 4 | #include "allegro5/internal/aintern_thread.h" 5 | 6 | void _al_xwin_background_thread(_AL_THREAD *self, void *arg); 7 | 8 | void _al_display_xglx_closebutton(ALLEGRO_DISPLAY *d, XEvent *xevent); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /include/allegro5/internal/aintern_xglx_config.h: -------------------------------------------------------------------------------- 1 | #ifndef __al_included_allegro5_aintern_xglx_h 2 | #define __al_included_allegro5_aintern_xglx_h 3 | 4 | #include "allegro5/internal/aintern_x.h" 5 | 6 | void _al_xglx_config_select_visual(ALLEGRO_DISPLAY_XGLX *glx); 7 | bool _al_xglx_config_create_context(ALLEGRO_DISPLAY_XGLX *glx); 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /include/allegro5/internal/aintern_xkeyboard.h: -------------------------------------------------------------------------------- 1 | #ifndef __al_included_allegro5_aintern_xkeyboard_h 2 | #define __al_included_allegro5_aintern_xkeyboard_h 3 | 4 | #include "allegro5/internal/aintern_keyboard.h" 5 | 6 | ALLEGRO_KEYBOARD_DRIVER *_al_xwin_keyboard_driver(void); 7 | void _al_xwin_keyboard_handler(XKeyEvent *event, ALLEGRO_DISPLAY *display); 8 | void _al_xwin_keyboard_switch_handler(ALLEGRO_DISPLAY *display, bool focus_in); 9 | 10 | #endif 11 | 12 | /* vim: set sts=3 sw=3 et: */ 13 | -------------------------------------------------------------------------------- /include/allegro5/internal/aintern_xmouse.h: -------------------------------------------------------------------------------- 1 | #ifndef __al_included_allegro5_aintern_xmouse_h 2 | #define __al_included_allegro5_aintern_xmouse_h 3 | 4 | #include "allegro5/internal/aintern_mouse.h" 5 | 6 | ALLEGRO_MOUSE_DRIVER *_al_xwin_mouse_driver(void); 7 | void _al_xwin_mouse_button_press_handler(int button, ALLEGRO_DISPLAY *display); 8 | void _al_xwin_mouse_button_release_handler(int button, ALLEGRO_DISPLAY *d); 9 | void _al_xwin_mouse_motion_notify_handler(int x, int y, ALLEGRO_DISPLAY *d); 10 | void _al_xwin_mouse_switch_handler(ALLEGRO_DISPLAY *display, 11 | const XCrossingEvent *event); 12 | bool _al_xwin_grab_mouse(ALLEGRO_DISPLAY *display); 13 | bool _al_xwin_ungrab_mouse(void); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /include/allegro5/internal/aintern_xtouch.h: -------------------------------------------------------------------------------- 1 | #ifndef __al_included_allegro5_aintern_xtouch_h 2 | #define __al_included_allegro5_aintern_xtouch_h 3 | 4 | #include "allegro5/internal/aintern_touch_input.h" 5 | 6 | void _al_x_handle_touch_event(ALLEGRO_SYSTEM_XGLX *s, ALLEGRO_DISPLAY_XGLX *d, XEvent *e); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /include/allegro5/internal/aintern_xwindow.h: -------------------------------------------------------------------------------- 1 | #ifndef __al_included_allegro5_aintern_xwindow_h 2 | #define __al_included_allegro5_aintern_xwindow_h 3 | 4 | void _al_xwin_set_size_hints(ALLEGRO_DISPLAY *d, int x_off, int y_off); 5 | void _al_xwin_reset_size_hints(ALLEGRO_DISPLAY *d); 6 | void _al_xwin_set_fullscreen_window(ALLEGRO_DISPLAY *display, int value); 7 | void _al_xwin_set_above(ALLEGRO_DISPLAY *display, int value); 8 | void _al_xwin_set_frame(ALLEGRO_DISPLAY *display, bool frame_on); 9 | void _al_xwin_set_icons(ALLEGRO_DISPLAY *d, 10 | int num_icons, ALLEGRO_BITMAP *bitmaps[]); 11 | void _al_xwin_maximize(ALLEGRO_DISPLAY *d, bool maximized); 12 | void _al_xwin_check_maximized(ALLEGRO_DISPLAY *display); 13 | void _al_xwin_get_borders(ALLEGRO_DISPLAY *display); 14 | 15 | #endif 16 | 17 | /* vim: set sts=3 sw=3 et: */ 18 | -------------------------------------------------------------------------------- /include/allegro5/monitor.h: -------------------------------------------------------------------------------- 1 | #ifndef __al_included_allegro5_monitor_h 2 | #define __al_included_allegro5_monitor_h 3 | 4 | #include "allegro5/base.h" 5 | 6 | #ifdef __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | 11 | /* Type: ALLEGRO_MONITOR_INFO 12 | */ 13 | typedef struct ALLEGRO_MONITOR_INFO 14 | { 15 | int x1; 16 | int y1; 17 | int x2; 18 | int y2; 19 | } ALLEGRO_MONITOR_INFO; 20 | 21 | enum { 22 | ALLEGRO_DEFAULT_DISPLAY_ADAPTER = -1 23 | }; 24 | 25 | AL_FUNC(int, al_get_num_video_adapters, (void)); 26 | AL_FUNC(bool, al_get_monitor_info, (int adapter, ALLEGRO_MONITOR_INFO *info)); 27 | AL_FUNC(int, al_get_monitor_dpi, (int adapter)); 28 | #if defined(ALLEGRO_UNSTABLE) || defined(ALLEGRO_INTERNAL_UNSTABLE) || defined(ALLEGRO_SRC) 29 | AL_FUNC(int, al_get_monitor_refresh_rate, (int adapter)); 30 | #endif 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | 36 | #endif 37 | 38 | /* vim: set ts=8 sts=3 sw=3 et: */ 39 | -------------------------------------------------------------------------------- /include/allegro5/platform/aintiphone.h: -------------------------------------------------------------------------------- 1 | #ifndef __al_included_allegro5_aintiphone_h 2 | #define __al_included_allegro5_aintiphone_h 3 | 4 | #include "allegro5/internal/aintern_display.h" 5 | #include "allegro5/internal/aintern_bitmap.h" 6 | #include "allegro5/internal/aintern_system.h" 7 | #include "allegro5/system.h" 8 | #include "allegro5/platform/aintunix.h" 9 | 10 | ALLEGRO_DISPLAY_INTERFACE *_al_display_iphone(void); 11 | ALLEGRO_SYSTEM_INTERFACE *_al_system_iphone(void); 12 | ALLEGRO_PATH *_al_iphone_get_path(int id); 13 | 14 | #endif 15 | 16 | -------------------------------------------------------------------------------- /include/allegro5/platform/aintwiz.h: -------------------------------------------------------------------------------- 1 | #ifndef __al_included_allegro5_aintwiz_h 2 | #define __al_included_allegro5_aintwiz_h 3 | 4 | #include "allegro5/internal/aintern_display.h" 5 | #include "allegro5/internal/aintern_bitmap.h" 6 | #include "allegro5/internal/aintern_system.h" 7 | #include "allegro5/system.h" 8 | #include "allegro5/platform/aintunix.h" 9 | 10 | ALLEGRO_DISPLAY_INTERFACE *_al_display_gp2xwiz_opengl_driver(void); 11 | ALLEGRO_DISPLAY_INTERFACE *_al_display_gp2xwiz_framebuffer_driver(void); 12 | ALLEGRO_SYSTEM_INTERFACE *_al_system_gp2xwiz_driver(void); 13 | ALLEGRO_BITMAP_INTERFACE *_al_bitmap_gp2xwiz_driver(void); 14 | 15 | #endif 16 | 17 | -------------------------------------------------------------------------------- /include/allegro5/platform/aintxglx.h: -------------------------------------------------------------------------------- 1 | #ifndef __al_included_allegro5_aintxglx_h 2 | #define __al_included_allegro5_aintxglx_h 3 | 4 | ALLEGRO_DISPLAY_INTERFACE *_al_display_xglx_driver(void); 5 | ALLEGRO_SYSTEM_INTERFACE *_al_system_xglx_driver(void); 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /include/allegro5/platform/alandroid.h: -------------------------------------------------------------------------------- 1 | /* ______ ___ ___ 2 | * /\ _ \ /\_ \ /\_ \ 3 | * \ \ \L\ \\//\ \ \//\ \ __ __ _ __ ___ 4 | * \ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\/\`'__\/ __`\ 5 | * \ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ \ \//\ \L\ \ 6 | * \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/ 7 | * \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Android-specific header defines. 12 | * 13 | * See readme.txt for copyright information. 14 | */ 15 | 16 | 17 | #ifndef ALLEGRO_ANDROID 18 | #error bad include 19 | #endif 20 | 21 | #include 22 | 23 | #ifdef __cplusplus 24 | extern "C" int main(int argc, char ** argv); 25 | #else 26 | extern int main(int argc, char ** argv); 27 | #endif 28 | 29 | /* Nothing left */ 30 | -------------------------------------------------------------------------------- /include/allegro5/platform/alandroidcfg.h: -------------------------------------------------------------------------------- 1 | /* ______ ___ ___ 2 | * /\ _ \ /\_ \ /\_ \ 3 | * \ \ \L\ \\//\ \ \//\ \ __ __ _ __ ___ 4 | * \ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\/\`'__\/ __`\ 5 | * \ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ \ \//\ \L\ \ 6 | * \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/ 7 | * \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Configuration defines for use on Android platforms. 12 | * 13 | * By Thomas Fjellstrom. 14 | * 15 | * See readme.txt for copyright information. 16 | */ 17 | 18 | /* Describe this platform. */ 19 | #define ALLEGRO_PLATFORM_STR "Android" 20 | 21 | #define ALLEGRO_EXTRA_HEADER "allegro5/platform/alandroid.h" 22 | #define ALLEGRO_INTERNAL_HEADER "allegro5/platform/aintandroid.h" 23 | #define ALLEGRO_INTERNAL_THREAD_HEADER "allegro5/platform/aintuthr.h" 24 | 25 | #define ALLEGRO_EXCLUDE_GLX 26 | -------------------------------------------------------------------------------- /include/allegro5/platform/aliphone.h: -------------------------------------------------------------------------------- 1 | #ifndef ALLEGRO_IPHONE 2 | #error bad include 3 | #endif 4 | 5 | #ifndef ALLEGRO_LIB_BUILD 6 | #define ALLEGRO_MAGIC_MAIN 7 | #define main _al_mangled_main 8 | #ifdef __cplusplus 9 | extern "C" int _al_mangled_main(int, char **); 10 | #endif 11 | #endif 12 | -------------------------------------------------------------------------------- /include/allegro5/platform/allegro_sdl_config.h: -------------------------------------------------------------------------------- 1 | #define ALLEGRO_PLATFORM_STR "SDL" 2 | 3 | #define ALLEGRO_INTERNAL_HEADER "allegro5/platform/allegro_internal_sdl.h" 4 | #define ALLEGRO_INTERNAL_THREAD_HEADER "allegro5/platform/allegro_sdl_thread.h" 5 | 6 | // FIXME: remove once we don't use Unix specifics anymore 7 | #include 8 | #include 9 | -------------------------------------------------------------------------------- /include/allegro5/platform/alraspberrypi.h: -------------------------------------------------------------------------------- 1 | /* ______ ___ ___ 2 | * /\ _ \ /\_ \ /\_ \ 3 | * \ \ \L\ \\//\ \ \//\ \ __ __ _ __ ___ 4 | * \ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\/\`'__\/ __`\ 5 | * \ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ \ \//\ \L\ \ 6 | * \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/ 7 | * \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Raspberry Pi-specific header defines. 12 | * 13 | * See readme.txt for copyright information. 14 | */ 15 | 16 | 17 | #ifndef ALLEGRO_RASPBERRYPI 18 | #error bad include 19 | #endif 20 | 21 | #ifdef ALLEGRO_LIB_BUILD 22 | #include "allegro5/platform/aintuthr.h" 23 | #endif 24 | 25 | /* Nothing left */ 26 | -------------------------------------------------------------------------------- /include/allegro5/platform/alunix.h: -------------------------------------------------------------------------------- 1 | /* ______ ___ ___ 2 | * /\ _ \ /\_ \ /\_ \ 3 | * \ \ \L\ \\//\ \ \//\ \ __ __ _ __ ___ 4 | * \ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\/\`'__\/ __`\ 5 | * \ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ \ \//\ \L\ \ 6 | * \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/ 7 | * \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Unix-specific header defines. 12 | * 13 | * See readme.txt for copyright information. 14 | */ 15 | 16 | 17 | #ifndef ALLEGRO_UNIX 18 | #error bad include 19 | #endif 20 | 21 | 22 | /* Nothing left */ 23 | 24 | -------------------------------------------------------------------------------- /include/allegro5/platform/alwiz.h: -------------------------------------------------------------------------------- 1 | /* ______ ___ ___ 2 | * /\ _ \ /\_ \ /\_ \ 3 | * \ \ \L\ \\//\ \ \//\ \ __ __ _ __ ___ 4 | * \ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\/\`'__\/ __`\ 5 | * \ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ \ \//\ \L\ \ 6 | * \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/ 7 | * \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Wiz-specific header defines. 12 | * 13 | * By Trent Gamblin 14 | * 15 | * See readme.txt for copyright information. 16 | */ 17 | 18 | 19 | #ifndef ALLEGRO_GP2XWIZ 20 | #error bad include 21 | #endif 22 | 23 | #define AL_JOY_TYPE_GP2XWIZ AL_ID('W','I','Z',' ') 24 | 25 | AL_VAR(struct ALLEGRO_JOYSTICK_DRIVER, _al_joydrv_gp2xwiz); 26 | 27 | #define _AL_JOYSTICK_DRIVER_GP2XWIZ \ 28 | { AL_JOY_TYPE_GP2XWIZ, &_al_joydrv_gp2xwiz, true }, 29 | 30 | 31 | #include "allegro5/platform/alunix.h" 32 | 33 | -------------------------------------------------------------------------------- /indent.pro: -------------------------------------------------------------------------------- 1 | -kr -nce -ss -ncs -i3 -cli3 -nut -bls -l80 2 | -T ALLEGRO_BITMAP 3 | -T PACKFILE 4 | -T BMPINFOHEADER 5 | -T PalEntry 6 | -------------------------------------------------------------------------------- /misc/Allegro5_iOS/allegro5/internal/aintern_image_cfg.h: -------------------------------------------------------------------------------- 1 | /* #define ALLEGRO_CFG_WANT_NATIVE_IMAGE_LOADER */ 2 | 3 | /* which libraries are present and needed? */ 4 | /* #undef ALLEGRO_CFG_IIO_HAVE_GDIPLUS */ 5 | /* #undef ALLEGRO_CFG_IIO_HAVE_GDIPLUS_LOWERCASE_H */ 6 | /* #undef ALLEGRO_CFG_IIO_HAVE_ANDROID */ 7 | /* #undef ALLEGRO_CFG_IIO_HAVE_PNG */ 8 | /* #undef ALLEGRO_CFG_IIO_HAVE_JPG */ 9 | 10 | #define ALLEGRO_CFG_IIO_HAVE_PNG 11 | 12 | /* which formats are supported and wanted? */ 13 | #define ALLEGRO_CFG_IIO_SUPPORT_PNG 14 | //#define ALLEGRO_CFG_IIO_SUPPORT_JPG 15 | -------------------------------------------------------------------------------- /misc/Allegro5_iOS/allegro5/internal/aintern_ttf_cfg.h: -------------------------------------------------------------------------------- 1 | /* #undef ALLEGRO_CFG_TTF_FREETYPE */ 2 | -------------------------------------------------------------------------------- /misc/allegro.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=${prefix} 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | version=@ALLEGRO_VERSION@ 6 | suffix=@lib_type@@lib_linkage@ 7 | versuffix=@versuffix@ 8 | 9 | Name: allegro 10 | Description: Allegro game programming library 11 | Version: ${version} 12 | Libs: -L${libdir} -lallegro${suffix} 13 | Libs.private: @link_with@ 14 | Cflags: -I${includedir} 15 | -------------------------------------------------------------------------------- /misc/allegro_acodec.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=${prefix} 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | version=@ALLEGRO_VERSION@ 6 | suffix=@lib_type@@lib_linkage@ 7 | versuffix=@versuffix@ 8 | 9 | Name: allegro_acodec 10 | Description: Allegro game programming library, audio codec addon 11 | Version: ${version} 12 | Libs: -L${libdir} -lallegro_acodec${suffix} 13 | Libs.private: @link_with@ 14 | Requires: allegro_audio${suffix}-${versuffix} >= ${version} 15 | Cflags: -I${includedir} 16 | -------------------------------------------------------------------------------- /misc/allegro_audio.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=${prefix} 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | version=@ALLEGRO_VERSION@ 6 | suffix=@lib_type@@lib_linkage@ 7 | versuffix=@versuffix@ 8 | 9 | Name: allegro_audio 10 | Description: Allegro game programming library, audio addon 11 | Version: ${version} 12 | Libs: -L${libdir} -lallegro_audio${suffix} 13 | Libs.private: @link_with@ 14 | Requires: allegro${suffix}-${versuffix} >= ${version} 15 | Cflags: -I${includedir} 16 | -------------------------------------------------------------------------------- /misc/allegro_color.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=${prefix} 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | version=@ALLEGRO_VERSION@ 6 | suffix=@lib_type@@lib_linkage@ 7 | versuffix=@versuffix@ 8 | 9 | Name: allegro_color 10 | Description: Allegro game programming library, colors addon 11 | Version: ${version} 12 | Libs: -L${libdir} -lallegro_color${suffix} 13 | Libs.private: @link_with@ 14 | Requires: allegro${suffix}-${versuffix} >= ${version} 15 | Cflags: -I${includedir} 16 | -------------------------------------------------------------------------------- /misc/allegro_dialog.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=${prefix} 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | version=@ALLEGRO_VERSION@ 6 | suffix=@lib_type@@lib_linkage@ 7 | versuffix=@versuffix@ 8 | 9 | Name: allegro_dialog 10 | Description: Allegro game programming library, native dialog addon 11 | Version: ${version} 12 | Libs: -L${libdir} -lallegro_dialog${suffix} 13 | Libs.private: @link_with@ 14 | Requires: allegro${suffix}-${versuffix} >= ${version} 15 | Cflags: -I${includedir} 16 | -------------------------------------------------------------------------------- /misc/allegro_font.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=${prefix} 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | version=@ALLEGRO_VERSION@ 6 | suffix=@lib_type@@lib_linkage@ 7 | versuffix=@versuffix@ 8 | 9 | Name: allegro_font 10 | Description: Allegro game programming library, font addon 11 | Version: ${version} 12 | Libs: -L${libdir} -lallegro_font${suffix} 13 | Libs.private: @link_with@ 14 | Requires: allegro${suffix}-${versuffix} >= ${version} 15 | Cflags: -I${includedir} 16 | -------------------------------------------------------------------------------- /misc/allegro_image.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=${prefix} 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | version=@ALLEGRO_VERSION@ 6 | suffix=@lib_type@@lib_linkage@ 7 | versuffix=@versuffix@ 8 | 9 | Name: allegro_image 10 | Description: Allegro game programming library, image I/O addon 11 | Version: ${version} 12 | Libs: -L${libdir} -lallegro_image${suffix} 13 | Libs.private: @link_with@ 14 | Requires: allegro${suffix}-${versuffix} >= ${version} 15 | Cflags: -I${includedir} 16 | -------------------------------------------------------------------------------- /misc/allegro_main.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=${prefix} 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | version=@ALLEGRO_VERSION@ 6 | suffix=@lib_type@@lib_linkage@ 7 | versuffix=@versuffix@ 8 | 9 | Name: allegro_main 10 | Description: Allegro game programming library, magic main addon 11 | Version: ${version} 12 | Libs: -L${libdir} -lallegro_main${suffix} 13 | Libs.private: @link_with@ 14 | Requires: allegro${suffix}-${versuffix} >= ${version} 15 | Cflags: -I${includedir} 16 | -------------------------------------------------------------------------------- /misc/allegro_memfile.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=${prefix} 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | version=@ALLEGRO_VERSION@ 6 | suffix=@lib_type@@lib_linkage@ 7 | versuffix=@versuffix@ 8 | 9 | Name: allegro_memfile 10 | Description: Allegro game programming library, memory files addon 11 | Version: ${version} 12 | Libs: -L${libdir} -lallegro_memfile${suffix} 13 | Libs.private: @link_with@ 14 | Requires: allegro${suffix}-${versuffix} >= ${version} 15 | Cflags: -I${includedir} 16 | -------------------------------------------------------------------------------- /misc/allegro_monolith.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=${prefix} 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | version=@ALLEGRO_VERSION@ 6 | suffix=@lib_type@@lib_linkage@ 7 | versuffix=@versuffix@ 8 | 9 | Name: allegro_monolith 10 | Description: Allegro game programming library (all addons included) 11 | Version: ${version} 12 | Libs: -L${libdir} -lallegro_monolith${suffix} 13 | Libs.private: @link_with@ 14 | Cflags: -I${includedir} 15 | -------------------------------------------------------------------------------- /misc/allegro_physfs.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=${prefix} 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | version=@ALLEGRO_VERSION@ 6 | suffix=@lib_type@@lib_linkage@ 7 | versuffix=@versuffix@ 8 | 9 | Name: allegro_physfs 10 | Description: Allegro game programming library, PhysicsFS addon 11 | Version: ${version} 12 | Libs: -L${libdir} -lallegro_physfs${suffix} 13 | Libs.private: @link_with@ 14 | Requires: allegro${suffix}-${versuffix} >= ${version} 15 | Cflags: -I${includedir} 16 | -------------------------------------------------------------------------------- /misc/allegro_primitives.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=${prefix} 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | version=@ALLEGRO_VERSION@ 6 | suffix=@lib_type@@lib_linkage@ 7 | versuffix=@versuffix@ 8 | 9 | Name: allegro_primitives 10 | Description: Allegro game programming library, primitives addon 11 | Version: ${version} 12 | Libs: -L${libdir} -lallegro_primitives${suffix} 13 | Libs.private: @link_with@ 14 | Requires: allegro${suffix}-${versuffix} >= ${version} 15 | Cflags: -I${includedir} 16 | -------------------------------------------------------------------------------- /misc/allegro_ttf.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=${prefix} 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | version=@ALLEGRO_VERSION@ 6 | suffix=@lib_type@@lib_linkage@ 7 | versuffix=@versuffix@ 8 | 9 | Name: allegro_ttf 10 | Description: Allegro game programming library, TrueType fonts addon 11 | Version: ${version} 12 | Libs: -L${libdir} -lallegro_ttf${suffix} 13 | Libs.private: @link_with@ 14 | Requires: allegro_font${suffix}-${versuffix} >= ${version} 15 | Cflags: -I${includedir} 16 | -------------------------------------------------------------------------------- /misc/allegro_video.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=${prefix} 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | version=@ALLEGRO_VERSION@ 6 | suffix=@lib_type@@lib_linkage@ 7 | versuffix=@versuffix@ 8 | 9 | Name: allegro_video 10 | Description: Allegro game programming library, video player addon 11 | Version: ${version} 12 | Libs: -L${libdir} -lallegro_video${suffix} 13 | Libs.private: @link_with@ 14 | Requires: allegro_audio${suffix}-${versuffix} >= ${version} 15 | Cflags: -I${includedir} 16 | -------------------------------------------------------------------------------- /misc/askq.c: -------------------------------------------------------------------------------- 1 | /* 2 | * ASKQ - asks a yes/no question, returning an exit status to the caller. 3 | * This is used by the msvcmake installation batch file. 4 | */ 5 | 6 | 7 | #include 8 | #include 9 | 10 | 11 | 12 | int main(int argc, char *argv[]) 13 | { 14 | int i; 15 | 16 | puts("\n"); 17 | 18 | for (i=1; i 1) 20 | putc(' ', stdout); 21 | 22 | puts(argv[i]); 23 | } 24 | 25 | puts("? [y/n] "); 26 | 27 | for (;;) { 28 | i = getc(stdin); 29 | 30 | if ((tolower(i) == 'y') || (tolower(i) == 'n')) { 31 | putc(i, stdout); 32 | puts("\n\n"); 33 | return (tolower(i) == 'y') ? 0 : 1; 34 | } 35 | else 36 | putc(7, stdout); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /misc/create_release_archives.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | ver=$1 5 | 6 | if [ -z "$ver" ] 7 | then 8 | echo "Please pass a version." 9 | exit 1 10 | fi 11 | 12 | if git show $ver -- 2>&1 | grep -q 'fatal' 13 | then 14 | echo "$ver is not a valid revision." 15 | exit 1 16 | fi 17 | 18 | export LC_ALL=en_US 19 | 20 | repo=$PWD 21 | tmpdir=$( mktemp -d ) 22 | 23 | git archive --format=tar --prefix=allegro/ ${ver} | ( cd $tmpdir && tar xf - ) 24 | 25 | ( cd "$tmpdir/allegro" 26 | for file in $( find -type f -printf '%P\n' ) 27 | do 28 | echo $file 29 | commit=$( cd $repo && git rev-list ${ver} "$file" | head -n 1 ) 30 | mtime=$( cd $repo && git show --pretty=format:%ai $commit | head -n 1) 31 | touch -d "$mtime" "$file" 32 | done 33 | ) 34 | 35 | ( cd "$tmpdir/allegro" 36 | ./misc/zipup.sh allegro-$ver.zip 37 | mv .dist/*.* .. 38 | ) 39 | 40 | (cd "$tmpdir" 41 | rm -rf allegro 42 | unzip allegro-$ver.zip 43 | ./allegro/misc/mkunixdists.sh allegro-$ver.zip 44 | ) 45 | 46 | mv "$tmpdir"/*.* ./ 47 | 48 | rm -rf -- "$tmpdir" 49 | 50 | echo "Done and done!" 51 | -------------------------------------------------------------------------------- /misc/dtou.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Convert CR/LF line endings to LF line endings, preserving timestamps and 4 | # permissions on the file. 5 | # 6 | 7 | with_unix_tools() { 8 | for file in "$@" 9 | do 10 | echo "$file" 11 | 12 | tmpfile=`dirname "$file"`/__dtou_tmp.$RANDOM || exit 1 13 | trap 'rm -f "$tmpfile"' 1 2 3 13 15 14 | 15 | # We go through a slightly convoluted sequence of commands in order to 16 | # preserve both the timestamp and permissions on the file. 17 | { 18 | tr -d '\015' < "$file" > "$tmpfile" && 19 | touch -r "$file" "$tmpfile" && 20 | cat "$tmpfile" > "$file" && 21 | touch -r "$tmpfile" "$file" && 22 | rm -f "$tmpfile" 23 | } || exit 1 24 | done 25 | } 26 | 27 | with_cygwin() { 28 | for file in "$@" 29 | do 30 | dos2unix $file || exit 1 31 | done 32 | } 33 | 34 | if test -z "$1" 35 | then 36 | echo "$0 filename" 37 | exit 38 | fi 39 | 40 | if test "$ALLEGRO_USE_CYGWIN" = "1" 41 | then 42 | with_cygwin "$@" 43 | else 44 | with_unix_tools "$@" 45 | fi 46 | 47 | # vi: sts=3 sw=3 et 48 | -------------------------------------------------------------------------------- /misc/gl_mkalias.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # This script creates '*_ext_alias.h' from '*_ext_api.h' in 3 | # include/allegro5/opengl/GLext/ dir 4 | 5 | prefix="glx wgl gl" 6 | 7 | for name in $prefix; do 8 | src="include/allegro5/opengl/GLext/"$name"_ext_api.h" 9 | out="include/allegro5/opengl/GLext/"$name"_ext_alias.h" 10 | prfx=`echo $name | sed 's/glx/glX/'` 11 | cat $src | sed -e '/^[ ]*#/!s/[ ]//g' | awk -F"," "BEGIN{print\"/*Automatically generated by gl_mkalias.sh DO NOT EDIT!*/\"} 12 | {if (\$0 ~ /^AGL_API/) printf \"#define $prfx%s _al_$prfx%s\n\",\$2,\$2; 13 | else print \$0}" > $out 14 | done 15 | -------------------------------------------------------------------------------- /misc/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/misc/icon.png -------------------------------------------------------------------------------- /misc/make_icon.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | """Generate the icon.c file used for the default icon. 3 | 4 | Usage: 5 | 6 | make_icon.py in_file.png out_file.inc 7 | """ 8 | 9 | import numpy as np 10 | import PIL.Image 11 | import sys 12 | 13 | image = np.array(PIL.Image.open(sys.argv[1]).convert("RGBA")) 14 | 15 | with open(sys.argv[2], "w") as f: 16 | f.write("/* Generated using make_icon.py */\n") 17 | f.write(f"#define ICON_WIDTH {image.shape[1]}\n") 18 | f.write(f"#define ICON_HEIGHT {image.shape[0]}\n") 19 | f.write("static uint32_t icon_data[] = {\n") 20 | for i, row in enumerate(image): 21 | for j, col in enumerate(row): 22 | # Premultiply alpha. 23 | col = col.astype(np.float32) / 255. 24 | col = (col * col[-1] * 255.).astype(np.uint32) 25 | col = (col[0] << 24) + (col[1] << 16) + (col[2] << 8) + col[3] 26 | f.write(f"{col:#010x}") 27 | if i + 1 < image.shape[0] or j + 1 < image.shape[1]: 28 | f.write(",") 29 | f.write("\n") 30 | f.write("};\n") 31 | -------------------------------------------------------------------------------- /misc/regenerate.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Recreate the automatically generated source files in the tree. 3 | 4 | set -e 5 | set -x 6 | 7 | misc/make_scanline_drawers.py | \ 8 | indent -kr -i3 -l0 > src/scanline_drawers.inc 9 | 10 | misc/make_converters.py 11 | 12 | misc/gl_mkalias.sh 13 | 14 | misc/make_mixer_helpers.py | \ 15 | indent -kr -i3 -l0 > addons/audio/kcm_mixer_helpers.inc 16 | 17 | # vim: set sts=3 sw=3 et: 18 | -------------------------------------------------------------------------------- /misc/utod.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Convert LF line endings to CR/LF line endings, preserving timestamps and 4 | # permissions on the file. 5 | # 6 | 7 | with_unix_tools() { 8 | for file in "$@" 9 | do 10 | echo "$file" 11 | 12 | tmpfile=`dirname "$file"`/__dtou_tmp.$RANDOM || exit 1 13 | trap 'rm -f "$tmpfile"' 1 2 3 13 15 14 | 15 | # We go through a slightly convoluted sequence of commands in order to 16 | # preserve both the timestamp and permissions on the file. 17 | { 18 | perl -p -e "s/([^\r]|^)\n/\1\r\n/" "$file" > "$tmpfile" && 19 | touch -r "$file" "$tmpfile" && 20 | cat "$tmpfile" > "$file" && 21 | touch -r "$tmpfile" "$file" && 22 | rm -f "$tmpfile" 23 | } || exit 1 24 | done 25 | } 26 | 27 | with_cygwin() { 28 | for file in "$@" 29 | do 30 | unix2dos $file || exit 1 31 | done 32 | } 33 | 34 | if test -z "$1" 35 | then 36 | echo "$0 filename" 37 | exit 38 | fi 39 | 40 | if test "$ALLEGRO_USE_CYGWIN" = "1" 41 | then 42 | with_cygwin "$@" 43 | else 44 | with_unix_tools "$@" 45 | fi 46 | 47 | # vi: sts=3 sw=3 et 48 | -------------------------------------------------------------------------------- /src/android/android_sensors.c: -------------------------------------------------------------------------------- 1 | /* ______ ___ ___ 2 | * /\ _ \ /\_ \ /\_ \ 3 | * \ \ \L\ \\//\ \ \//\ \ __ __ _ __ ___ 4 | * \ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\/\`'__\/ __`\ 5 | * \ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ \ \//\ \L\ \ 6 | * \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/ 7 | * \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Android Java/JNI system driver 12 | * 13 | * By Thomas Fjellstrom. 14 | */ 15 | 16 | #include "allegro5/allegro.h" 17 | #include "allegro5/allegro_android.h" 18 | #include "allegro5/internal/aintern_android.h" 19 | 20 | #include 21 | 22 | JNI_FUNC(void, Sensors, nativeOnAccel, (JNIEnv *env, jobject obj, jint id, 23 | jfloat x, jfloat y, jfloat z)) 24 | { 25 | (void)env; 26 | (void)obj; 27 | (void)id; 28 | _al_android_generate_accelerometer_event(x, y, z); 29 | } 30 | 31 | /* vim: set sts=3 sw=3 et: */ 32 | -------------------------------------------------------------------------------- /src/iphone/ViewController.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | struct ALLEGRO_DISPLAY; 4 | 5 | @interface ViewController : UIViewController 6 | { 7 | @public 8 | int adapter; 9 | struct ALLEGRO_DISPLAY *display; 10 | } 11 | 12 | - (void) create_view; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /src/iphone/allegroAppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #include 3 | #import "ViewController.h" 4 | 5 | struct ALLEGRO_DISPLAY_IPHONE_EXTRA { 6 | bool failed; 7 | ViewController *vc; 8 | UIWindow *window; 9 | int adapter; 10 | bool disconnected; 11 | }; 12 | 13 | @class EAGLView; 14 | 15 | @interface allegroAppDelegate : NSObject { 17 | @public 18 | ALLEGRO_DISPLAY *main_display; 19 | } 20 | 21 | + (void)run:(int)argc:(char **)argv; 22 | - (void)add_view:(NSValue *)value; 23 | - (void)orientation_change:(NSNotification *)notification; 24 | - (void)setupScreenConnectionNotificationHandlers; 25 | - (void)add_screen:(UIScreen *)screen; 26 | 27 | @end 28 | 29 | -------------------------------------------------------------------------------- /src/iphone/iphone.h: -------------------------------------------------------------------------------- 1 | #ifndef __al_included_iphone_h 2 | #define __al_included_iphone_h 3 | 4 | void _al_iphone_acknowledge_drawing_halt(ALLEGRO_DISPLAY *display); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /src/unix/ugfxdrv.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liballeg/allegro5/88885ea07647cb7bae343e5f422d3b72022a7859/src/unix/ugfxdrv.c -------------------------------------------------------------------------------- /src/unix/uhapdrv.c: -------------------------------------------------------------------------------- 1 | /* ______ ___ ___ 2 | * /\ _ \ /\_ \ /\_ \ 3 | * \ \ \L\ \\//\ \ \//\ \ __ __ _ __ ___ 4 | * \ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\/\`'__\/ __`\ 5 | * \ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ \ \//\ \L\ \ 6 | * \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/ 7 | * \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * List of Unix haptic drivers. 12 | * 13 | * By Beoran. 14 | * 15 | * See readme.txt for copyright information. 16 | */ 17 | 18 | 19 | #include "allegro5/allegro.h" 20 | #include "allegro5/platform/aintunix.h" 21 | #include "allegro5/internal/aintern.h" 22 | #include "allegro5/internal/aintern_haptic.h" 23 | 24 | 25 | 26 | _AL_BEGIN_HAPTIC_DRIVER_LIST 27 | #if defined ALLEGRO_HAVE_LINUX_INPUT_H && (defined ALLEGRO_WITH_XWINDOWS || defined ALLEGRO_RASPBERRYPI) 28 | { _ALLEGRO_HAPDRV_LINUX, &_al_hapdrv_linux, true }, 29 | #endif 30 | _AL_END_HAPTIC_DRIVER_LIST 31 | -------------------------------------------------------------------------------- /src/unix/ukeybd.c: -------------------------------------------------------------------------------- 1 | /* ______ ___ ___ 2 | * /\ _ \ /\_ \ /\_ \ 3 | * \ \ \L\ \\//\ \ \//\ \ __ __ _ __ ___ 4 | * \ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\/\`'__\/ __`\ 5 | * \ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ \ \//\ \L\ \ 6 | * \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/ 7 | * \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Unix keyboard module. 12 | * 13 | * By Michael Bukin. 14 | * 15 | * See readme.txt for copyright information. 16 | */ 17 | 18 | 19 | #include "allegro5/allegro.h" 20 | #include "allegro5/internal/aintern_driver.h" 21 | 22 | 23 | 24 | /* list the available drivers */ 25 | _AL_DRIVER_INFO _al_keyboard_driver_list[] = 26 | { 27 | { 0, NULL, 0 } 28 | }; 29 | 30 | -------------------------------------------------------------------------------- /src/unix/umouse.c: -------------------------------------------------------------------------------- 1 | /* ______ ___ ___ 2 | * /\ _ \ /\_ \ /\_ \ 3 | * \ \ \L\ \\//\ \ \//\ \ __ __ _ __ ___ 4 | * \ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\/\`'__\/ __`\ 5 | * \ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ \ \//\ \L\ \ 6 | * \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/ 7 | * \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/ 8 | * /\____/ 9 | * \_/__/ 10 | * 11 | * Unix mouse module. 12 | * 13 | * By Michael Bukin. 14 | * 15 | * See readme.txt for copyright information. 16 | */ 17 | 18 | 19 | #include "allegro5/allegro.h" 20 | #include "allegro5/internal/aintern_driver.h" 21 | 22 | 23 | 24 | /* list the available drivers */ 25 | _AL_DRIVER_INFO _al_mouse_driver_list[] = 26 | { 27 | { 0, NULL, 0 } 28 | }; 29 | 30 | -------------------------------------------------------------------------------- /src/win/wgl.h: -------------------------------------------------------------------------------- 1 | #include "allegro5/internal/aintern_display.h" 2 | #include "allegro5/platform/aintwin.h" 3 | 4 | #include 5 | 6 | 7 | typedef struct ALLEGRO_DISPLAY_WGL 8 | { 9 | ALLEGRO_DISPLAY_WIN win_display; /* This must be the first member. */ 10 | 11 | /* Driver specifics */ 12 | HDC dc; 13 | HGLRC glrc; 14 | } ALLEGRO_DISPLAY_WGL; 15 | 16 | int _al_win_determine_adapter(void); 17 | -------------------------------------------------------------------------------- /src/x/xicon.h: -------------------------------------------------------------------------------- 1 | #ifndef XICON_H 2 | #define XICON_H 3 | 4 | extern ALLEGRO_BITMAP *_al_xwin_initial_icon; 5 | 6 | #endif // XICON_H 7 | -------------------------------------------------------------------------------- /tests/grab_bitmap_suites.sh: -------------------------------------------------------------------------------- 1 | # bmp suite 1 2 | wget -N https://liballeg.org/files/bmpsuite/bmpsuite.zip 3 | unzip -u -d bmpsuite bmpsuite.zip 4 | 5 | # bmp suite 2 6 | wget -N https://liballeg.org/files/bmpsuite/bmptestsuite-0.9.zip 7 | unzip -u bmptestsuite-0.9.zip 8 | 9 | # bmp suite 3 10 | wget -N -P wvnet https://liballeg.org/files/bmpsuite/wvnet/test32bfv4.bmp 11 | wget -N -P wvnet https://liballeg.org/files/bmpsuite/wvnet/test32v5.bmp 12 | wget -N -P wvnet https://liballeg.org/files/bmpsuite/wvnet/trans.bmp 13 | 14 | # bmp suite 4 15 | wget -N https://liballeg.org/files/bmpsuite/bmpsuite-2.4.zip 16 | unzip -u bmpsuite-2.4.zip 17 | mv bmpsuite-2.4 bmpsuite2 18 | -------------------------------------------------------------------------------- /tests/manual_bmpsuite3.ini: -------------------------------------------------------------------------------- 1 | # Test BMP loader with images from this source: 2 | # http://wvnvms.wvnet.edu/vmswww/bmp.html (dead link) 3 | # http://pxd.me/dompdf/www/test/image_bmp.html 4 | 5 | [bitmaps] 6 | test32bfv4 = wvnet/test32bfv4.bmp 7 | test32v5 = wvnet/test32v5.bmp 8 | # test4os2v2= wvnet/test4os2v2.bmp 9 | # OS/2 v2 headers not supported 10 | trans = wvnet/trans.bmp 11 | 12 | [template] 13 | op0=buf = al_create_bitmap(640, 480) 14 | op1=al_set_target_bitmap(buf) 15 | op2=al_clear_to_color(#ff00ff) 16 | op3=al_set_blender(ALLEGRO_ADD, ALLEGRO_ALPHA, ALLEGRO_INVERSE_ALPHA) 17 | op4=al_draw_bitmap(bmp, 0, 0, 0) 18 | op5=al_set_target_bitmap(target) 19 | op6=al_draw_bitmap(buf, 0, 0, 0) 20 | 21 | [test bmpsuite test32bfv4] 22 | extend=template 23 | bmp=test32bfv4 24 | # This image really *is* fully transparent. 25 | hash=6a451dc5 26 | 27 | [test bmpsuite test32v5] 28 | extend=template 29 | bmp=test32v5 30 | hash=f5c38217 31 | 32 | [test bmpsuite trans] 33 | extend=template 34 | bmp=trans 35 | hash=da824687 36 | -------------------------------------------------------------------------------- /tests/test_convert.ini: -------------------------------------------------------------------------------- 1 | [test convert] 2 | # This test relies on needing a video bitmap. 3 | hw_only = true 4 | skip_on_xvfb = true 5 | op0= al_clear_to_color(#554321) 6 | op1= al_set_new_bitmap_flags(ALLEGRO_MEMORY_BITMAP) 7 | op2= al_set_new_bitmap_format(ALLEGRO_PIXEL_FORMAT_RGB_565) 8 | op3= bmp = al_create_bitmap(360, 120) 9 | op4= al_set_target_bitmap(bmp) 10 | op5= al_clear_to_color(#00000000) 11 | op6= al_draw_filled_rectangle(0, 0, 120, 120, red) 12 | op7= al_draw_filled_rectangle(120, 0, 240, 120, green) 13 | op8= al_draw_filled_rectangle(240, 0, 360, 120, blue) 14 | op9= al_set_target_bitmap(target) 15 | op10=al_set_new_bitmap_flags(ALLEGRO_VIDEO_BITMAP) 16 | op11=al_set_new_bitmap_format(ALLEGRO_PIXEL_FORMAT_RGBA_8888) 17 | op12=al_convert_bitmap(bmp) 18 | op13=al_draw_bitmap(bmp, 0, 0, 0) 19 | hash=955d3cc5 20 | 21 | [test convert back] 22 | extend=test convert 23 | op1=al_set_new_bitmap_flags(ALLEGRO_VIDEO_BITMAP) 24 | op10=al_set_new_bitmap_flags(ALLEGRO_MEMORY_BITMAP) 25 | hash=77b58ac5 26 | --------------------------------------------------------------------------------