├── .gitignore ├── LICENSE ├── README.md ├── Sample.png ├── Slides.pdf ├── assets ├── PNG │ ├── HUD │ │ ├── crosshair_blue_large.png │ │ ├── crosshair_blue_small.png │ │ ├── crosshair_outline_large.png │ │ ├── crosshair_outline_small.png │ │ ├── crosshair_red_large.png │ │ ├── crosshair_red_small.png │ │ ├── crosshair_white_large.png │ │ ├── crosshair_white_small.png │ │ ├── icon_bullet_empty_long.png │ │ ├── icon_bullet_empty_short.png │ │ ├── icon_bullet_gold_long.png │ │ ├── icon_bullet_gold_short.png │ │ ├── icon_bullet_silver_long.png │ │ ├── icon_bullet_silver_short.png │ │ ├── icon_duck.png │ │ ├── icon_target.png │ │ ├── text_0.png │ │ ├── text_0_small.png │ │ ├── text_1.png │ │ ├── text_1_small.png │ │ ├── text_2.png │ │ ├── text_2_small.png │ │ ├── text_3.png │ │ ├── text_3_small.png │ │ ├── text_4.png │ │ ├── text_4_small.png │ │ ├── text_5.png │ │ ├── text_5_small.png │ │ ├── text_6.png │ │ ├── text_6_small.png │ │ ├── text_7.png │ │ ├── text_7_small.png │ │ ├── text_8.png │ │ ├── text_8_small.png │ │ ├── text_9.png │ │ ├── text_9_small.png │ │ ├── text_cross.png │ │ ├── text_cross_small.png │ │ ├── text_dots.png │ │ ├── text_dots_small.png │ │ ├── text_gameover.png │ │ ├── text_go.png │ │ ├── text_plus.png │ │ ├── text_plus_small.png │ │ ├── text_ready.png │ │ ├── text_score.png │ │ ├── text_score_small.png │ │ └── text_timeup.png │ ├── Objects │ │ ├── duck_back.png │ │ ├── duck_brown.png │ │ ├── duck_outline_back.png │ │ ├── duck_outline_brown.png │ │ ├── duck_outline_target_brown.png │ │ ├── duck_outline_target_white.png │ │ ├── duck_outline_target_yellow.png │ │ ├── duck_outline_white.png │ │ ├── duck_outline_yellow.png │ │ ├── duck_target_brown.png │ │ ├── duck_target_white.png │ │ ├── duck_target_yellow.png │ │ ├── duck_white.png │ │ ├── duck_yellow.png │ │ ├── rifle.png │ │ ├── rifle_red.png │ │ ├── shot_blue_large.png │ │ ├── shot_blue_small.png │ │ ├── shot_brown_large.png │ │ ├── shot_brown_small.png │ │ ├── shot_grey_large.png │ │ ├── shot_grey_small.png │ │ ├── shot_yellow_large.png │ │ ├── shot_yellow_small.png │ │ ├── stick_metal.png │ │ ├── stick_metal_broken.png │ │ ├── stick_metal_outline.png │ │ ├── stick_metal_outline_broken.png │ │ ├── stick_wood.png │ │ ├── stick_woodFixed.png │ │ ├── stick_woodFixed_outline.png │ │ ├── stick_wood_broken.png │ │ ├── stick_wood_outline.png │ │ ├── stick_wood_outline_broken.png │ │ ├── target_back.png │ │ ├── target_back_outline.png │ │ ├── target_colored.png │ │ ├── target_colored_outline.png │ │ ├── target_red1.png │ │ ├── target_red1_outline.png │ │ ├── target_red2.png │ │ ├── target_red2_outline.png │ │ ├── target_red3.png │ │ ├── target_red3_outline.png │ │ ├── target_white.png │ │ └── target_white_outline.png │ └── Stall │ │ ├── bg_blue.png │ │ ├── bg_green.png │ │ ├── bg_red.png │ │ ├── bg_wood.png │ │ ├── cloud1.png │ │ ├── cloud2.png │ │ ├── curtain.png │ │ ├── curtain_rope.png │ │ ├── curtain_straight.png │ │ ├── curtain_top.png │ │ ├── grass1.png │ │ ├── grass2.png │ │ ├── tree_oak.png │ │ ├── tree_pine.png │ │ ├── water1.png │ │ └── water2.png ├── hit.wav ├── hud.json ├── hud.png ├── miss.wav ├── objects.json ├── objects.png ├── ragtime.ogg ├── stall.json └── stall.png ├── examples ├── 00_base_layout │ └── main.go ├── 01_colors_and_image_options │ └── main.go ├── 02_images │ ├── assets.go │ ├── coin.png │ ├── generate.go │ └── main.go ├── 03_tiles_fixed_size │ ├── Items_Coin.png │ ├── assets.go │ ├── generate.go │ └── main.go ├── 04_tiles_vars │ ├── assets.go │ ├── coins.json │ ├── coins.png │ ├── generate.go │ └── main.go ├── 05_inputs │ └── main.go ├── 06_sounds │ ├── click.go │ ├── click.wav │ ├── generate.go │ ├── main.go │ ├── ragtime.go │ └── ragtime.ogg ├── 07_fonts │ ├── font.go │ ├── generate.go │ ├── main.go │ └── penguin_attack │ │ ├── PenguinAttack.ttf │ │ └── license.txt └── 08_scenes │ ├── back.go │ ├── back.png │ ├── generate.go │ ├── main.go │ ├── start.go │ └── start.png ├── go.mod ├── go.sum ├── shooter-game ├── assets │ ├── PNG │ │ ├── HUD │ │ │ ├── crosshair_blue_large.png │ │ │ ├── crosshair_blue_small.png │ │ │ ├── crosshair_outline_large.png │ │ │ ├── crosshair_outline_small.png │ │ │ ├── crosshair_red_large.png │ │ │ ├── crosshair_red_small.png │ │ │ ├── crosshair_white_large.png │ │ │ ├── crosshair_white_small.png │ │ │ ├── icon_bullet_empty_long.png │ │ │ ├── icon_bullet_empty_short.png │ │ │ ├── icon_bullet_gold_long.png │ │ │ ├── icon_bullet_gold_short.png │ │ │ ├── icon_bullet_silver_long.png │ │ │ ├── icon_bullet_silver_short.png │ │ │ ├── icon_duck.png │ │ │ ├── icon_target.png │ │ │ ├── text_0.png │ │ │ ├── text_0_small.png │ │ │ ├── text_1.png │ │ │ ├── text_1_small.png │ │ │ ├── text_2.png │ │ │ ├── text_2_small.png │ │ │ ├── text_3.png │ │ │ ├── text_3_small.png │ │ │ ├── text_4.png │ │ │ ├── text_4_small.png │ │ │ ├── text_5.png │ │ │ ├── text_5_small.png │ │ │ ├── text_6.png │ │ │ ├── text_6_small.png │ │ │ ├── text_7.png │ │ │ ├── text_7_small.png │ │ │ ├── text_8.png │ │ │ ├── text_8_small.png │ │ │ ├── text_9.png │ │ │ ├── text_9_small.png │ │ │ ├── text_cross.png │ │ │ ├── text_cross_small.png │ │ │ ├── text_dots.png │ │ │ ├── text_dots_small.png │ │ │ ├── text_gameover.png │ │ │ ├── text_go.png │ │ │ ├── text_plus.png │ │ │ ├── text_plus_small.png │ │ │ ├── text_ready.png │ │ │ ├── text_score.png │ │ │ ├── text_score_small.png │ │ │ └── text_timeup.png │ │ ├── Objects │ │ │ ├── duck_back.png │ │ │ ├── duck_brown.png │ │ │ ├── duck_outline_back.png │ │ │ ├── duck_outline_brown.png │ │ │ ├── duck_outline_target_brown.png │ │ │ ├── duck_outline_target_white.png │ │ │ ├── duck_outline_target_yellow.png │ │ │ ├── duck_outline_white.png │ │ │ ├── duck_outline_yellow.png │ │ │ ├── duck_target_brown.png │ │ │ ├── duck_target_white.png │ │ │ ├── duck_target_yellow.png │ │ │ ├── duck_white.png │ │ │ ├── duck_yellow.png │ │ │ ├── rifle.png │ │ │ ├── rifle_red.png │ │ │ ├── shot_blue_large.png │ │ │ ├── shot_blue_small.png │ │ │ ├── shot_brown_large.png │ │ │ ├── shot_brown_small.png │ │ │ ├── shot_grey_large.png │ │ │ ├── shot_grey_small.png │ │ │ ├── shot_yellow_large.png │ │ │ ├── shot_yellow_small.png │ │ │ ├── stick_metal.png │ │ │ ├── stick_metal_broken.png │ │ │ ├── stick_metal_outline.png │ │ │ ├── stick_metal_outline_broken.png │ │ │ ├── stick_wood.png │ │ │ ├── stick_woodFixed.png │ │ │ ├── stick_woodFixed_outline.png │ │ │ ├── stick_wood_broken.png │ │ │ ├── stick_wood_outline.png │ │ │ ├── stick_wood_outline_broken.png │ │ │ ├── target_back.png │ │ │ ├── target_back_outline.png │ │ │ ├── target_colored.png │ │ │ ├── target_colored_outline.png │ │ │ ├── target_red1.png │ │ │ ├── target_red1_outline.png │ │ │ ├── target_red2.png │ │ │ ├── target_red2_outline.png │ │ │ ├── target_red3.png │ │ │ ├── target_red3_outline.png │ │ │ ├── target_white.png │ │ │ └── target_white_outline.png │ │ └── Stall │ │ │ ├── bg_blue.png │ │ │ ├── bg_green.png │ │ │ ├── bg_red.png │ │ │ ├── bg_wood.png │ │ │ ├── cloud1.png │ │ │ ├── cloud2.png │ │ │ ├── curtain.png │ │ │ ├── curtain_rope.png │ │ │ ├── curtain_straight.png │ │ │ ├── curtain_top.png │ │ │ ├── grass1.png │ │ │ ├── grass2.png │ │ │ ├── tree_oak.png │ │ │ ├── tree_pine.png │ │ │ ├── water1.png │ │ │ └── water2.png │ ├── assets.go │ ├── generate.go │ ├── hit.wav │ ├── hit_sound.go │ ├── hud.go │ ├── hud.json │ ├── hud.png │ ├── miss.wav │ ├── miss_sound.go │ ├── objects.go │ ├── objects.json │ ├── objects.png │ ├── ragtime.ogg │ ├── ragtime_sound.go │ ├── stall.go │ ├── stall.json │ └── stall.png ├── cmd │ └── shooter │ │ └── main.go ├── objects │ ├── background.go │ ├── crosshair.go │ ├── curtains.go │ ├── desk.go │ ├── duck.go │ ├── levels.go │ ├── objects.go │ └── score.go ├── shooter.go └── utils │ └── image.go └── vendor ├── github.com ├── go-gl │ └── glfw │ │ └── v3.3 │ │ └── glfw │ │ ├── GLFW_C_REVISION.txt │ │ ├── LICENSE │ │ ├── build.go │ │ ├── build_cgo_hack.go │ │ ├── c_glfw.go │ │ ├── c_glfw_darwin.go │ │ ├── c_glfw_freebsd.go │ │ ├── c_glfw_lin.go │ │ ├── c_glfw_windows.go │ │ ├── context.go │ │ ├── error.c │ │ ├── error.go │ │ ├── glfw.go │ │ ├── glfw │ │ ├── LICENSE.md │ │ ├── deps │ │ │ ├── dummy.go │ │ │ ├── getopt.c │ │ │ ├── getopt.h │ │ │ ├── glad │ │ │ │ ├── dummy.go │ │ │ │ ├── gl.h │ │ │ │ ├── khrplatform.h │ │ │ │ ├── vk_platform.h │ │ │ │ └── vulkan.h │ │ │ ├── glad_gl.c │ │ │ ├── glad_vulkan.c │ │ │ ├── linmath.h │ │ │ ├── mingw │ │ │ │ ├── _mingw_dxhelper.h │ │ │ │ ├── dinput.h │ │ │ │ ├── dummy.go │ │ │ │ └── xinput.h │ │ │ ├── nuklear.h │ │ │ ├── nuklear_glfw_gl2.h │ │ │ ├── stb_image_write.h │ │ │ ├── tinycthread.c │ │ │ ├── tinycthread.h │ │ │ └── vs2008 │ │ │ │ ├── dummy.go │ │ │ │ └── stdint.h │ │ ├── include │ │ │ └── GLFW │ │ │ │ ├── dummy.go │ │ │ │ ├── glfw3.h │ │ │ │ └── glfw3native.h │ │ └── src │ │ │ ├── cocoa_init.m │ │ │ ├── cocoa_joystick.h │ │ │ ├── cocoa_joystick.m │ │ │ ├── cocoa_monitor.m │ │ │ ├── cocoa_platform.h │ │ │ ├── cocoa_time.c │ │ │ ├── cocoa_window.m │ │ │ ├── context.c │ │ │ ├── dummy.go │ │ │ ├── egl_context.c │ │ │ ├── egl_context.h │ │ │ ├── glx_context.c │ │ │ ├── glx_context.h │ │ │ ├── init.c │ │ │ ├── input.c │ │ │ ├── internal.h │ │ │ ├── linux_joystick.c │ │ │ ├── linux_joystick.h │ │ │ ├── mappings.h │ │ │ ├── monitor.c │ │ │ ├── nsgl_context.h │ │ │ ├── nsgl_context.m │ │ │ ├── null_init.c │ │ │ ├── null_joystick.c │ │ │ ├── null_joystick.h │ │ │ ├── null_monitor.c │ │ │ ├── null_platform.h │ │ │ ├── null_window.c │ │ │ ├── osmesa_context.c │ │ │ ├── osmesa_context.h │ │ │ ├── posix_thread.c │ │ │ ├── posix_thread.h │ │ │ ├── posix_time.c │ │ │ ├── posix_time.h │ │ │ ├── vulkan.c │ │ │ ├── wgl_context.c │ │ │ ├── wgl_context.h │ │ │ ├── win32_init.c │ │ │ ├── win32_joystick.c │ │ │ ├── win32_joystick.h │ │ │ ├── win32_monitor.c │ │ │ ├── win32_platform.h │ │ │ ├── win32_thread.c │ │ │ ├── win32_time.c │ │ │ ├── win32_window.c │ │ │ ├── window.c │ │ │ ├── wl_init.c │ │ │ ├── wl_monitor.c │ │ │ ├── wl_platform.h │ │ │ ├── wl_window.c │ │ │ ├── x11_init.c │ │ │ ├── x11_monitor.c │ │ │ ├── x11_platform.h │ │ │ ├── x11_window.c │ │ │ ├── xkb_unicode.c │ │ │ └── xkb_unicode.h │ │ ├── go.mod │ │ ├── input.c │ │ ├── input.go │ │ ├── monitor.c │ │ ├── monitor.go │ │ ├── native_darwin.go │ │ ├── native_linbsd.go │ │ ├── native_windows.go │ │ ├── time.go │ │ ├── util.go │ │ ├── vulkan.go │ │ ├── window.c │ │ └── window.go ├── golang │ └── freetype │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── raster │ │ ├── geom.go │ │ ├── paint.go │ │ ├── raster.go │ │ └── stroke.go │ │ └── truetype │ │ ├── face.go │ │ ├── glyph.go │ │ ├── hint.go │ │ ├── opcodes.go │ │ └── truetype.go ├── hajimehoshi │ ├── ebiten │ │ ├── .gitattributes │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── AUTHORS │ │ ├── CODE_OF_CONDUCT.md │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── audio │ │ │ ├── audio.go │ │ │ ├── buffersize_mobile.go │ │ │ ├── buffersize_notmobile.go │ │ │ ├── context.go │ │ │ ├── contextimpl_oto.go │ │ │ ├── internal │ │ │ │ └── convert │ │ │ │ │ ├── float32.go │ │ │ │ │ ├── resampling.go │ │ │ │ │ └── stereo16.go │ │ │ ├── loop.go │ │ │ ├── vorbis │ │ │ │ ├── generate.go │ │ │ │ ├── internal │ │ │ │ │ └── stb │ │ │ │ │ │ ├── decode.go │ │ │ │ │ │ ├── generate.go │ │ │ │ │ │ ├── stbvorbis.js │ │ │ │ │ │ └── stbvorbis.js.go │ │ │ │ ├── test_mono.ogg │ │ │ │ ├── test_tooshort.ogg │ │ │ │ ├── vorbis.go │ │ │ │ ├── vorbis_gopherjs.go │ │ │ │ └── vorbis_notgopherjs.go │ │ │ └── wav │ │ │ │ └── decode.go │ │ ├── colorm.go │ │ ├── cursormode.go │ │ ├── debug_ebitendebug.go │ │ ├── debug_notebitendebug.go │ │ ├── doc.go │ │ ├── ebitenutil │ │ │ ├── debugprint.go │ │ │ ├── doc.go │ │ │ ├── file_js.go │ │ │ ├── file_notjs.go │ │ │ ├── gif.go │ │ │ ├── import.go │ │ │ ├── internal │ │ │ │ └── assets │ │ │ │ │ ├── assets.go │ │ │ │ │ ├── license.md │ │ │ │ │ ├── text.png │ │ │ │ │ └── textrgba.go │ │ │ ├── io.go │ │ │ ├── loadimage.go │ │ │ ├── shapes.go │ │ │ └── url.go │ │ ├── gamepad.go │ │ ├── generate.go │ │ ├── geom.go │ │ ├── go.mod │ │ ├── go.sum │ │ ├── goversion.go │ │ ├── graphics.go │ │ ├── image.go │ │ ├── imagedumper_desktop.go │ │ ├── imagedumper_notdesktop.go │ │ ├── imageparts.go │ │ ├── imagetobytes.go │ │ ├── init.go │ │ ├── input.go │ │ ├── internal │ │ │ ├── affine │ │ │ │ ├── affine.go │ │ │ │ └── colorm.go │ │ │ ├── buffered │ │ │ │ ├── command.go │ │ │ │ └── image.go │ │ │ ├── clock │ │ │ │ ├── clock.go │ │ │ │ ├── now_notwindows.go │ │ │ │ └── now_windows.go │ │ │ ├── colormcache │ │ │ │ └── cache.go │ │ │ ├── devicescale │ │ │ │ ├── cinnamon_unix.go │ │ │ │ ├── devicescale.go │ │ │ │ ├── impl_android.go │ │ │ │ ├── impl_ios.go │ │ │ │ ├── impl_js.go │ │ │ │ ├── impl_mac.go │ │ │ │ ├── impl_plan9.go │ │ │ │ ├── impl_unix.go │ │ │ │ └── impl_windows.go │ │ │ ├── driver │ │ │ │ ├── compositemode.go │ │ │ │ ├── cursormode.go │ │ │ │ ├── event.go │ │ │ │ ├── filter.go │ │ │ │ ├── gamepadbutton.go │ │ │ │ ├── graphics.go │ │ │ │ ├── input.go │ │ │ │ ├── keys.go │ │ │ │ ├── modifier.go │ │ │ │ ├── mousebutton.go │ │ │ │ └── ui.go │ │ │ ├── glfw │ │ │ │ ├── Dockerfile │ │ │ │ ├── const.go │ │ │ │ ├── gen.sh │ │ │ │ ├── generate.go │ │ │ │ ├── glfw_notwindows.go │ │ │ │ ├── glfw_windows.go │ │ │ │ ├── glfwdll_windows_386.go │ │ │ │ ├── glfwdll_windows_amd64.go │ │ │ │ ├── keys.go │ │ │ │ ├── load_windows.go │ │ │ │ ├── native_darwin.go │ │ │ │ ├── native_windows.go │ │ │ │ └── type.go │ │ │ ├── graphics │ │ │ │ ├── math.go │ │ │ │ └── vertex.go │ │ │ ├── graphicscommand │ │ │ │ ├── command.go │ │ │ │ ├── debug_ebitendebug.go │ │ │ │ ├── debug_notebitendebug.go │ │ │ │ ├── doc.go │ │ │ │ ├── image.go │ │ │ │ └── shader.go │ │ │ ├── graphicsdriver │ │ │ │ ├── metal │ │ │ │ │ ├── README.md │ │ │ │ │ ├── ca │ │ │ │ │ │ ├── ca.go │ │ │ │ │ │ ├── ca.h │ │ │ │ │ │ └── ca.m │ │ │ │ │ ├── graphics.go │ │ │ │ │ ├── mtl │ │ │ │ │ │ ├── mtl.go │ │ │ │ │ │ ├── mtl.h │ │ │ │ │ │ └── mtl.m │ │ │ │ │ ├── ns │ │ │ │ │ │ ├── ns.go │ │ │ │ │ │ ├── ns.h │ │ │ │ │ │ └── ns.m │ │ │ │ │ ├── shader.go │ │ │ │ │ ├── view.go │ │ │ │ │ ├── view_ios.go │ │ │ │ │ └── view_macos.go │ │ │ │ └── opengl │ │ │ │ │ ├── bytes.go │ │ │ │ │ ├── context.go │ │ │ │ │ ├── context_desktop.go │ │ │ │ │ ├── context_js.go │ │ │ │ │ ├── context_mobile.go │ │ │ │ │ ├── context_notx.go │ │ │ │ │ ├── context_x.go │ │ │ │ │ ├── defaultshader.go │ │ │ │ │ ├── framebuffer.go │ │ │ │ │ ├── gl │ │ │ │ │ ├── LICENSE │ │ │ │ │ ├── README.md │ │ │ │ │ ├── conversions_notwindows.go │ │ │ │ │ ├── conversions_windows.go │ │ │ │ │ ├── package.go │ │ │ │ │ ├── package_notwindows.go │ │ │ │ │ ├── package_windows.go │ │ │ │ │ ├── package_x.go │ │ │ │ │ ├── procaddr_notwindows.go │ │ │ │ │ └── procaddr_windows.go │ │ │ │ │ ├── graphics.go │ │ │ │ │ ├── graphics_mobile.go │ │ │ │ │ ├── image.go │ │ │ │ │ ├── locationcache.go │ │ │ │ │ ├── program.go │ │ │ │ │ ├── shader.go │ │ │ │ │ └── types.go │ │ │ ├── hooks │ │ │ │ └── hooks.go │ │ │ ├── jsutil │ │ │ │ ├── buf_js.go │ │ │ │ ├── doc.go │ │ │ │ ├── equalgo113_js.go │ │ │ │ ├── equalgo114_js.go │ │ │ │ ├── go112_js.go │ │ │ │ └── go113_js.go │ │ │ ├── mipmap │ │ │ │ └── mipmap.go │ │ │ ├── packing │ │ │ │ └── packing.go │ │ │ ├── png │ │ │ │ ├── generate.go │ │ │ │ ├── stdlibfuzz.go │ │ │ │ ├── stdlibpaeth.go │ │ │ │ ├── stdlibreader.go │ │ │ │ └── stdlibwriter.go │ │ │ ├── restorable │ │ │ │ ├── const_android.go │ │ │ │ ├── const_js.go │ │ │ │ ├── const_others.go │ │ │ │ ├── doc.go │ │ │ │ ├── image.go │ │ │ │ ├── images.go │ │ │ │ ├── rect.go │ │ │ │ └── shader.go │ │ │ ├── shader │ │ │ │ ├── expr.go │ │ │ │ ├── shader.go │ │ │ │ ├── stmt.go │ │ │ │ └── type.go │ │ │ ├── shaderir │ │ │ │ ├── glsl │ │ │ │ │ ├── glsl.go │ │ │ │ │ └── type.go │ │ │ │ ├── metal │ │ │ │ │ ├── metal.go │ │ │ │ │ └── type.go │ │ │ │ ├── program.go │ │ │ │ └── type.go │ │ │ ├── shareable │ │ │ │ ├── image.go │ │ │ │ └── shader.go │ │ │ ├── thread │ │ │ │ └── thread.go │ │ │ ├── uidriver │ │ │ │ ├── glfw │ │ │ │ │ ├── graphics_darwin.go │ │ │ │ │ ├── graphics_opengl.go │ │ │ │ │ ├── hideconsole_notwindows.go │ │ │ │ │ ├── hideconsole_windows.go │ │ │ │ │ ├── input.go │ │ │ │ │ ├── keys.go │ │ │ │ │ ├── ui.go │ │ │ │ │ ├── ui_darwin.go │ │ │ │ │ ├── ui_unix.go │ │ │ │ │ ├── ui_windows.go │ │ │ │ │ └── window.go │ │ │ │ ├── js │ │ │ │ │ ├── input.go │ │ │ │ │ ├── keys.go │ │ │ │ │ └── ui.go │ │ │ │ └── mobile │ │ │ │ │ ├── graphics_ios.go │ │ │ │ │ ├── graphics_opengl.go │ │ │ │ │ ├── input.go │ │ │ │ │ ├── keys.go │ │ │ │ │ └── ui.go │ │ │ └── web │ │ │ │ ├── js.go │ │ │ │ └── notjs.go │ │ ├── keys.go │ │ ├── mousebuttons.go │ │ ├── run.go │ │ ├── shader.go │ │ ├── text │ │ │ ├── advance.go │ │ │ └── text.go │ │ ├── uicontext.go │ │ ├── uidriver_glfw.go │ │ ├── uidriver_js.go │ │ ├── uidriver_mobile.go │ │ └── window.go │ └── oto │ │ ├── .gitignore │ │ ├── AUTHORS │ │ ├── LICENSE │ │ ├── README.md │ │ ├── context.go │ │ ├── driver_android.go │ │ ├── driver_darwin.go │ │ ├── driver_ios.go │ │ ├── driver_ios.m │ │ ├── driver_js.go │ │ ├── driver_linux.go │ │ ├── driver_macos.go │ │ ├── driver_macos.m │ │ ├── driver_openal.go │ │ ├── driver_windows.go │ │ ├── dummy.go │ │ ├── equalgo113_js.go │ │ ├── equalgo114_js.go │ │ ├── go.mod │ │ ├── go.sum │ │ ├── go112_js.go │ │ ├── go113_js.go │ │ ├── internal │ │ └── mux │ │ │ └── mux.go │ │ ├── pipe_gopherjs.go │ │ ├── pipe_notgopherjs.go │ │ ├── player.go │ │ └── winmm_windows.go └── jfreymuth │ ├── oggvorbis │ ├── LICENSE │ ├── README.md │ ├── crc.go │ ├── doc.go │ ├── go.mod │ ├── go.sum │ ├── ogg.go │ ├── reader.go │ └── util.go │ └── vorbis │ ├── .travis.yml │ ├── LICENSE │ ├── README.md │ ├── bitreader.go │ ├── codebook.go │ ├── decode.go │ ├── doc.go │ ├── floor0.go │ ├── floor1.go │ ├── header.go │ ├── huffman.go │ ├── imdct.go │ ├── inversedbtable.go │ ├── residue.go │ ├── setup.go │ ├── vorbis.go │ └── window.go ├── golang.org └── x │ ├── exp │ ├── AUTHORS │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── PATENTS │ └── shiny │ │ ├── driver │ │ ├── gldriver │ │ │ ├── buffer.go │ │ │ ├── cocoa.go │ │ │ ├── cocoa.m │ │ │ ├── context.go │ │ │ ├── egl.go │ │ │ ├── gldriver.go │ │ │ ├── other.go │ │ │ ├── screen.go │ │ │ ├── texture.go │ │ │ ├── win32.go │ │ │ ├── window.go │ │ │ ├── x11.c │ │ │ └── x11.go │ │ └── internal │ │ │ ├── drawer │ │ │ └── drawer.go │ │ │ ├── errscreen │ │ │ └── errscreen.go │ │ │ ├── event │ │ │ └── event.go │ │ │ ├── lifecycler │ │ │ └── lifecycler.go │ │ │ ├── win32 │ │ │ ├── key.go │ │ │ ├── syscall.go │ │ │ ├── syscall_windows.go │ │ │ ├── win32.go │ │ │ └── zsyscall_windows.go │ │ │ └── x11key │ │ │ ├── table.go │ │ │ └── x11key.go │ │ └── screen │ │ └── screen.go │ ├── image │ ├── AUTHORS │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── PATENTS │ ├── font │ │ └── font.go │ └── math │ │ ├── f64 │ │ └── f64.go │ │ └── fixed │ │ └── fixed.go │ ├── mobile │ ├── AUTHORS │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── PATENTS │ ├── app │ │ ├── GoNativeActivity.java │ │ ├── android.c │ │ ├── android.go │ │ ├── app.go │ │ ├── darwin_desktop.go │ │ ├── darwin_desktop.m │ │ ├── darwin_ios.go │ │ ├── darwin_ios.m │ │ ├── doc.go │ │ ├── internal │ │ │ └── callfn │ │ │ │ ├── callfn.go │ │ │ │ ├── callfn_386.s │ │ │ │ ├── callfn_amd64.s │ │ │ │ ├── callfn_arm.s │ │ │ │ └── callfn_arm64.s │ │ ├── shiny.go │ │ ├── x11.c │ │ └── x11.go │ ├── event │ │ ├── key │ │ │ ├── code_string.go │ │ │ └── key.go │ │ ├── lifecycle │ │ │ └── lifecycle.go │ │ ├── mouse │ │ │ └── mouse.go │ │ ├── paint │ │ │ └── paint.go │ │ ├── size │ │ │ └── size.go │ │ └── touch │ │ │ └── touch.go │ ├── geom │ │ └── geom.go │ ├── gl │ │ ├── consts.go │ │ ├── dll_windows.go │ │ ├── doc.go │ │ ├── fn.go │ │ ├── gl.go │ │ ├── gldebug.go │ │ ├── interface.go │ │ ├── types_debug.go │ │ ├── types_prod.go │ │ ├── work.c │ │ ├── work.go │ │ ├── work.h │ │ ├── work_other.go │ │ ├── work_windows.go │ │ ├── work_windows_386.s │ │ └── work_windows_amd64.s │ └── internal │ │ └── mobileinit │ │ ├── ctx_android.go │ │ ├── mobileinit.go │ │ ├── mobileinit_android.go │ │ └── mobileinit_ios.go │ └── sys │ ├── AUTHORS │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── PATENTS │ ├── internal │ └── unsafeheader │ │ └── unsafeheader.go │ └── windows │ ├── aliases.go │ ├── dll_windows.go │ ├── empty.s │ ├── env_windows.go │ ├── eventlog.go │ ├── exec_windows.go │ ├── memory_windows.go │ ├── mkerrors.bash │ ├── mkknownfolderids.bash │ ├── mksyscall.go │ ├── race.go │ ├── race0.go │ ├── security_windows.go │ ├── service.go │ ├── str.go │ ├── syscall.go │ ├── syscall_windows.go │ ├── types_windows.go │ ├── types_windows_386.go │ ├── types_windows_amd64.go │ ├── types_windows_arm.go │ ├── zerrors_windows.go │ ├── zknownfolderids_windows.go │ └── zsyscall_windows.go └── modules.txt /.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | 8 | # Test binary, built with `go test -c` 9 | *.test 10 | 11 | # Output of the go coverage tool, specifically when used with LiteIDE 12 | *.out 13 | 14 | # Dependency directories (remove the comment below to include it) 15 | # vendor/ 16 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Develer 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Sample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/Sample.png -------------------------------------------------------------------------------- /Slides.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/Slides.pdf -------------------------------------------------------------------------------- /assets/PNG/HUD/crosshair_blue_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/crosshair_blue_large.png -------------------------------------------------------------------------------- /assets/PNG/HUD/crosshair_blue_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/crosshair_blue_small.png -------------------------------------------------------------------------------- /assets/PNG/HUD/crosshair_outline_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/crosshair_outline_large.png -------------------------------------------------------------------------------- /assets/PNG/HUD/crosshair_outline_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/crosshair_outline_small.png -------------------------------------------------------------------------------- /assets/PNG/HUD/crosshair_red_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/crosshair_red_large.png -------------------------------------------------------------------------------- /assets/PNG/HUD/crosshair_red_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/crosshair_red_small.png -------------------------------------------------------------------------------- /assets/PNG/HUD/crosshair_white_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/crosshair_white_large.png -------------------------------------------------------------------------------- /assets/PNG/HUD/crosshair_white_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/crosshair_white_small.png -------------------------------------------------------------------------------- /assets/PNG/HUD/icon_bullet_empty_long.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/icon_bullet_empty_long.png -------------------------------------------------------------------------------- /assets/PNG/HUD/icon_bullet_empty_short.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/icon_bullet_empty_short.png -------------------------------------------------------------------------------- /assets/PNG/HUD/icon_bullet_gold_long.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/icon_bullet_gold_long.png -------------------------------------------------------------------------------- /assets/PNG/HUD/icon_bullet_gold_short.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/icon_bullet_gold_short.png -------------------------------------------------------------------------------- /assets/PNG/HUD/icon_bullet_silver_long.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/icon_bullet_silver_long.png -------------------------------------------------------------------------------- /assets/PNG/HUD/icon_bullet_silver_short.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/icon_bullet_silver_short.png -------------------------------------------------------------------------------- /assets/PNG/HUD/icon_duck.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/icon_duck.png -------------------------------------------------------------------------------- /assets/PNG/HUD/icon_target.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/icon_target.png -------------------------------------------------------------------------------- /assets/PNG/HUD/text_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/text_0.png -------------------------------------------------------------------------------- /assets/PNG/HUD/text_0_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/text_0_small.png -------------------------------------------------------------------------------- /assets/PNG/HUD/text_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/text_1.png -------------------------------------------------------------------------------- /assets/PNG/HUD/text_1_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/text_1_small.png -------------------------------------------------------------------------------- /assets/PNG/HUD/text_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/text_2.png -------------------------------------------------------------------------------- /assets/PNG/HUD/text_2_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/text_2_small.png -------------------------------------------------------------------------------- /assets/PNG/HUD/text_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/text_3.png -------------------------------------------------------------------------------- /assets/PNG/HUD/text_3_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/text_3_small.png -------------------------------------------------------------------------------- /assets/PNG/HUD/text_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/text_4.png -------------------------------------------------------------------------------- /assets/PNG/HUD/text_4_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/text_4_small.png -------------------------------------------------------------------------------- /assets/PNG/HUD/text_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/text_5.png -------------------------------------------------------------------------------- /assets/PNG/HUD/text_5_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/text_5_small.png -------------------------------------------------------------------------------- /assets/PNG/HUD/text_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/text_6.png -------------------------------------------------------------------------------- /assets/PNG/HUD/text_6_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/text_6_small.png -------------------------------------------------------------------------------- /assets/PNG/HUD/text_7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/text_7.png -------------------------------------------------------------------------------- /assets/PNG/HUD/text_7_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/text_7_small.png -------------------------------------------------------------------------------- /assets/PNG/HUD/text_8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/text_8.png -------------------------------------------------------------------------------- /assets/PNG/HUD/text_8_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/text_8_small.png -------------------------------------------------------------------------------- /assets/PNG/HUD/text_9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/text_9.png -------------------------------------------------------------------------------- /assets/PNG/HUD/text_9_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/text_9_small.png -------------------------------------------------------------------------------- /assets/PNG/HUD/text_cross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/text_cross.png -------------------------------------------------------------------------------- /assets/PNG/HUD/text_cross_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/text_cross_small.png -------------------------------------------------------------------------------- /assets/PNG/HUD/text_dots.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/text_dots.png -------------------------------------------------------------------------------- /assets/PNG/HUD/text_dots_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/text_dots_small.png -------------------------------------------------------------------------------- /assets/PNG/HUD/text_gameover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/text_gameover.png -------------------------------------------------------------------------------- /assets/PNG/HUD/text_go.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/text_go.png -------------------------------------------------------------------------------- /assets/PNG/HUD/text_plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/text_plus.png -------------------------------------------------------------------------------- /assets/PNG/HUD/text_plus_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/text_plus_small.png -------------------------------------------------------------------------------- /assets/PNG/HUD/text_ready.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/text_ready.png -------------------------------------------------------------------------------- /assets/PNG/HUD/text_score.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/text_score.png -------------------------------------------------------------------------------- /assets/PNG/HUD/text_score_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/text_score_small.png -------------------------------------------------------------------------------- /assets/PNG/HUD/text_timeup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/HUD/text_timeup.png -------------------------------------------------------------------------------- /assets/PNG/Objects/duck_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Objects/duck_back.png -------------------------------------------------------------------------------- /assets/PNG/Objects/duck_brown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Objects/duck_brown.png -------------------------------------------------------------------------------- /assets/PNG/Objects/duck_outline_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Objects/duck_outline_back.png -------------------------------------------------------------------------------- /assets/PNG/Objects/duck_outline_brown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Objects/duck_outline_brown.png -------------------------------------------------------------------------------- /assets/PNG/Objects/duck_outline_target_brown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Objects/duck_outline_target_brown.png -------------------------------------------------------------------------------- /assets/PNG/Objects/duck_outline_target_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Objects/duck_outline_target_white.png -------------------------------------------------------------------------------- /assets/PNG/Objects/duck_outline_target_yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Objects/duck_outline_target_yellow.png -------------------------------------------------------------------------------- /assets/PNG/Objects/duck_outline_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Objects/duck_outline_white.png -------------------------------------------------------------------------------- /assets/PNG/Objects/duck_outline_yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Objects/duck_outline_yellow.png -------------------------------------------------------------------------------- /assets/PNG/Objects/duck_target_brown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Objects/duck_target_brown.png -------------------------------------------------------------------------------- /assets/PNG/Objects/duck_target_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Objects/duck_target_white.png -------------------------------------------------------------------------------- /assets/PNG/Objects/duck_target_yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Objects/duck_target_yellow.png -------------------------------------------------------------------------------- /assets/PNG/Objects/duck_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Objects/duck_white.png -------------------------------------------------------------------------------- /assets/PNG/Objects/duck_yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Objects/duck_yellow.png -------------------------------------------------------------------------------- /assets/PNG/Objects/rifle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Objects/rifle.png -------------------------------------------------------------------------------- /assets/PNG/Objects/rifle_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Objects/rifle_red.png -------------------------------------------------------------------------------- /assets/PNG/Objects/shot_blue_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Objects/shot_blue_large.png -------------------------------------------------------------------------------- /assets/PNG/Objects/shot_blue_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Objects/shot_blue_small.png -------------------------------------------------------------------------------- /assets/PNG/Objects/shot_brown_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Objects/shot_brown_large.png -------------------------------------------------------------------------------- /assets/PNG/Objects/shot_brown_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Objects/shot_brown_small.png -------------------------------------------------------------------------------- /assets/PNG/Objects/shot_grey_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Objects/shot_grey_large.png -------------------------------------------------------------------------------- /assets/PNG/Objects/shot_grey_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Objects/shot_grey_small.png -------------------------------------------------------------------------------- /assets/PNG/Objects/shot_yellow_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Objects/shot_yellow_large.png -------------------------------------------------------------------------------- /assets/PNG/Objects/shot_yellow_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Objects/shot_yellow_small.png -------------------------------------------------------------------------------- /assets/PNG/Objects/stick_metal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Objects/stick_metal.png -------------------------------------------------------------------------------- /assets/PNG/Objects/stick_metal_broken.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Objects/stick_metal_broken.png -------------------------------------------------------------------------------- /assets/PNG/Objects/stick_metal_outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Objects/stick_metal_outline.png -------------------------------------------------------------------------------- /assets/PNG/Objects/stick_metal_outline_broken.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Objects/stick_metal_outline_broken.png -------------------------------------------------------------------------------- /assets/PNG/Objects/stick_wood.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Objects/stick_wood.png -------------------------------------------------------------------------------- /assets/PNG/Objects/stick_woodFixed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Objects/stick_woodFixed.png -------------------------------------------------------------------------------- /assets/PNG/Objects/stick_woodFixed_outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Objects/stick_woodFixed_outline.png -------------------------------------------------------------------------------- /assets/PNG/Objects/stick_wood_broken.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Objects/stick_wood_broken.png -------------------------------------------------------------------------------- /assets/PNG/Objects/stick_wood_outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Objects/stick_wood_outline.png -------------------------------------------------------------------------------- /assets/PNG/Objects/stick_wood_outline_broken.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Objects/stick_wood_outline_broken.png -------------------------------------------------------------------------------- /assets/PNG/Objects/target_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Objects/target_back.png -------------------------------------------------------------------------------- /assets/PNG/Objects/target_back_outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Objects/target_back_outline.png -------------------------------------------------------------------------------- /assets/PNG/Objects/target_colored.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Objects/target_colored.png -------------------------------------------------------------------------------- /assets/PNG/Objects/target_colored_outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Objects/target_colored_outline.png -------------------------------------------------------------------------------- /assets/PNG/Objects/target_red1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Objects/target_red1.png -------------------------------------------------------------------------------- /assets/PNG/Objects/target_red1_outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Objects/target_red1_outline.png -------------------------------------------------------------------------------- /assets/PNG/Objects/target_red2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Objects/target_red2.png -------------------------------------------------------------------------------- /assets/PNG/Objects/target_red2_outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Objects/target_red2_outline.png -------------------------------------------------------------------------------- /assets/PNG/Objects/target_red3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Objects/target_red3.png -------------------------------------------------------------------------------- /assets/PNG/Objects/target_red3_outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Objects/target_red3_outline.png -------------------------------------------------------------------------------- /assets/PNG/Objects/target_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Objects/target_white.png -------------------------------------------------------------------------------- /assets/PNG/Objects/target_white_outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Objects/target_white_outline.png -------------------------------------------------------------------------------- /assets/PNG/Stall/bg_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Stall/bg_blue.png -------------------------------------------------------------------------------- /assets/PNG/Stall/bg_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Stall/bg_green.png -------------------------------------------------------------------------------- /assets/PNG/Stall/bg_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Stall/bg_red.png -------------------------------------------------------------------------------- /assets/PNG/Stall/bg_wood.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Stall/bg_wood.png -------------------------------------------------------------------------------- /assets/PNG/Stall/cloud1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Stall/cloud1.png -------------------------------------------------------------------------------- /assets/PNG/Stall/cloud2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Stall/cloud2.png -------------------------------------------------------------------------------- /assets/PNG/Stall/curtain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Stall/curtain.png -------------------------------------------------------------------------------- /assets/PNG/Stall/curtain_rope.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Stall/curtain_rope.png -------------------------------------------------------------------------------- /assets/PNG/Stall/curtain_straight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Stall/curtain_straight.png -------------------------------------------------------------------------------- /assets/PNG/Stall/curtain_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Stall/curtain_top.png -------------------------------------------------------------------------------- /assets/PNG/Stall/grass1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Stall/grass1.png -------------------------------------------------------------------------------- /assets/PNG/Stall/grass2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Stall/grass2.png -------------------------------------------------------------------------------- /assets/PNG/Stall/tree_oak.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Stall/tree_oak.png -------------------------------------------------------------------------------- /assets/PNG/Stall/tree_pine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Stall/tree_pine.png -------------------------------------------------------------------------------- /assets/PNG/Stall/water1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Stall/water1.png -------------------------------------------------------------------------------- /assets/PNG/Stall/water2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/PNG/Stall/water2.png -------------------------------------------------------------------------------- /assets/hit.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/hit.wav -------------------------------------------------------------------------------- /assets/hud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/hud.png -------------------------------------------------------------------------------- /assets/miss.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/miss.wav -------------------------------------------------------------------------------- /assets/objects.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/objects.png -------------------------------------------------------------------------------- /assets/ragtime.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/ragtime.ogg -------------------------------------------------------------------------------- /assets/stall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/assets/stall.png -------------------------------------------------------------------------------- /examples/00_base_layout/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "github.com/hajimehoshi/ebiten" 5 | "github.com/hajimehoshi/ebiten/ebitenutil" 6 | ) 7 | 8 | type Game struct{} // Game implements the ebiten.Game interface 9 | 10 | func (g *Game) Update(screen *ebiten.Image) error { 11 | return nil 12 | } 13 | 14 | // Draw is optional, but suggested to maintain the logic of the Game Loop 15 | func (g *Game) Draw(screen *ebiten.Image) { 16 | ebitenutil.DebugPrint(screen, "Hello, World!") 17 | } 18 | 19 | func (g *Game) Layout(outsideWidth, outsideHeight int) (int, int) { 20 | return outsideWidth, outsideHeight 21 | } 22 | 23 | func main() { 24 | ebiten.SetWindowSize(640, 480) 25 | ebiten.SetWindowTitle("Hello, World!") 26 | if err := ebiten.RunGame(&Game{}); err != nil { 27 | panic(err) 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /examples/02_images/coin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/examples/02_images/coin.png -------------------------------------------------------------------------------- /examples/02_images/generate.go: -------------------------------------------------------------------------------- 1 | //go:generate file2byteslice -input ./coin.png -output assets.go -package main -var coinImg 2 | package main 3 | -------------------------------------------------------------------------------- /examples/03_tiles_fixed_size/Items_Coin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/examples/03_tiles_fixed_size/Items_Coin.png -------------------------------------------------------------------------------- /examples/03_tiles_fixed_size/generate.go: -------------------------------------------------------------------------------- 1 | //go:generate file2byteslice -input ./Items_Coin.png -output assets.go -package main -var coinImg 2 | package main 3 | -------------------------------------------------------------------------------- /examples/04_tiles_vars/coins.json: -------------------------------------------------------------------------------- 1 | { 2 | "frames": [ 3 | { "x": 0, "y": 0, "w": 64, "h": 64 }, 4 | { "x": 86, "y": 0, "w": 57, "h": 64 }, 5 | { "x": 165, "y": 0, "w": 50, "h": 64 }, 6 | { "x": 237, "y": 0, "w": 44, "h": 64 }, 7 | { "x": 303, "y": 0, "w": 38, "h": 64 }, 8 | { "x": 363, "y": 0, "w": 32, "h": 64 }, 9 | { "x": 417, "y": 0, "w": 29, "h": 64 }, 10 | { "x": 468, "y": 0, "w": 23, "h": 64 }, 11 | { "x": 513, "y": 0, "w": 16, "h": 64 }, 12 | { "x": 551, "y": 0, "w": 23, "h": 64 }, 13 | { "x": 596, "y": 0, "w": 29, "h": 64 }, 14 | { "x": 647, "y": 0, "w": 32, "h": 64 }, 15 | { "x": 701, "y": 0, "w": 38, "h": 64 }, 16 | { "x": 761, "y": 0, "w": 44, "h": 64 }, 17 | { "x": 827, "y": 0, "w": 50, "h": 64 }, 18 | { "x": 899, "y": 0, "w": 57, "h": 64 } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /examples/04_tiles_vars/coins.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/examples/04_tiles_vars/coins.png -------------------------------------------------------------------------------- /examples/04_tiles_vars/generate.go: -------------------------------------------------------------------------------- 1 | //go:generate file2byteslice -input ./coins.png -output assets.go -package main -var coinImg 2 | package main 3 | -------------------------------------------------------------------------------- /examples/06_sounds/click.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/examples/06_sounds/click.wav -------------------------------------------------------------------------------- /examples/06_sounds/generate.go: -------------------------------------------------------------------------------- 1 | //go:generate file2byteslice -input ./click.wav -output click.go -package main -var ClickSound 2 | //go:generate file2byteslice -input ./ragtime.ogg -output ragtime.go -package main -var RagtimeSound 3 | package main 4 | -------------------------------------------------------------------------------- /examples/06_sounds/ragtime.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/examples/06_sounds/ragtime.ogg -------------------------------------------------------------------------------- /examples/07_fonts/generate.go: -------------------------------------------------------------------------------- 1 | //go:generate file2byteslice -input ./penguin_attack/PenguinAttack.ttf -output font.go -package main -var Font 2 | package main 3 | -------------------------------------------------------------------------------- /examples/07_fonts/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "image/color" 5 | "log" 6 | 7 | "github.com/golang/freetype/truetype" 8 | "github.com/hajimehoshi/ebiten" 9 | "github.com/hajimehoshi/ebiten/text" 10 | "golang.org/x/image/font" 11 | ) 12 | 13 | const ( 14 | sampleText = `Hello, Gophers!` 15 | dpi = 72 16 | fontSize = 36 17 | ) 18 | 19 | type game struct{} 20 | 21 | var mplusNormalFont font.Face 22 | 23 | func (g *game) Update(screen *ebiten.Image) error { 24 | return nil 25 | } 26 | 27 | func (g *game) Draw(screen *ebiten.Image) { 28 | // calculate the rectangle containing the text 29 | bounds := text.BoundString(mplusNormalFont, sampleText) 30 | // write moving the text down by its height 31 | text.Draw(screen, sampleText, mplusNormalFont, 10, bounds.Dy(), color.White) 32 | } 33 | 34 | func (g *game) Layout(x, y int) (int, int) { 35 | return x, y 36 | } 37 | 38 | func init() { 39 | tt, err := truetype.Parse(Font) 40 | if err != nil { 41 | log.Fatal(err) 42 | } 43 | 44 | mplusNormalFont = truetype.NewFace(tt, &truetype.Options{ 45 | Size: fontSize, 46 | DPI: dpi, 47 | Hinting: font.HintingFull, 48 | }) 49 | } 50 | 51 | func main() { 52 | ebiten.SetWindowSize(640, 480) 53 | ebiten.SetWindowTitle("inputs") 54 | ebiten.RunGame(&game{}) 55 | } 56 | -------------------------------------------------------------------------------- /examples/07_fonts/penguin_attack/PenguinAttack.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/examples/07_fonts/penguin_attack/PenguinAttack.ttf -------------------------------------------------------------------------------- /examples/08_scenes/back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/examples/08_scenes/back.png -------------------------------------------------------------------------------- /examples/08_scenes/generate.go: -------------------------------------------------------------------------------- 1 | //go:generate file2byteslice -input ./back.png -output back.go -package main -var backImg 2 | //go:generate file2byteslice -input ./start.png -output start.go -package main -var startImg 3 | package main 4 | -------------------------------------------------------------------------------- /examples/08_scenes/start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/examples/08_scenes/start.png -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/develersrl/golab2020-go-game-dev 2 | 3 | go 1.15 4 | 5 | require ( 6 | github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 7 | github.com/hajimehoshi/ebiten v1.12.1 8 | golang.org/x/image v0.0.0-20200801110659-972c09e46d76 9 | ) 10 | -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/crosshair_blue_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/crosshair_blue_large.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/crosshair_blue_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/crosshair_blue_small.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/crosshair_outline_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/crosshair_outline_large.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/crosshair_outline_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/crosshair_outline_small.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/crosshair_red_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/crosshair_red_large.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/crosshair_red_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/crosshair_red_small.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/crosshair_white_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/crosshair_white_large.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/crosshair_white_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/crosshair_white_small.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/icon_bullet_empty_long.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/icon_bullet_empty_long.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/icon_bullet_empty_short.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/icon_bullet_empty_short.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/icon_bullet_gold_long.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/icon_bullet_gold_long.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/icon_bullet_gold_short.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/icon_bullet_gold_short.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/icon_bullet_silver_long.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/icon_bullet_silver_long.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/icon_bullet_silver_short.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/icon_bullet_silver_short.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/icon_duck.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/icon_duck.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/icon_target.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/icon_target.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/text_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/text_0.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/text_0_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/text_0_small.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/text_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/text_1.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/text_1_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/text_1_small.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/text_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/text_2.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/text_2_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/text_2_small.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/text_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/text_3.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/text_3_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/text_3_small.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/text_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/text_4.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/text_4_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/text_4_small.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/text_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/text_5.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/text_5_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/text_5_small.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/text_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/text_6.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/text_6_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/text_6_small.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/text_7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/text_7.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/text_7_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/text_7_small.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/text_8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/text_8.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/text_8_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/text_8_small.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/text_9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/text_9.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/text_9_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/text_9_small.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/text_cross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/text_cross.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/text_cross_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/text_cross_small.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/text_dots.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/text_dots.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/text_dots_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/text_dots_small.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/text_gameover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/text_gameover.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/text_go.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/text_go.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/text_plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/text_plus.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/text_plus_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/text_plus_small.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/text_ready.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/text_ready.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/text_score.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/text_score.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/text_score_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/text_score_small.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/HUD/text_timeup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/HUD/text_timeup.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Objects/duck_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Objects/duck_back.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Objects/duck_brown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Objects/duck_brown.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Objects/duck_outline_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Objects/duck_outline_back.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Objects/duck_outline_brown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Objects/duck_outline_brown.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Objects/duck_outline_target_brown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Objects/duck_outline_target_brown.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Objects/duck_outline_target_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Objects/duck_outline_target_white.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Objects/duck_outline_target_yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Objects/duck_outline_target_yellow.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Objects/duck_outline_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Objects/duck_outline_white.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Objects/duck_outline_yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Objects/duck_outline_yellow.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Objects/duck_target_brown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Objects/duck_target_brown.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Objects/duck_target_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Objects/duck_target_white.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Objects/duck_target_yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Objects/duck_target_yellow.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Objects/duck_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Objects/duck_white.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Objects/duck_yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Objects/duck_yellow.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Objects/rifle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Objects/rifle.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Objects/rifle_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Objects/rifle_red.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Objects/shot_blue_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Objects/shot_blue_large.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Objects/shot_blue_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Objects/shot_blue_small.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Objects/shot_brown_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Objects/shot_brown_large.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Objects/shot_brown_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Objects/shot_brown_small.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Objects/shot_grey_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Objects/shot_grey_large.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Objects/shot_grey_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Objects/shot_grey_small.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Objects/shot_yellow_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Objects/shot_yellow_large.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Objects/shot_yellow_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Objects/shot_yellow_small.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Objects/stick_metal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Objects/stick_metal.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Objects/stick_metal_broken.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Objects/stick_metal_broken.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Objects/stick_metal_outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Objects/stick_metal_outline.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Objects/stick_metal_outline_broken.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Objects/stick_metal_outline_broken.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Objects/stick_wood.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Objects/stick_wood.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Objects/stick_woodFixed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Objects/stick_woodFixed.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Objects/stick_woodFixed_outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Objects/stick_woodFixed_outline.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Objects/stick_wood_broken.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Objects/stick_wood_broken.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Objects/stick_wood_outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Objects/stick_wood_outline.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Objects/stick_wood_outline_broken.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Objects/stick_wood_outline_broken.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Objects/target_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Objects/target_back.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Objects/target_back_outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Objects/target_back_outline.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Objects/target_colored.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Objects/target_colored.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Objects/target_colored_outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Objects/target_colored_outline.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Objects/target_red1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Objects/target_red1.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Objects/target_red1_outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Objects/target_red1_outline.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Objects/target_red2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Objects/target_red2.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Objects/target_red2_outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Objects/target_red2_outline.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Objects/target_red3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Objects/target_red3.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Objects/target_red3_outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Objects/target_red3_outline.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Objects/target_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Objects/target_white.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Objects/target_white_outline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Objects/target_white_outline.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Stall/bg_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Stall/bg_blue.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Stall/bg_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Stall/bg_green.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Stall/bg_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Stall/bg_red.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Stall/bg_wood.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Stall/bg_wood.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Stall/cloud1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Stall/cloud1.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Stall/cloud2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Stall/cloud2.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Stall/curtain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Stall/curtain.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Stall/curtain_rope.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Stall/curtain_rope.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Stall/curtain_straight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Stall/curtain_straight.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Stall/curtain_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Stall/curtain_top.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Stall/grass1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Stall/grass1.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Stall/grass2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Stall/grass2.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Stall/tree_oak.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Stall/tree_oak.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Stall/tree_pine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Stall/tree_pine.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Stall/water1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Stall/water1.png -------------------------------------------------------------------------------- /shooter-game/assets/PNG/Stall/water2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/PNG/Stall/water2.png -------------------------------------------------------------------------------- /shooter-game/assets/generate.go: -------------------------------------------------------------------------------- 1 | //go:generate file2byteslice -input ./hud.png -output hud.go -package assets -var hudBytes 2 | //go:generate file2byteslice -input ./objects.png -output objects.go -package assets -var objectsBytes 3 | //go:generate file2byteslice -input ./stall.png -output stall.go -package assets -var stallBytes 4 | //go:generate file2byteslice -input ./hit.wav -output hit_sound.go -package assets -var HitSound 5 | //go:generate file2byteslice -input ./miss.wav -output miss_sound.go -package assets -var MissSound 6 | //go:generate file2byteslice -input ./ragtime.ogg -output ragtime_sound.go -package assets -var RagtimeSound 7 | package assets 8 | -------------------------------------------------------------------------------- /shooter-game/assets/hit.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/hit.wav -------------------------------------------------------------------------------- /shooter-game/assets/hud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/hud.png -------------------------------------------------------------------------------- /shooter-game/assets/miss.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/miss.wav -------------------------------------------------------------------------------- /shooter-game/assets/objects.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/objects.png -------------------------------------------------------------------------------- /shooter-game/assets/ragtime.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/ragtime.ogg -------------------------------------------------------------------------------- /shooter-game/assets/stall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/shooter-game/assets/stall.png -------------------------------------------------------------------------------- /shooter-game/cmd/shooter/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "log" 5 | "math/rand" 6 | "time" 7 | 8 | "github.com/develersrl/golab2020-go-game-dev/shooter-game" 9 | ) 10 | 11 | func main() { 12 | rand.Seed(time.Now().Unix()) 13 | game := shooter.NewGame() 14 | if err := game.Run(); err != nil { 15 | log.Fatalf("Game error: %v", err) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /shooter-game/objects/objects.go: -------------------------------------------------------------------------------- 1 | package objects 2 | 3 | import "github.com/hajimehoshi/ebiten" 4 | 5 | type Object interface { 6 | Update(*ebiten.Image, uint) // tell the object a new tick happened 7 | Draw(*ebiten.Image) error // draw the object 8 | OnScreen() bool // false when the object is out of the screen 9 | } 10 | 11 | type direction int // use custom type for direction, so we can add methods to it 12 | 13 | const ( 14 | right direction = 1 15 | left direction = -1 16 | down direction = 1 17 | up direction = -1 18 | ) 19 | 20 | func (d direction) invert() direction { 21 | return -d 22 | } 23 | -------------------------------------------------------------------------------- /shooter-game/utils/image.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "fmt" 5 | "image" 6 | 7 | "github.com/develersrl/golab2020-go-game-dev/shooter-game/assets" 8 | "github.com/hajimehoshi/ebiten" 9 | ) 10 | 11 | func GetImage(name string, obj *assets.Object) (*ebiten.Image, error) { 12 | var rect image.Rectangle 13 | var found bool 14 | for _, img := range obj.Specs.Images { 15 | if img.Name == name { 16 | rect = image.Rect(img.X, img.Y, img.X+img.W, img.Y+img.H) 17 | found = true 18 | break 19 | } 20 | } 21 | if !found { 22 | return nil, fmt.Errorf("not found in %s", obj.Name) 23 | } 24 | img := obj.Image.SubImage(rect).(*ebiten.Image) 25 | return img, nil 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/go-gl/glfw/v3.3/glfw/GLFW_C_REVISION.txt: -------------------------------------------------------------------------------- 1 | 0a49ef0a00baa3ab520ddc452f0e3b1e099c5589 2 | -------------------------------------------------------------------------------- /vendor/github.com/go-gl/glfw/v3.3/glfw/build_cgo_hack.go: -------------------------------------------------------------------------------- 1 | // +build required 2 | 3 | package glfw 4 | 5 | // This file exists purely to prevent the golang toolchain from stripping 6 | // away the c source directories and files when `go mod vendor` is used 7 | // to populate a `vendor/` directory of a project depending on `go-gl/glfw`. 8 | // 9 | // How it works: 10 | // - every directory which only includes c source files receives a dummy.go file. 11 | // - every directory we want to preserve is included here as a _ import. 12 | // - this file is given a build to exclude it from the regular build. 13 | import ( 14 | // Prevent go tooling from stripping out the c source files. 15 | _ "github.com/go-gl/glfw/v3.3/glfw/glfw/deps" 16 | _ "github.com/go-gl/glfw/v3.3/glfw/glfw/include/GLFW" 17 | _ "github.com/go-gl/glfw/v3.3/glfw/glfw/src" 18 | ) 19 | -------------------------------------------------------------------------------- /vendor/github.com/go-gl/glfw/v3.3/glfw/c_glfw.go: -------------------------------------------------------------------------------- 1 | package glfw 2 | 3 | /* 4 | #include "glfw/src/context.c" 5 | #include "glfw/src/init.c" 6 | #include "glfw/src/input.c" 7 | #include "glfw/src/monitor.c" 8 | #include "glfw/src/vulkan.c" 9 | #include "glfw/src/window.c" 10 | #include "glfw/src/osmesa_context.c" 11 | */ 12 | import "C" 13 | -------------------------------------------------------------------------------- /vendor/github.com/go-gl/glfw/v3.3/glfw/c_glfw_darwin.go: -------------------------------------------------------------------------------- 1 | package glfw 2 | 3 | /* 4 | #cgo CFLAGS: -x objective-c 5 | #include "glfw/src/cocoa_init.m" 6 | #include "glfw/src/cocoa_joystick.m" 7 | #include "glfw/src/cocoa_monitor.m" 8 | #include "glfw/src/cocoa_window.m" 9 | #include "glfw/src/cocoa_time.c" 10 | #include "glfw/src/posix_thread.c" 11 | #include "glfw/src/nsgl_context.m" 12 | #include "glfw/src/egl_context.c" 13 | */ 14 | import "C" 15 | -------------------------------------------------------------------------------- /vendor/github.com/go-gl/glfw/v3.3/glfw/c_glfw_freebsd.go: -------------------------------------------------------------------------------- 1 | // +build freebsd 2 | 3 | package glfw 4 | 5 | /* 6 | #ifdef _GLFW_WAYLAND 7 | #include "glfw/src/wl_init.c" 8 | #include "glfw/src/wl_monitor.c" 9 | #include "glfw/src/wl_window.c" 10 | #include "glfw/src/wl_platform.h" 11 | #endif 12 | #ifdef _GLFW_X11 13 | #include "glfw/src/x11_init.c" 14 | #include "glfw/src/x11_monitor.c" 15 | #include "glfw/src/x11_window.c" 16 | #include "glfw/src/glx_context.c" 17 | #endif 18 | #include "glfw/src/null_joystick.c" 19 | #include "glfw/src/posix_time.c" 20 | #include "glfw/src/posix_thread.c" 21 | #include "glfw/src/xkb_unicode.c" 22 | #include "glfw/src/egl_context.c" 23 | */ 24 | import "C" 25 | -------------------------------------------------------------------------------- /vendor/github.com/go-gl/glfw/v3.3/glfw/c_glfw_lin.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | 3 | package glfw 4 | 5 | /* 6 | #ifdef _GLFW_WAYLAND 7 | #include "glfw/src/wl_init.c" 8 | #include "glfw/src/wl_monitor.c" 9 | #include "glfw/src/wl_window.c" 10 | #include "glfw/src/wl_platform.h" 11 | #endif 12 | #ifdef _GLFW_X11 13 | #include "glfw/src/x11_init.c" 14 | #include "glfw/src/x11_monitor.c" 15 | #include "glfw/src/x11_window.c" 16 | #include "glfw/src/glx_context.c" 17 | #endif 18 | #include "glfw/src/linux_joystick.c" 19 | #include "glfw/src/posix_time.c" 20 | #include "glfw/src/posix_thread.c" 21 | #include "glfw/src/xkb_unicode.c" 22 | #include "glfw/src/egl_context.c" 23 | */ 24 | import "C" 25 | -------------------------------------------------------------------------------- /vendor/github.com/go-gl/glfw/v3.3/glfw/c_glfw_windows.go: -------------------------------------------------------------------------------- 1 | package glfw 2 | 3 | /* 4 | #include "glfw/src/win32_init.c" 5 | #include "glfw/src/win32_joystick.c" 6 | #include "glfw/src/win32_monitor.c" 7 | #include "glfw/src/win32_time.c" 8 | #include "glfw/src/win32_thread.c" 9 | #include "glfw/src/win32_window.c" 10 | #include "glfw/src/wgl_context.c" 11 | #include "glfw/src/egl_context.c" 12 | */ 13 | import "C" 14 | -------------------------------------------------------------------------------- /vendor/github.com/go-gl/glfw/v3.3/glfw/error.c: -------------------------------------------------------------------------------- 1 | #include "_cgo_export.h" 2 | 3 | void glfwSetErrorCallbackCB() { glfwSetErrorCallback((GLFWerrorfun)goErrorCB); } 4 | -------------------------------------------------------------------------------- /vendor/github.com/go-gl/glfw/v3.3/glfw/glfw/LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2002-2006 Marcus Geelnard 2 | 3 | Copyright (c) 2006-2019 Camilla Löwy 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would 16 | be appreciated but is not required. 17 | 18 | 2. Altered source versions must be plainly marked as such, and must not 19 | be misrepresented as being the original software. 20 | 21 | 3. This notice may not be removed or altered from any source 22 | distribution. 23 | 24 | -------------------------------------------------------------------------------- /vendor/github.com/go-gl/glfw/v3.3/glfw/glfw/deps/dummy.go: -------------------------------------------------------------------------------- 1 | // +build required 2 | 3 | // Package dummy prevents go tooling from stripping the c dependencies. 4 | package dummy 5 | 6 | import ( 7 | // Prevent go tooling from stripping out the c source files. 8 | _ "github.com/go-gl/glfw/v3.3/glfw/glfw/deps/glad" 9 | _ "github.com/go-gl/glfw/v3.3/glfw/glfw/deps/mingw" 10 | _ "github.com/go-gl/glfw/v3.3/glfw/glfw/deps/vs2008" 11 | ) 12 | -------------------------------------------------------------------------------- /vendor/github.com/go-gl/glfw/v3.3/glfw/glfw/deps/glad/dummy.go: -------------------------------------------------------------------------------- 1 | // +build required 2 | 3 | // Package dummy prevents go tooling from stripping the c dependencies. 4 | package dummy 5 | -------------------------------------------------------------------------------- /vendor/github.com/go-gl/glfw/v3.3/glfw/glfw/deps/mingw/dummy.go: -------------------------------------------------------------------------------- 1 | // +build required 2 | 3 | // Package dummy prevents go tooling from stripping the c dependencies. 4 | package dummy 5 | -------------------------------------------------------------------------------- /vendor/github.com/go-gl/glfw/v3.3/glfw/glfw/deps/vs2008/dummy.go: -------------------------------------------------------------------------------- 1 | // +build required 2 | 3 | // Package dummy prevents go tooling from stripping the c dependencies. 4 | package dummy 5 | -------------------------------------------------------------------------------- /vendor/github.com/go-gl/glfw/v3.3/glfw/glfw/include/GLFW/dummy.go: -------------------------------------------------------------------------------- 1 | // +build required 2 | 3 | // Package dummy prevents go tooling from stripping the c dependencies. 4 | package dummy 5 | -------------------------------------------------------------------------------- /vendor/github.com/go-gl/glfw/v3.3/glfw/glfw/src/dummy.go: -------------------------------------------------------------------------------- 1 | // +build required 2 | 3 | // Package dummy prevents go tooling from stripping the c dependencies. 4 | package dummy 5 | -------------------------------------------------------------------------------- /vendor/github.com/go-gl/glfw/v3.3/glfw/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/go-gl/glfw/v3.3/glfw 2 | 3 | go 1.10 4 | -------------------------------------------------------------------------------- /vendor/github.com/go-gl/glfw/v3.3/glfw/monitor.c: -------------------------------------------------------------------------------- 1 | #include "_cgo_export.h" 2 | 3 | GLFWmonitor *GetMonitorAtIndex(GLFWmonitor **monitors, int index) { 4 | return monitors[index]; 5 | } 6 | 7 | GLFWvidmode GetVidmodeAtIndex(GLFWvidmode *vidmodes, int index) { 8 | return vidmodes[index]; 9 | } 10 | 11 | void glfwSetMonitorCallbackCB() { 12 | glfwSetMonitorCallback((GLFWmonitorfun)goMonitorCB); 13 | } 14 | 15 | unsigned int GetGammaAtIndex(unsigned short *color, int i) { return color[i]; } 16 | 17 | void SetGammaAtIndex(unsigned short *color, int i, unsigned short value) { 18 | color[i] = value; 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/go-gl/glfw/v3.3/glfw/native_darwin.go: -------------------------------------------------------------------------------- 1 | package glfw 2 | 3 | /* 4 | #define GLFW_EXPOSE_NATIVE_COCOA 5 | #define GLFW_EXPOSE_NATIVE_NSGL 6 | #include "glfw/include/GLFW/glfw3.h" 7 | #include "glfw/include/GLFW/glfw3native.h" 8 | 9 | // workaround wrappers needed due to a cgo and/or LLVM bug. 10 | // See: https://github.com/go-gl/glfw/issues/136 11 | void *workaround_glfwGetCocoaWindow(GLFWwindow *w) { 12 | return (void *)glfwGetCocoaWindow(w); 13 | } 14 | void *workaround_glfwGetNSGLContext(GLFWwindow *w) { 15 | return (void *)glfwGetNSGLContext(w); 16 | } 17 | */ 18 | import "C" 19 | import "unsafe" 20 | 21 | // GetCocoaMonitor returns the CGDirectDisplayID of the monitor. 22 | func (m *Monitor) GetCocoaMonitor() uintptr { 23 | ret := uintptr(C.glfwGetCocoaMonitor(m.data)) 24 | panicError() 25 | return ret 26 | } 27 | 28 | // GetCocoaWindow returns the NSWindow of the window. 29 | func (w *Window) GetCocoaWindow() unsafe.Pointer { 30 | ret := C.workaround_glfwGetCocoaWindow(w.data) 31 | panicError() 32 | return ret 33 | } 34 | 35 | // GetNSGLContext returns the NSOpenGLContext of the window. 36 | func (w *Window) GetNSGLContext() unsafe.Pointer { 37 | ret := C.workaround_glfwGetNSGLContext(w.data) 38 | panicError() 39 | return ret 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/go-gl/glfw/v3.3/glfw/native_windows.go: -------------------------------------------------------------------------------- 1 | package glfw 2 | 3 | //#define GLFW_EXPOSE_NATIVE_WIN32 4 | //#define GLFW_EXPOSE_NATIVE_WGL 5 | //#define GLFW_INCLUDE_NONE 6 | //#include "glfw/include/GLFW/glfw3.h" 7 | //#include "glfw/include/GLFW/glfw3native.h" 8 | import "C" 9 | 10 | // GetWin32Adapter returns the adapter device name of the monitor. 11 | func (m *Monitor) GetWin32Adapter() string { 12 | ret := C.glfwGetWin32Adapter(m.data) 13 | panicError() 14 | return C.GoString(ret) 15 | } 16 | 17 | // GetWin32Monitor returns the display device name of the monitor. 18 | func (m *Monitor) GetWin32Monitor() string { 19 | ret := C.glfwGetWin32Monitor(m.data) 20 | panicError() 21 | return C.GoString(ret) 22 | } 23 | 24 | // GetWin32Window returns the HWND of the window. 25 | func (w *Window) GetWin32Window() C.HWND { 26 | ret := C.glfwGetWin32Window(w.data) 27 | panicError() 28 | return ret 29 | } 30 | 31 | // GetWGLContext returns the HGLRC of the window. 32 | func (w *Window) GetWGLContext() C.HGLRC { 33 | ret := C.glfwGetWGLContext(w.data) 34 | panicError() 35 | return ret 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/go-gl/glfw/v3.3/glfw/util.go: -------------------------------------------------------------------------------- 1 | package glfw 2 | 3 | //#include 4 | //#define GLFW_INCLUDE_NONE 5 | //#include "glfw/include/GLFW/glfw3.h" 6 | import "C" 7 | 8 | import ( 9 | "reflect" 10 | "unsafe" 11 | ) 12 | 13 | func glfwbool(b C.int) bool { 14 | if b == C.int(True) { 15 | return true 16 | } 17 | return false 18 | } 19 | 20 | func bytes(origin []byte) (pointer *uint8, free func()) { 21 | n := len(origin) 22 | 23 | if n == 0 { 24 | return nil, func() {} 25 | } 26 | 27 | data := C.malloc(C.size_t(n)) 28 | 29 | dataSlice := *(*[]byte)(unsafe.Pointer(&reflect.SliceHeader{ 30 | Data: uintptr(data), 31 | Len: n, 32 | Cap: n, 33 | })) 34 | 35 | copy(dataSlice, origin) 36 | 37 | return &dataSlice[0], func() { C.free(data) } 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/golang/freetype/AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of Freetype-Go authors for copyright purposes. 2 | # This file is distinct from the CONTRIBUTORS files. 3 | # See the latter for an explanation. 4 | # 5 | # Freetype-Go is derived from Freetype, which is written in C. The latter 6 | # is copyright 1996-2010 David Turner, Robert Wilhelm, and Werner Lemberg. 7 | 8 | # Names should be added to this file as 9 | # Name or Organization 10 | # The email address is not required for organizations. 11 | 12 | # Please keep the list sorted. 13 | 14 | Google Inc. 15 | Jeff R. Allen 16 | Maksim Kochkin 17 | Michael Fogleman 18 | Rémy Oudompheng 19 | Roger Peppe 20 | Steven Edwards 21 | -------------------------------------------------------------------------------- /vendor/github.com/golang/freetype/LICENSE: -------------------------------------------------------------------------------- 1 | Use of the Freetype-Go software is subject to your choice of exactly one of 2 | the following two licenses: 3 | * The FreeType License, which is similar to the original BSD license with 4 | an advertising clause, or 5 | * The GNU General Public License (GPL), version 2 or later. 6 | 7 | The text of these licenses are available in the licenses/ftl.txt and the 8 | licenses/gpl.txt files respectively. They are also available at 9 | http://freetype.sourceforge.net/license.html 10 | 11 | The Luxi fonts in the testdata directory are licensed separately. See the 12 | testdata/COPYING file for details. 13 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/.gitattributes: -------------------------------------------------------------------------------- 1 | internal/glfw/glfw/** linguist-vendored 2 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *~ 3 | *.aar 4 | *.apk 5 | .vscode 6 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Code of Conduct 2 | 3 | We obey the [Go Community Code of Conduct](https://golang.org/conduct). 4 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/audio/buffersize_mobile.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // +build android ios 16 | 17 | package audio 18 | 19 | func bufferSize() int { 20 | // From the experience of Daigo's games (e.g. Clock of Atonement), 21 | // 8192 is not enough on mobile devices. Use x1.5 value. 22 | return 12288 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/audio/buffersize_notmobile.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // +build !android 16 | // +build !ios 17 | 18 | package audio 19 | 20 | func bufferSize() int { 21 | // On most desktop environments, 4096 [bytes] is enough 22 | // but there are some known environment that is too short (e.g. Windows on Parallels). 23 | return 8192 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/audio/vorbis/generate.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | //go:generate file2byteslice -package=vorbis_test -input=./test_mono.ogg -output=./testmonoogg_test.go -var=test_mono_ogg 16 | //go:generate file2byteslice -package=vorbis_test -input=./test_tooshort.ogg -output=./testtooshortogg_test.go -var=test_tooshort_ogg 17 | //go:generate gofmt -s -w . 18 | 19 | package vorbis 20 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/audio/vorbis/internal/stb/generate.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package stb 16 | 17 | // stbvorbis.js 18 | // URL: https://github.com/hajimehoshi/stbvorbis.js 19 | // License: Apache License 2.0 20 | // Commit: ac1c2ee9d24eb6085eb1e968f55e0fb32cacc03a 21 | 22 | //go:generate file2byteslice -package=stb -input=stbvorbis.js -output=stbvorbis.js.go -var=stbvorbis_js -buildtags "js,!wasm" 23 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/audio/vorbis/test_mono.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/vendor/github.com/hajimehoshi/ebiten/audio/vorbis/test_mono.ogg -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/audio/vorbis/test_tooshort.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/vendor/github.com/hajimehoshi/ebiten/audio/vorbis/test_tooshort.ogg -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/audio/vorbis/vorbis_notgopherjs.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // +build !js wasm 16 | 17 | package vorbis 18 | 19 | import ( 20 | "github.com/jfreymuth/oggvorbis" 21 | 22 | "github.com/hajimehoshi/ebiten/audio" 23 | ) 24 | 25 | func newDecoder(in audio.ReadSeekCloser) (decoder, error) { 26 | return oggvorbis.NewReader(in) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/cursormode.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package ebiten 16 | 17 | import "github.com/hajimehoshi/ebiten/internal/driver" 18 | 19 | // A CursorModeType represents 20 | // a render and coordinate mode of a mouse cursor. 21 | type CursorModeType int 22 | 23 | // Cursor Modes 24 | const ( 25 | CursorModeVisible = CursorModeType(driver.CursorModeVisible) 26 | CursorModeHidden = CursorModeType(driver.CursorModeHidden) 27 | CursorModeCaptured = CursorModeType(driver.CursorModeCaptured) 28 | ) 29 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/debug_ebitendebug.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // +build ebitendebug 16 | 17 | package ebiten 18 | 19 | func isDebug() bool { 20 | return true 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/debug_notebitendebug.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // +build !ebitendebug 16 | 17 | package ebiten 18 | 19 | func isDebug() bool { 20 | return false 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/ebitenutil/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package ebitenutil provides utility functions for Ebiten. 16 | package ebitenutil 17 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/ebitenutil/file_js.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Hajime Hoshi 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // +build js 16 | 17 | package ebitenutil 18 | 19 | import ( 20 | "bytes" 21 | "io/ioutil" 22 | "net/http" 23 | ) 24 | 25 | type file struct { 26 | *bytes.Reader 27 | } 28 | 29 | func (f *file) Close() error { 30 | return nil 31 | } 32 | 33 | func OpenFile(path string) (ReadSeekCloser, error) { 34 | res, err := http.Get(path) 35 | if err != nil { 36 | return nil, err 37 | } 38 | body, err := ioutil.ReadAll(res.Body) 39 | if err != nil { 40 | return nil, err 41 | } 42 | f := &file{bytes.NewReader(body)} 43 | return f, nil 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/ebitenutil/file_notjs.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Hajime Hoshi 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // +build darwin freebsd linux windows 16 | // +build !js 17 | // +build !android 18 | // +build !ios 19 | 20 | package ebitenutil 21 | 22 | import ( 23 | "os" 24 | "path/filepath" 25 | ) 26 | 27 | // OpenFile opens a file and returns a stream for its data. 28 | // 29 | // The path parts should be separated with slash '/' on any environments. 30 | // 31 | // Note that this doesn't work on mobiles. 32 | func OpenFile(path string) (ReadSeekCloser, error) { 33 | return os.Open(filepath.FromSlash(path)) 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/ebitenutil/import.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package ebitenutil 16 | 17 | import ( 18 | // Import image/png for backward compatibility (#500, #516) 19 | // TODO: Deprecate and remove this at the next major version (2.0). 20 | _ "image/gif" 21 | _ "image/png" 22 | ) 23 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/ebitenutil/internal/assets/license.md: -------------------------------------------------------------------------------- 1 | # License 2 | 3 | ## text.png 4 | 5 | ``` 6 | - 7 | M+ BITMAP FONTS Copyright 2002-2005 COZ 8 | - 9 | 10 | LICENSE 11 | 12 | 13 | 14 | 15 | These fonts are free softwares. 16 | Unlimited permission is granted to use, copy, and distribute it, with 17 | or without modification, either commercially and noncommercially. 18 | THESE FONTS ARE PROVIDED "AS IS" WITHOUT WARRANTY. 19 | ``` 20 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/ebitenutil/internal/assets/text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tommyblue/golab-2020-go-game-development/5583a298d78824f898050502977a5ae42c48012e/vendor/github.com/hajimehoshi/ebiten/ebitenutil/internal/assets/text.png -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/ebitenutil/io.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Hajime Hoshi 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package ebitenutil 16 | 17 | import ( 18 | "io" 19 | ) 20 | 21 | // ReadSeekCloser is io.ReadSeeker and io.Closer. 22 | type ReadSeekCloser interface { 23 | io.ReadSeeker 24 | io.Closer 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/generate.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Hajime Hoshi 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package ebiten 16 | 17 | //go:generate go run genkeys.go 18 | //go:generate gofmt -s -w . 19 | 20 | // TODO: Add this after event package is added again (#926). 21 | // 22 | // go:generate go run genevents.go 23 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/hajimehoshi/ebiten 2 | 3 | go 1.12 4 | 5 | require ( 6 | github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200707082815-5321531c36a2 7 | github.com/gofrs/flock v0.8.0 8 | github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 9 | github.com/hajimehoshi/bitmapfont v1.3.0 10 | github.com/hajimehoshi/file2byteslice v0.0.0-20200812174855-0e5e8a80490e 11 | github.com/hajimehoshi/go-mp3 v0.3.1 12 | github.com/hajimehoshi/oto v0.6.5-0.20200917193348-57f376f2c835 13 | github.com/jakecoffman/cp v1.0.0 14 | github.com/jfreymuth/oggvorbis v1.0.1 15 | github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect 16 | golang.org/x/image v0.0.0-20200801110659-972c09e46d76 17 | golang.org/x/mobile v0.0.0-20200801112145-973feb4309de 18 | golang.org/x/sys v0.0.0-20200918174421-af09f7315aff 19 | golang.org/x/tools v0.0.0-20200918232735-d647fc253266 20 | gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b // indirect 21 | ) 22 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/goversion.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // +build go1.12 16 | 17 | package ebiten 18 | 19 | // Ebiten forces to use Go 1.12 or later, since 20 | // 1) Between Go 1.10 and Go 1.11, ioutil.TempFile's behavior is different. Ebiten forces the Go version in order to avoid confusion. (#777) 21 | // 2) FuncOf in syscall/js is defined as of Go 1.12. 22 | 23 | const __EBITEN_REQUIRES_GO_VERSION_1_12_OR_LATER__ = true 24 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/imagedumper_notdesktop.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // +build android js ios 16 | 17 | package ebiten 18 | 19 | type imageDumper struct { 20 | f func(screen *Image) error 21 | } 22 | 23 | func (i *imageDumper) update(screen *Image) error { 24 | return i.f(screen) 25 | } 26 | 27 | func (i *imageDumper) dump(screen *Image) error { 28 | // Do nothing 29 | return nil 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/init.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package ebiten 16 | 17 | import ( 18 | "github.com/hajimehoshi/ebiten/internal/graphicscommand" 19 | "github.com/hajimehoshi/ebiten/internal/mipmap" 20 | "github.com/hajimehoshi/ebiten/internal/shareable" 21 | ) 22 | 23 | var _ = __EBITEN_REQUIRES_GO_VERSION_1_12_OR_LATER__ 24 | 25 | func init() { 26 | mipmap.SetGraphicsDriver(uiDriver().Graphics()) 27 | shareable.SetGraphicsDriver(uiDriver().Graphics()) 28 | graphicscommand.SetGraphicsDriver(uiDriver().Graphics()) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/internal/affine/affine.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Hajime Hoshi 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package affine 16 | 17 | func mulSquare(lhs, rhs []float32, dim int) []float32 { 18 | result := make([]float32, len(lhs)) 19 | for i := 0; i < dim; i++ { 20 | for j := 0; j < dim; j++ { 21 | e := float32(0.0) 22 | for k := 0; k < dim; k++ { 23 | e += lhs[i*dim+k] * rhs[k*dim+j] 24 | } 25 | result[i*dim+j] = e 26 | } 27 | } 28 | return result 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/internal/clock/now_notwindows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Hajime Hoshi 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // +build !windows 16 | 17 | package clock 18 | 19 | import ( 20 | "time" 21 | ) 22 | 23 | var initTime = time.Now() 24 | 25 | func now() int64 { 26 | // time.Since() returns monotonic timer difference (#875): 27 | // https://golang.org/pkg/time/#hdr-Monotonic_Clocks 28 | return int64(time.Since(initTime)) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/internal/devicescale/devicescale.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package devicescale 16 | 17 | import ( 18 | "sync" 19 | ) 20 | 21 | type pos struct { 22 | x, y int 23 | } 24 | 25 | var ( 26 | m sync.Mutex 27 | cache = map[pos]float64{} 28 | ) 29 | 30 | func GetAt(x, y int) float64 { 31 | m.Lock() 32 | defer m.Unlock() 33 | if s, ok := cache[pos{x, y}]; ok { 34 | return s 35 | } 36 | s := impl(x, y) 37 | cache[pos{x, y}] = s 38 | return s 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/internal/devicescale/impl_ios.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 Hajime Hoshi 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // +build ios 16 | 17 | package devicescale 18 | 19 | // #cgo CFLAGS: -x objective-c 20 | // #cgo LDFLAGS: -framework Foundation -framework UIKit 21 | // 22 | // #import 23 | // 24 | // static double devicePixelRatio() { 25 | // return [[UIScreen mainScreen] nativeScale]; 26 | // } 27 | import "C" 28 | 29 | func impl(x, y int) float64 { 30 | return float64(C.devicePixelRatio()) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/internal/devicescale/impl_js.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // +build js 16 | 17 | package devicescale 18 | 19 | import ( 20 | "syscall/js" 21 | ) 22 | 23 | func impl(x, y int) float64 { 24 | ratio := js.Global().Get("window").Get("devicePixelRatio").Float() 25 | if ratio == 0 { 26 | ratio = 1 27 | } 28 | return ratio 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/internal/devicescale/impl_plan9.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // +build !js 16 | 17 | package devicescale 18 | 19 | func impl(x, y int) float64 { 20 | return 1 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/internal/driver/cursormode.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package driver 16 | 17 | type CursorMode int 18 | 19 | const ( 20 | CursorModeVisible CursorMode = 1 << iota 21 | CursorModeHidden 22 | CursorModeCaptured 23 | ) 24 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/internal/driver/filter.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package driver 16 | 17 | type Filter int 18 | 19 | const ( 20 | FilterNearest Filter = iota + 1 // TODO: Remove '+ 1' when ebiten.FilterDefault can be removed. 21 | FilterLinear 22 | FilterScreen 23 | ) 24 | 25 | type Address int 26 | 27 | const ( 28 | AddressClampToZero Address = iota 29 | AddressRepeat 30 | AddressUnsafe 31 | ) 32 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/internal/driver/input.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package driver 16 | 17 | type Input interface { 18 | CursorPosition() (x, y int) 19 | GamepadSDLID(id int) string 20 | GamepadName(id int) string 21 | GamepadAxis(id int, axis int) float64 22 | GamepadAxisNum(id int) int 23 | GamepadButtonNum(id int) int 24 | GamepadIDs() []int 25 | IsGamepadButtonPressed(id int, button GamepadButton) bool 26 | IsKeyPressed(key Key) bool 27 | IsMouseButtonPressed(button MouseButton) bool 28 | RuneBuffer() []rune 29 | TouchIDs() []int 30 | TouchPosition(id int) (x, y int) 31 | Wheel() (xoff, yoff float64) 32 | } 33 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/internal/driver/modifier.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package driver 16 | 17 | type Modifier int 18 | 19 | const ( 20 | ModifierShift Modifier = 1 << iota 21 | ModifierControl 22 | ModifierAlt 23 | ModifierCapsLock 24 | ModifierNumLock 25 | ) 26 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/internal/driver/mousebutton.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Hajime Hoshi 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package driver 16 | 17 | type MouseButton int 18 | 19 | const ( 20 | MouseButtonLeft MouseButton = iota 21 | MouseButtonRight 22 | MouseButtonMiddle 23 | ) 24 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/internal/glfw/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:testing 2 | 3 | RUN apt-get update && apt-get install -y \ 4 | ca-certificates \ 5 | golang \ 6 | gcc-mingw-w64=10.1.0-3+23 \ 7 | && rm -rf /var/lib/apt/lists/* 8 | 9 | WORKDIR /work 10 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/internal/glfw/gen.sh: -------------------------------------------------------------------------------- 1 | docker run --rm --volume $(pwd)/../..:/work $(docker build -q .) /bin/bash -c "cd ./internal/glfw; go run gen.go" 2 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/internal/glfw/generate.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | //go:generate sh ./gen.sh 16 | 17 | package glfw 18 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/internal/glfw/native_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package glfw 16 | 17 | func (w *Window) GetCocoaWindow() uintptr { 18 | return uintptr(w.w.GetCocoaWindow()) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/internal/glfw/native_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package glfw 16 | 17 | func (w *Window) GetWin32Window() uintptr { 18 | r := glfwDLL.call("glfwGetWin32Window", w.w) 19 | panicError() 20 | return r 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/internal/glfw/type.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // +build !js 16 | 17 | package glfw 18 | 19 | type ( 20 | CharModsCallback func(w *Window, char rune, mods ModifierKey) 21 | FramebufferSizeCallback func(w *Window, width int, height int) 22 | ScrollCallback func(w *Window, xoff float64, yoff float64) 23 | SizeCallback func(w *Window, width int, height int) 24 | ) 25 | 26 | type VidMode struct { 27 | Width int 28 | Height int 29 | RedBits int 30 | GreenBits int 31 | BlueBits int 32 | RefreshRate int 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/internal/graphics/math.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Hajime Hoshi 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package graphics 16 | 17 | // InternalImageSize returns a nearest appropriate size as an internal image. 18 | func InternalImageSize(x int) int { 19 | // minInternalImageSize is the minimum size of internal images (texture/framebuffer). 20 | // 21 | // For example, the image size less than 15 is not supported on some iOS devices. 22 | // See also: https://stackoverflow.com/questions/15935651 23 | const minInternalImageSize = 16 24 | 25 | if x <= 0 { 26 | panic("graphics: x must be positive") 27 | } 28 | if x < minInternalImageSize { 29 | return minInternalImageSize 30 | } 31 | r := 1 32 | for r < x { 33 | r <<= 1 34 | } 35 | return r 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/internal/graphicscommand/debug_ebitendebug.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // +build ebitendebug 16 | 17 | package graphicscommand 18 | 19 | func recordLog() bool { 20 | return true 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/internal/graphicscommand/debug_notebitendebug.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // +build !ebitendebug 16 | 17 | package graphicscommand 18 | 19 | func recordLog() bool { 20 | return false 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/internal/graphicscommand/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package graphicscommand represents a low layer for graphics using OpenGL. 16 | package graphicscommand 17 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/internal/graphicscommand/shader.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package graphicscommand 16 | 17 | import ( 18 | "github.com/hajimehoshi/ebiten/internal/driver" 19 | "github.com/hajimehoshi/ebiten/internal/shaderir" 20 | ) 21 | 22 | type Shader struct { 23 | shader driver.Shader 24 | } 25 | 26 | func NewShader(ir *shaderir.Program) *Shader { 27 | s := &Shader{} 28 | c := &newShaderCommand{ 29 | result: s, 30 | ir: ir, 31 | } 32 | theCommandQueue.Enqueue(c) 33 | return s 34 | } 35 | 36 | func (s *Shader) Dispose() { 37 | c := &disposeShaderCommand{ 38 | target: s, 39 | } 40 | theCommandQueue.Enqueue(c) 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/internal/graphicsdriver/metal/README.md: -------------------------------------------------------------------------------- 1 | These packages are copied from Dmitri Shuralyov's mtl packages and edited with Dmitri's permission: 2 | 3 | * `github.com/hajimehoshi/ebiten/internal/graphicsdriver/metal/ca` (copied from `dmitri.shuralyov.com/gpu/mtl/example/movingtriangle/internal/ca`) 4 | * `github.com/hajimehoshi/ebiten/internal/graphicsdriver/metal/mtl` (copied from `dmitri.shuralyov.com/gpu/mtl`) 5 | * `github.com/hajimehoshi/ebiten/internal/graphicsdriver/metal/ns` (copied from `dmitri.shuralyov.com/gpu/mtl/example/movingtriangle/internal/ns`) 6 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/internal/graphicsdriver/metal/ns/ns.h: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // +build darwin 16 | 17 | #include "stdint.h" 18 | 19 | void *Window_ContentView(uintptr_t window); 20 | 21 | void View_SetLayer(void *view, void *layer); 22 | void View_SetWantsLayer(void *view, unsigned char wantsLayer); 23 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/internal/graphicsdriver/metal/ns/ns.m: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // +build darwin 16 | 17 | #include "ns.h" 18 | #import 19 | 20 | void *Window_ContentView(uintptr_t window) { 21 | return ((NSWindow *)window).contentView; 22 | } 23 | 24 | void View_SetLayer(void *view, void *layer) { 25 | ((NSView *)view).layer = (CALayer *)layer; 26 | } 27 | 28 | void View_SetWantsLayer(void *view, unsigned char wantsLayer) { 29 | ((NSView *)view).wantsLayer = (BOOL)wantsLayer; 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/internal/graphicsdriver/opengl/bytes.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // +build android ios 16 | 17 | package opengl 18 | 19 | import ( 20 | "reflect" 21 | "unsafe" 22 | ) 23 | 24 | func float32sToBytes(v []float32) []byte { 25 | f32h := (*reflect.SliceHeader)(unsafe.Pointer(&v)) 26 | 27 | var b []byte 28 | bh := (*reflect.SliceHeader)(unsafe.Pointer(&b)) 29 | bh.Data = f32h.Data 30 | bh.Len = len(v) * 4 31 | bh.Cap = len(v) * 4 32 | return b 33 | } 34 | 35 | func uint16sToBytes(v []uint16) []byte { 36 | u16h := (*reflect.SliceHeader)(unsafe.Pointer(&v)) 37 | 38 | var b []byte 39 | bh := (*reflect.SliceHeader)(unsafe.Pointer(&b)) 40 | bh.Data = u16h.Data 41 | bh.Len = len(v) * 2 42 | bh.Cap = len(v) * 2 43 | return b 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/internal/graphicsdriver/opengl/context_notx.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // +build android js !freebsd,!linux 16 | 17 | package opengl 18 | 19 | func isPBOAvailable() bool { 20 | return true 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/internal/graphicsdriver/opengl/gl/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Eric Woroshow 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/internal/graphicsdriver/opengl/gl/README.md: -------------------------------------------------------------------------------- 1 | This is a fork of `github.com/go-gl/gl/v2.1/gl` with the below patch. This is now modified manually. 2 | 3 | The original version is generated from `github.com/hajimehoshi/glow`'s `nocgo` branch. This enables to remove dependencies on Cgo on Windows. 4 | 5 | Now we are working on commiting this 'no-cgo' change to the official gl package. See https://github.com/go-gl/glow/pull/102. 6 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/internal/graphicsdriver/opengl/gl/package_x.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | // +build !js 4 | // +build freebsd linux 5 | 6 | package gl 7 | 8 | // #include 9 | // 10 | // static const char* RendererDeviceString() { 11 | // #ifdef GLX_MESA_query_renderer 12 | // static PFNGLXQUERYCURRENTRENDERERSTRINGMESAPROC queryString; 13 | // if (!queryString) { 14 | // queryString = (PFNGLXQUERYCURRENTRENDERERSTRINGMESAPROC) 15 | // glXGetProcAddressARB((const GLubyte *)"glXQueryCurrentRendererStringMESA"); 16 | // } 17 | // if (!queryString) { 18 | // return ""; 19 | // } 20 | // 21 | // static const char* rendererDevice; 22 | // if (!rendererDevice) { 23 | // rendererDevice = queryString(GLX_RENDERER_DEVICE_ID_MESA); 24 | // } 25 | // 26 | // return rendererDevice; 27 | // #else 28 | // return ""; 29 | // #endif 30 | // } 31 | import "C" 32 | 33 | func RendererDeviceString() string { 34 | return C.GoString(C.RendererDeviceString()) 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/internal/graphicsdriver/opengl/gl/procaddr_windows.go: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | package gl 4 | 5 | import ( 6 | "unsafe" 7 | 8 | "golang.org/x/sys/windows" 9 | ) 10 | 11 | var ( 12 | opengl32 = windows.NewLazySystemDLL("opengl32") 13 | wglGetProcAddress = opengl32.NewProc("wglGetProcAddress") 14 | ) 15 | 16 | func getProcAddress(namea string) uintptr { 17 | cname, err := windows.BytePtrFromString(namea) 18 | if err != nil { 19 | panic(err) 20 | } 21 | if r, _, _ := wglGetProcAddress.Call(uintptr(unsafe.Pointer(cname))); r != 0 { 22 | return r 23 | } 24 | p := opengl32.NewProc(namea) 25 | if err := p.Find(); err != nil { 26 | // The proc is not found. 27 | return 0 28 | } 29 | return p.Addr() 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/internal/graphicsdriver/opengl/graphics_mobile.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // +build android ios 16 | 17 | package opengl 18 | 19 | import ( 20 | "golang.org/x/mobile/gl" 21 | ) 22 | 23 | func (g *Graphics) SetMobileGLContext(context gl.Context) { 24 | g.context.gl = context 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/internal/graphicsdriver/opengl/types.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 Hajime Hoshi 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package opengl 16 | 17 | import ( 18 | "fmt" 19 | ) 20 | 21 | type ( 22 | shaderType int 23 | bufferType int 24 | bufferUsage int 25 | operation int 26 | ) 27 | 28 | type dataType int 29 | 30 | func (d dataType) SizeInBytes() int { 31 | switch d { 32 | case short: 33 | return 2 34 | case float: 35 | return 4 36 | default: 37 | panic(fmt.Sprintf("opengl: invalid data type: %d", d)) 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/internal/jsutil/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // This can be compiled in non-JS environments to avoid a mysterious error: 'no Go source files' 16 | // See https://travis-ci.org/hajimehoshi/ebiten/builds/603539948 17 | 18 | // Package jsutil offers utility functions for GopherJS and Wasm. 19 | package jsutil 20 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/internal/jsutil/equalgo113_js.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // +build !go1.14 16 | 17 | package jsutil 18 | 19 | import ( 20 | "syscall/js" 21 | ) 22 | 23 | func Equal(a, b js.Value) bool { 24 | return a == b 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/internal/jsutil/equalgo114_js.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // +build go1.14 16 | 17 | package jsutil 18 | 19 | import ( 20 | "syscall/js" 21 | ) 22 | 23 | func Equal(a, b js.Value) bool { 24 | return a.Equal(b) 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/internal/png/generate.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | //go:generate go run gen.go 16 | 17 | // This package is a copy of the standard lib 'image/png' without registering 18 | // the decoder by image.RegisterFormat. Thus, users of this package don't 19 | // have to care about side-effect of registering format. 20 | 21 | package png 22 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/internal/png/stdlibfuzz.go: -------------------------------------------------------------------------------- 1 | // Code generated by gen.go. DO NOT EDIT. 2 | 3 | // Copyright 2019 The Go Authors. All rights reserved. 4 | // Use of this source code is governed by a BSD-style 5 | // license that can be found in the LICENSE file. 6 | 7 | // +build gofuzz 8 | 9 | package png 10 | 11 | import ( 12 | "bytes" 13 | "fmt" 14 | ) 15 | 16 | func Fuzz(data []byte) int { 17 | cfg, err := DecodeConfig(bytes.NewReader(data)) 18 | if err != nil { 19 | return 0 20 | } 21 | if cfg.Width*cfg.Height > 1e6 { 22 | return 0 23 | } 24 | img, err := Decode(bytes.NewReader(data)) 25 | if err != nil { 26 | return 0 27 | } 28 | levels := []CompressionLevel{ 29 | DefaultCompression, 30 | NoCompression, 31 | BestSpeed, 32 | BestCompression, 33 | } 34 | for _, l := range levels { 35 | var w bytes.Buffer 36 | e := &Encoder{CompressionLevel: l} 37 | err = e.Encode(&w, img) 38 | if err != nil { 39 | panic(err) 40 | } 41 | img1, err := Decode(&w) 42 | if err != nil { 43 | panic(err) 44 | } 45 | got := img1.Bounds() 46 | want := img.Bounds() 47 | if !got.Eq(want) { 48 | fmt.Printf("bounds0: %#v\n", want) 49 | fmt.Printf("bounds1: %#v\n", got) 50 | panic("bounds have changed") 51 | } 52 | } 53 | return 1 54 | } 55 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/internal/restorable/const_android.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package restorable 16 | 17 | const needsDisposingWhenRestoring = true 18 | 19 | const canDetectContextLostExplicitly = true 20 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/internal/restorable/const_js.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // +build js 16 | 17 | package restorable 18 | 19 | // needsDisposingWhenRestoring reports whether disposing resources is necessary or not when restoring. 20 | // 21 | // On browsers, disposing resources is not required since the objects are already managed by JavaScript GC and they 22 | // are already invalidated. Rather, disposing them when restoring causes warnings on the console. 23 | const needsDisposingWhenRestoring = false 24 | 25 | // canDetectContextLostExplicitly reports whether the context lost can be detected by handlers in an explicit way. 26 | const canDetectContextLostExplicitly = true 27 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/internal/restorable/const_others.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // +build !android 16 | // +build !js 17 | 18 | package restorable 19 | 20 | const needsDisposingWhenRestoring = true 21 | 22 | const canDetectContextLostExplicitly = false 23 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/internal/uidriver/glfw/graphics_opengl.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // +build freebsd linux windows ebitengl 16 | // +build !js 17 | 18 | package glfw 19 | 20 | import ( 21 | "github.com/hajimehoshi/ebiten/internal/driver" 22 | "github.com/hajimehoshi/ebiten/internal/graphicsdriver/opengl" 23 | ) 24 | 25 | func (*UserInterface) Graphics() driver.Graphics { 26 | return opengl.Get() 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/internal/uidriver/glfw/hideconsole_notwindows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // +build !windows js 16 | 17 | package glfw 18 | 19 | // hideConsoleWindowOnWindows does nothing on non-Windows systems. 20 | func hideConsoleWindowOnWindows() {} 21 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/internal/uidriver/mobile/graphics_ios.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // +build ios,arm ios,arm64 16 | // +build !ebitengl 17 | 18 | package mobile 19 | 20 | import ( 21 | "fmt" 22 | 23 | "github.com/hajimehoshi/ebiten/internal/driver" 24 | "github.com/hajimehoshi/ebiten/internal/graphicsdriver/metal" 25 | "github.com/hajimehoshi/ebiten/internal/graphicsdriver/metal/mtl" 26 | ) 27 | 28 | func (*UserInterface) Graphics() driver.Graphics { 29 | if _, err := mtl.CreateSystemDefaultDevice(); err != nil { 30 | panic(fmt.Sprintf("ebiten: mtl.CreateSystemDefaultDevice failed on iOS: %v", err)) 31 | } 32 | return metal.Get() 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/internal/uidriver/mobile/graphics_opengl.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // +build android ios,386 ios,amd64 ios,ebitengl 16 | 17 | package mobile 18 | 19 | import ( 20 | "github.com/hajimehoshi/ebiten/internal/driver" 21 | "github.com/hajimehoshi/ebiten/internal/graphicsdriver/opengl" 22 | ) 23 | 24 | func (*UserInterface) Graphics() driver.Graphics { 25 | return opengl.Get() 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/internal/web/notjs.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // +build !js 16 | 17 | package web 18 | 19 | func IsBrowser() bool { 20 | return false 21 | } 22 | 23 | func IsGopherJS() bool { 24 | return false 25 | } 26 | 27 | func IsIOSSafari() bool { 28 | return false 29 | } 30 | 31 | func IsAndroidChrome() bool { 32 | return false 33 | } 34 | 35 | func IsMobileBrowser() bool { 36 | return false 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/mousebuttons.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Hajime Hoshi 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package ebiten 16 | 17 | import ( 18 | "github.com/hajimehoshi/ebiten/internal/driver" 19 | ) 20 | 21 | // A MouseButton represents a mouse button. 22 | type MouseButton int 23 | 24 | // MouseButtons 25 | const ( 26 | MouseButtonLeft MouseButton = MouseButton(driver.MouseButtonLeft) 27 | MouseButtonRight MouseButton = MouseButton(driver.MouseButtonRight) 28 | MouseButtonMiddle MouseButton = MouseButton(driver.MouseButtonMiddle) 29 | ) 30 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/text/advance.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package text 16 | 17 | import ( 18 | "golang.org/x/image/font" 19 | "golang.org/x/image/math/fixed" 20 | ) 21 | 22 | var glyphAdvanceCache = map[font.Face]map[rune]fixed.Int26_6{} 23 | 24 | func glyphAdvance(face font.Face, r rune) fixed.Int26_6 { 25 | m, ok := glyphAdvanceCache[face] 26 | if !ok { 27 | m = map[rune]fixed.Int26_6{} 28 | glyphAdvanceCache[face] = m 29 | } 30 | 31 | a, ok := m[r] 32 | if !ok { 33 | a, _ = face.GlyphAdvance(r) 34 | m[r] = a 35 | } 36 | 37 | return a 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/uidriver_glfw.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // +build darwin freebsd linux windows 16 | // +build !android 17 | // +build !ios 18 | // +build !js 19 | 20 | package ebiten 21 | 22 | import ( 23 | "github.com/hajimehoshi/ebiten/internal/driver" 24 | "github.com/hajimehoshi/ebiten/internal/uidriver/glfw" 25 | ) 26 | 27 | func uiDriver() driver.UI { 28 | return glfw.Get() 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/uidriver_js.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // +build js 16 | 17 | package ebiten 18 | 19 | import ( 20 | "github.com/hajimehoshi/ebiten/internal/driver" 21 | "github.com/hajimehoshi/ebiten/internal/uidriver/js" 22 | ) 23 | 24 | func uiDriver() driver.UI { 25 | return js.Get() 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/ebiten/uidriver_mobile.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Ebiten Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // +build android ios 16 | 17 | package ebiten 18 | 19 | import ( 20 | "github.com/hajimehoshi/ebiten/internal/driver" 21 | "github.com/hajimehoshi/ebiten/internal/uidriver/mobile" 22 | ) 23 | 24 | func uiDriver() driver.UI { 25 | return mobile.Get() 26 | } 27 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/oto/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *~ 3 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/oto/AUTHORS: -------------------------------------------------------------------------------- 1 | Christopher Cooper 2 | Diane 3 | Hajime Hoshi 4 | Ilya 5 | Medusalix <8124898+medusalix@users.noreply.github.com> 6 | Michal Štrba 7 | Noofbiz 8 | Yosuke Akatsuka 9 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/oto/README.md: -------------------------------------------------------------------------------- 1 | # Oto (音) 2 | 3 | [![GoDoc](https://godoc.org/github.com/hajimehoshi/oto?status.svg)](http://godoc.org/github.com/hajimehoshi/oto) 4 | 5 | A low-level library to play sound. This package offers `io.WriteCloser` to play PCM sound. 6 | 7 | ## Platforms 8 | 9 | * Windows 10 | * macOS 11 | * Linux 12 | * FreeBSD 13 | * OpenBSD 14 | * Android 15 | * iOS 16 | * Web browsers ([GopherJS](https://github.com/gopherjs/gopherjs) and WebAssembly) 17 | 18 | ## Prerequisite 19 | 20 | ### macOS 21 | 22 | Oto requies `AudioToolbox.framework`, but this is automatically linked. 23 | 24 | ### iOS 25 | 26 | Oto requies these frameworks: 27 | 28 | * `AVFoundation.framework` 29 | * `AudioToolbox.framework` 30 | 31 | Add them to "Linked Frameworks and Libraries" on your Xcode project. 32 | 33 | ### Linux 34 | 35 | libasound2-dev is required. On Ubuntu or Debian, run this command: 36 | 37 | ```sh 38 | apt install libasound2-dev 39 | ``` 40 | 41 | In most cases this command must be run by root user or through `sudo` command. 42 | 43 | ### FreeBSD 44 | 45 | OpenAL is required. Install openal-soft: 46 | 47 | ```sh 48 | pkg install openal-soft 49 | ``` 50 | 51 | ### OpenBSD 52 | 53 | OpenAL is required. Install openal: 54 | 55 | ```sh 56 | pkg_add -r openal 57 | ``` 58 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/oto/driver_ios.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Oto Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // +build darwin,ios 16 | // +build !js 17 | 18 | package oto 19 | 20 | // #cgo LDFLAGS: -framework Foundation -framework AVFoundation -framework UIKit 21 | // 22 | // #import 23 | import "C" 24 | 25 | func componentSubType() C.OSType { 26 | return C.kAudioUnitSubType_RemoteIO 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/oto/driver_macos.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Oto Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // +build darwin,!ios 16 | // +build !js 17 | 18 | package oto 19 | 20 | // #cgo LDFLAGS: -framework AppKit 21 | // 22 | // #import 23 | import "C" 24 | 25 | func componentSubType() C.OSType { 26 | return C.kAudioUnitSubType_DefaultOutput 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/oto/equalgo113_js.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Oto Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // +build !go1.14 16 | 17 | package oto 18 | 19 | import ( 20 | "syscall/js" 21 | ) 22 | 23 | func valueEqual(a, b js.Value) bool { 24 | return a == b 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/oto/equalgo114_js.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Oto Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // +build go1.14 16 | 17 | package oto 18 | 19 | import ( 20 | "syscall/js" 21 | ) 22 | 23 | func valueEqual(a, b js.Value) bool { 24 | return a.Equal(b) 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/oto/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/hajimehoshi/oto 2 | 3 | go 1.12 4 | 5 | require ( 6 | golang.org/x/mobile v0.0.0-20190415191353-3e0bab5405d6 7 | golang.org/x/sys v0.0.0-20190429190828-d89cdac9e872 8 | ) 9 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/oto/go.sum: -------------------------------------------------------------------------------- 1 | golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8 h1:idBdZTd9UioThJp8KpM/rTSinK/ChZFBE43/WtIy8zg= 2 | golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= 3 | golang.org/x/image v0.0.0-20190227222117-0694c2d4d067 h1:KYGJGHOQy8oSi1fDlSpcZF0+juKwk/hEMv5SiwHogR0= 4 | golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= 5 | golang.org/x/mobile v0.0.0-20190415191353-3e0bab5405d6 h1:vyLBGJPIl9ZYbcQFM2USFmJBK6KI+t+z6jL0lbwjrnc= 6 | golang.org/x/mobile v0.0.0-20190415191353-3e0bab5405d6/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= 7 | golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 8 | golang.org/x/sys v0.0.0-20190429190828-d89cdac9e872 h1:cGjJzUd8RgBw428LXP65YXni0aiGNA4Bl+ls8SmLOm8= 9 | golang.org/x/sys v0.0.0-20190429190828-d89cdac9e872/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 10 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 11 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/oto/go112_js.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Oto Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // +build !go1.13 !wasm 16 | 17 | package oto 18 | 19 | import ( 20 | "syscall/js" 21 | ) 22 | 23 | func float32SliceToTypedArray(s []float32) (js.Value, func()) { 24 | // Note that TypedArrayOf cannot work correcly on Wasm. 25 | // See https://github.com/golang/go/issues/31980 26 | 27 | a := js.TypedArrayOf(s) 28 | return a.Value, func() { a.Release() } 29 | } 30 | 31 | func copyFloat32sToJS(v js.Value, s []float32) { 32 | panic("oto: copyFloat32sToJS is not implemented on Go 1.12 or older") 33 | } 34 | 35 | func isAudioWorkletAvailable() bool { 36 | // As copyFloat32sToJS is not implemented on Go 1.12 or older, Audio Worklet is not available. 37 | return false 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/hajimehoshi/oto/pipe_notgopherjs.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Oto Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // +build !js js,wasm 16 | 17 | package oto 18 | 19 | import ( 20 | "io" 21 | ) 22 | 23 | func pipe() (io.ReadCloser, io.WriteCloser) { 24 | return io.Pipe() 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/jfreymuth/oggvorbis/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Johann Freymuth 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/jfreymuth/oggvorbis/README.md: -------------------------------------------------------------------------------- 1 | # oggvorbis 2 | a native go ogg/vorbis decoder 3 | 4 | [![GoDoc](https://godoc.org/github.com/jfreymuth/oggvorbis?status.svg)](https://godoc.org/github.com/jfreymuth/oggvorbis) 5 | 6 | ## Usage 7 | 8 | This package provides the type oggvorbis.Reader, which can be used to read .ogg files. 9 | 10 | r, err := oggvorbis.NewReader(reader) 11 | // handle error 12 | 13 | fmt.Println(r.SampleRate()) 14 | fmt.Println(r.Channels()) 15 | 16 | buffer := make([]float32, 8192) 17 | for { 18 | n, err := r.Read(buffer) 19 | 20 | // use buffer[:n] 21 | 22 | if err == io.EOF { 23 | break 24 | } 25 | if err != nil { 26 | // handle error 27 | } 28 | } 29 | 30 | The reader also provides methods for seeking, these will only work if the reader 31 | was created from an io.ReadSeeker. 32 | 33 | There are also convenience functions to read an entire (small) file, similar to ioutil.ReadAll. 34 | 35 | data, format, err := oggvorbis.ReadAll(reader) 36 | -------------------------------------------------------------------------------- /vendor/github.com/jfreymuth/oggvorbis/crc.go: -------------------------------------------------------------------------------- 1 | package oggvorbis 2 | 3 | var crcTable [256]uint32 4 | 5 | func init() { 6 | for i := range crcTable { 7 | r := uint32(i) << 24 8 | for j := 0; j < 8; j++ { 9 | if r&0x80000000 != 0 { 10 | r = (r << 1) ^ 0x04c11db7 11 | } else { 12 | r <<= 1 13 | } 14 | } 15 | crcTable[i] = r 16 | } 17 | } 18 | 19 | func crcUpdate(crc uint32, data []byte) uint32 { 20 | for _, b := range data { 21 | crc = (crc << 8) ^ crcTable[byte(crc>>24)^b] 22 | } 23 | return crc 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/jfreymuth/oggvorbis/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package oggvorbis decodes audio from ogg/vorbis files. 3 | */ 4 | package oggvorbis // import "github.com/jfreymuth/oggvorbis" 5 | -------------------------------------------------------------------------------- /vendor/github.com/jfreymuth/oggvorbis/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/jfreymuth/oggvorbis 2 | 3 | require github.com/jfreymuth/vorbis v1.0.0 4 | -------------------------------------------------------------------------------- /vendor/github.com/jfreymuth/oggvorbis/go.sum: -------------------------------------------------------------------------------- 1 | github.com/jfreymuth/vorbis v1.0.0 h1:SmDf783s82lIjGZi8EGUUaS7YxPHgRj4ZXW/h7rUi7U= 2 | github.com/jfreymuth/vorbis v1.0.0/go.mod h1:8zy3lUAm9K/rJJk223RKy6vjCZTWC61NA2QD06bfOE0= 3 | -------------------------------------------------------------------------------- /vendor/github.com/jfreymuth/vorbis/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go -------------------------------------------------------------------------------- /vendor/github.com/jfreymuth/vorbis/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Johann Freymuth 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/jfreymuth/vorbis/README.md: -------------------------------------------------------------------------------- 1 | # vorbis [![Build Status](https://travis-ci.org/jfreymuth/vorbis.svg)](https://travis-ci.org/jfreymuth/vorbis) 2 | 3 | a native go vorbis decoder 4 | 5 | Note that this package can only decode raw vorbis packets, for reading .ogg files, use [oggvorbis](https://github.com/jfreymuth/oggvorbis) 6 | 7 | [godoc](https://godoc.org/github.com/jfreymuth/vorbis) 8 | 9 | [The vorbis specification](https://xiph.org/vorbis/doc/Vorbis_I_spec.html) 10 | -------------------------------------------------------------------------------- /vendor/github.com/jfreymuth/vorbis/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package vorbis implements a vorbis decoder. 3 | 4 | Note that this package only decodes raw vorbis packets, these packets are 5 | usually stored in a container format like ogg. 6 | 7 | The vorbis specification is available at: 8 | https://xiph.org/vorbis/doc/Vorbis_I_spec.html 9 | 10 | */ 11 | package vorbis // import "github.com/jfreymuth/vorbis" 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/exp/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/exp/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/exp/shiny/driver/gldriver/buffer.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package gldriver 6 | 7 | import "image" 8 | 9 | type bufferImpl struct { 10 | // buf should always be equal to (i.e. the same ptr, len, cap as) rgba.Pix. 11 | // It is a separate, redundant field in order to detect modifications to 12 | // the rgba field that are invalid as per the screen.Buffer documentation. 13 | buf []byte 14 | rgba image.RGBA 15 | size image.Point 16 | } 17 | 18 | func (b *bufferImpl) Release() {} 19 | func (b *bufferImpl) Size() image.Point { return b.size } 20 | func (b *bufferImpl) Bounds() image.Rectangle { return image.Rectangle{Max: b.size} } 21 | func (b *bufferImpl) RGBA() *image.RGBA { return &b.rgba } 22 | 23 | func (b *bufferImpl) preUpload() { 24 | // Check that the program hasn't tried to modify the rgba field via the 25 | // pointer returned by the bufferImpl.RGBA method. This check doesn't catch 26 | // 100% of all cases; it simply tries to detect some invalid uses of a 27 | // screen.Buffer such as: 28 | // *buffer.RGBA() = anotherImageRGBA 29 | if len(b.buf) != 0 && len(b.rgba.Pix) != 0 && &b.buf[0] != &b.rgba.Pix[0] { 30 | panic("gldriver: invalid Buffer.RGBA modification") 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /vendor/golang.org/x/exp/shiny/driver/gldriver/context.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !android 6 | 7 | package gldriver 8 | 9 | import ( 10 | "runtime" 11 | 12 | "golang.org/x/mobile/gl" 13 | ) 14 | 15 | // NewContext creates an OpenGL ES context with a dedicated processing thread. 16 | func NewContext() (gl.Context, error) { 17 | glctx, worker := gl.NewContext() 18 | 19 | errCh := make(chan error) 20 | workAvailable := worker.WorkAvailable() 21 | go func() { 22 | runtime.LockOSThread() 23 | err := surfaceCreate() 24 | errCh <- err 25 | if err != nil { 26 | return 27 | } 28 | 29 | for range workAvailable { 30 | worker.DoWork() 31 | } 32 | }() 33 | if err := <-errCh; err != nil { 34 | return nil, err 35 | } 36 | return glctx, nil 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/exp/shiny/driver/gldriver/other.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !darwin !386,!amd64 ios 6 | // +build !linux android 7 | // +build !windows 8 | // +build !openbsd 9 | 10 | package gldriver 11 | 12 | import ( 13 | "fmt" 14 | "runtime" 15 | 16 | "golang.org/x/exp/shiny/screen" 17 | ) 18 | 19 | const useLifecycler = true 20 | const handleSizeEventsAtChannelReceive = true 21 | 22 | func newWindow(opts *screen.NewWindowOptions) (uintptr, error) { return 0, nil } 23 | 24 | func initWindow(id *windowImpl) {} 25 | func showWindow(id *windowImpl) {} 26 | func closeWindow(id uintptr) {} 27 | func drawLoop(w *windowImpl) {} 28 | 29 | func main(f func(screen.Screen)) error { 30 | return fmt.Errorf("gldriver: unsupported GOOS/GOARCH %s/%s", runtime.GOOS, runtime.GOARCH) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/exp/shiny/driver/internal/errscreen/errscreen.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package errscreen provides a stub Screen implementation. 6 | package errscreen // import "golang.org/x/exp/shiny/driver/internal/errscreen" 7 | 8 | import ( 9 | "image" 10 | 11 | "golang.org/x/exp/shiny/screen" 12 | ) 13 | 14 | // Stub returns a Screen whose methods all return the given error. 15 | func Stub(err error) screen.Screen { 16 | return stub{err} 17 | } 18 | 19 | type stub struct { 20 | err error 21 | } 22 | 23 | func (s stub) NewBuffer(size image.Point) (screen.Buffer, error) { return nil, s.err } 24 | func (s stub) NewTexture(size image.Point) (screen.Texture, error) { return nil, s.err } 25 | func (s stub) NewWindow(opts *screen.NewWindowOptions) (screen.Window, error) { return nil, s.err } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/exp/shiny/driver/internal/win32/syscall.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:generate go run $GOROOT/src/syscall/mksyscall_windows.go -output zsyscall_windows.go syscall_windows.go 6 | 7 | package win32 8 | -------------------------------------------------------------------------------- /vendor/golang.org/x/image/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/image/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/image/math/f64/f64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package f64 implements float64 vector and matrix types. 6 | package f64 // import "golang.org/x/image/math/f64" 7 | 8 | // Vec2 is a 2-element vector. 9 | type Vec2 [2]float64 10 | 11 | // Vec3 is a 3-element vector. 12 | type Vec3 [3]float64 13 | 14 | // Vec4 is a 4-element vector. 15 | type Vec4 [4]float64 16 | 17 | // Mat3 is a 3x3 matrix in row major order. 18 | // 19 | // m[3*r + c] is the element in the r'th row and c'th column. 20 | type Mat3 [9]float64 21 | 22 | // Mat4 is a 4x4 matrix in row major order. 23 | // 24 | // m[4*r + c] is the element in the r'th row and c'th column. 25 | type Mat4 [16]float64 26 | 27 | // Aff3 is a 3x3 affine transformation matrix in row major order, where the 28 | // bottom row is implicitly [0 0 1]. 29 | // 30 | // m[3*r + c] is the element in the r'th row and c'th column. 31 | type Aff3 [6]float64 32 | 33 | // Aff4 is a 4x4 affine transformation matrix in row major order, where the 34 | // bottom row is implicitly [0 0 0 1]. 35 | // 36 | // m[4*r + c] is the element in the r'th row and c'th column. 37 | type Aff4 [12]float64 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/mobile/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/mobile/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/mobile/app/internal/callfn/callfn.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build android 6 | // +build arm 386 amd64 arm64 7 | 8 | // Package callfn provides an android entry point. 9 | // 10 | // It is a separate package from app because it contains Go assembly, 11 | // which does not compile in a package using cgo. 12 | package callfn 13 | 14 | // CallFn calls a zero-argument function by its program counter. 15 | // It is only intended for calling main.main. Using it for 16 | // anything else will not end well. 17 | func CallFn(fn uintptr) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/mobile/app/internal/callfn/callfn_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | #include "textflag.h" 6 | #include "funcdata.h" 7 | 8 | TEXT ·CallFn(SB),$0-4 9 | MOVL fn+0(FP), AX 10 | CALL AX 11 | RET 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/mobile/app/internal/callfn/callfn_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | #include "textflag.h" 6 | #include "funcdata.h" 7 | 8 | TEXT ·CallFn(SB),$0-8 9 | MOVQ fn+0(FP), AX 10 | CALL AX 11 | RET 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/mobile/app/internal/callfn/callfn_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | #include "textflag.h" 6 | #include "funcdata.h" 7 | 8 | TEXT ·CallFn(SB),$0-4 9 | MOVW fn+0(FP), R0 10 | BL (R0) 11 | RET 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/mobile/app/internal/callfn/callfn_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | #include "textflag.h" 6 | #include "funcdata.h" 7 | 8 | TEXT ·CallFn(SB),$0-8 9 | MOVD fn+0(FP), R0 10 | BL (R0) 11 | RET 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/mobile/event/paint/paint.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package paint defines an event for the app being ready to paint. 6 | // 7 | // See the golang.org/x/mobile/app package for details on the event model. 8 | package paint // import "golang.org/x/mobile/event/paint" 9 | 10 | // Event indicates that the app is ready to paint the next frame of the GUI. 11 | // 12 | //A frame is completed by calling the App's Publish method. 13 | type Event struct { 14 | // External is true for paint events sent by the screen driver. 15 | // 16 | // An external event may be sent at any time in response to an 17 | // operating system event, for example the window opened, was 18 | // resized, or the screen memory was lost. 19 | // 20 | // Programs actively drawing to the screen as fast as vsync allows 21 | // should ignore external paint events to avoid a backlog of paint 22 | // events building up. 23 | External bool 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/mobile/gl/work_other.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !cgo !darwin,!linux,!openbsd 6 | // +build !windows 7 | 8 | package gl 9 | 10 | // This file contains stub implementations of what the other work*.go files 11 | // provide. These stubs don't do anything, other than compile (e.g. when cgo is 12 | // disabled). 13 | 14 | type context struct{} 15 | 16 | func (*context) enqueue(c call) uintptr { 17 | panic("unimplemented; GOOS/CGO combination not supported") 18 | } 19 | 20 | func (*context) cString(str string) (uintptr, func()) { 21 | panic("unimplemented; GOOS/CGO combination not supported") 22 | } 23 | 24 | func (*context) cStringPtr(str string) (uintptr, func()) { 25 | panic("unimplemented; GOOS/CGO combination not supported") 26 | } 27 | 28 | type context3 = context 29 | 30 | func NewContext() (Context, Worker) { 31 | panic("unimplemented; GOOS/CGO combination not supported") 32 | } 33 | 34 | func Version() string { 35 | panic("unimplemented; GOOS/CGO combination not supported") 36 | } 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/mobile/gl/work_windows_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | #include "textflag.h" 6 | 7 | // fixFloat is unnecessary for windows/386 8 | TEXT ·fixFloat(SB),NOSPLIT,$0-16 9 | RET 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/mobile/gl/work_windows_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | #include "textflag.h" 6 | 7 | TEXT ·fixFloat(SB),NOSPLIT,$0-32 8 | MOVQ x0+0(FP), X0 9 | MOVQ x1+8(FP), X1 10 | MOVQ x2+16(FP), X2 11 | MOVQ x3+24(FP), X3 12 | RET 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/mobile/internal/mobileinit/mobileinit.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package mobileinit contains common initialization logic for mobile platforms 6 | // that is relevant to both all-Go apps and gobind-based apps. 7 | // 8 | // Long-term, some code in this package should consider moving into Go stdlib. 9 | package mobileinit 10 | 11 | import "C" 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/mobile/internal/mobileinit/mobileinit_ios.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build darwin 6 | // +build arm arm64 7 | 8 | package mobileinit 9 | 10 | import ( 11 | "io" 12 | "log" 13 | "os" 14 | "unsafe" 15 | ) 16 | 17 | /* 18 | #include 19 | #include 20 | 21 | void asl_log_wrap(const char *str) { 22 | asl_log(NULL, NULL, ASL_LEVEL_NOTICE, "%s", str); 23 | } 24 | */ 25 | import "C" 26 | 27 | type aslWriter struct{} 28 | 29 | func (aslWriter) Write(p []byte) (n int, err error) { 30 | cstr := C.CString(string(p)) 31 | C.asl_log_wrap(cstr) 32 | C.free(unsafe.Pointer(cstr)) 33 | return len(p), nil 34 | } 35 | 36 | func init() { 37 | log.SetOutput(io.MultiWriter(os.Stderr, aslWriter{})) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/internal/unsafeheader/unsafeheader.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package unsafeheader contains header declarations for the Go runtime's 6 | // slice and string implementations. 7 | // 8 | // This package allows x/sys to use types equivalent to 9 | // reflect.SliceHeader and reflect.StringHeader without introducing 10 | // a dependency on the (relatively heavy) "reflect" package. 11 | package unsafeheader 12 | 13 | import ( 14 | "unsafe" 15 | ) 16 | 17 | // Slice is the runtime representation of a slice. 18 | // It cannot be used safely or portably and its representation may change in a later release. 19 | type Slice struct { 20 | Data unsafe.Pointer 21 | Len int 22 | Cap int 23 | } 24 | 25 | // String is the runtime representation of a string. 26 | // It cannot be used safely or portably and its representation may change in a later release. 27 | type String struct { 28 | Data unsafe.Pointer 29 | Len int 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/aliases.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | // +build go1.9 7 | 8 | package windows 9 | 10 | import "syscall" 11 | 12 | type Errno = syscall.Errno 13 | type SysProcAttr = syscall.SysProcAttr 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/empty.s: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build !go1.12 6 | 7 | // This file is here to allow bodyless functions with go:linkname for Go 1.11 8 | // and earlier (see https://golang.org/issue/23311). 9 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/eventlog.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | 7 | package windows 8 | 9 | const ( 10 | EVENTLOG_SUCCESS = 0 11 | EVENTLOG_ERROR_TYPE = 1 12 | EVENTLOG_WARNING_TYPE = 2 13 | EVENTLOG_INFORMATION_TYPE = 4 14 | EVENTLOG_AUDIT_SUCCESS = 8 15 | EVENTLOG_AUDIT_FAILURE = 16 16 | ) 17 | 18 | //sys RegisterEventSource(uncServerName *uint16, sourceName *uint16) (handle Handle, err error) [failretval==0] = advapi32.RegisterEventSourceW 19 | //sys DeregisterEventSource(handle Handle) (err error) = advapi32.DeregisterEventSource 20 | //sys ReportEvent(log Handle, etype uint16, category uint16, eventId uint32, usrSId uintptr, numStrings uint16, dataSize uint32, strings **uint16, rawData *byte) (err error) = advapi32.ReportEventW 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/memory_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | const ( 8 | MEM_COMMIT = 0x00001000 9 | MEM_RESERVE = 0x00002000 10 | MEM_DECOMMIT = 0x00004000 11 | MEM_RELEASE = 0x00008000 12 | MEM_RESET = 0x00080000 13 | MEM_TOP_DOWN = 0x00100000 14 | MEM_WRITE_WATCH = 0x00200000 15 | MEM_PHYSICAL = 0x00400000 16 | MEM_RESET_UNDO = 0x01000000 17 | MEM_LARGE_PAGES = 0x20000000 18 | 19 | PAGE_NOACCESS = 0x01 20 | PAGE_READONLY = 0x02 21 | PAGE_READWRITE = 0x04 22 | PAGE_WRITECOPY = 0x08 23 | PAGE_EXECUTE_READ = 0x20 24 | PAGE_EXECUTE_READWRITE = 0x40 25 | PAGE_EXECUTE_WRITECOPY = 0x80 26 | 27 | QUOTA_LIMITS_HARDWS_MIN_DISABLE = 0x00000002 28 | QUOTA_LIMITS_HARDWS_MIN_ENABLE = 0x00000001 29 | QUOTA_LIMITS_HARDWS_MAX_DISABLE = 0x00000008 30 | QUOTA_LIMITS_HARDWS_MAX_ENABLE = 0x00000004 31 | ) 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/mksyscall.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build generate 6 | 7 | package windows 8 | 9 | //go:generate go run golang.org/x/sys/windows/mkwinsyscall -output zsyscall_windows.go eventlog.go service.go syscall_windows.go security_windows.go 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows,race 6 | 7 | package windows 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows,!race 6 | 7 | package windows 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/str.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | 7 | package windows 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + itoa(-val) 12 | } 13 | var buf [32]byte // big enough for int64 14 | i := len(buf) - 1 15 | for val >= 10 { 16 | buf[i] = byte(val%10 + '0') 17 | i-- 18 | val /= 10 19 | } 20 | buf[i] = byte(val + '0') 21 | return string(buf[i:]) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | Description [WSADESCRIPTION_LEN + 1]byte 11 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 12 | MaxSockets uint16 13 | MaxUdpDg uint16 14 | VendorInfo *byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Port uint16 21 | Proto *byte 22 | } 23 | 24 | type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { 25 | PerProcessUserTimeLimit int64 26 | PerJobUserTimeLimit int64 27 | LimitFlags uint32 28 | MinimumWorkingSetSize uintptr 29 | MaximumWorkingSetSize uintptr 30 | ActiveProcessLimit uint32 31 | Affinity uintptr 32 | PriorityClass uint32 33 | SchedulingClass uint32 34 | _ uint32 // pad to 8 byte boundary 35 | } 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | MaxSockets uint16 11 | MaxUdpDg uint16 12 | VendorInfo *byte 13 | Description [WSADESCRIPTION_LEN + 1]byte 14 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Proto *byte 21 | Port uint16 22 | } 23 | 24 | type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { 25 | PerProcessUserTimeLimit int64 26 | PerJobUserTimeLimit int64 27 | LimitFlags uint32 28 | MinimumWorkingSetSize uintptr 29 | MaximumWorkingSetSize uintptr 30 | ActiveProcessLimit uint32 31 | Affinity uintptr 32 | PriorityClass uint32 33 | SchedulingClass uint32 34 | } 35 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | Description [WSADESCRIPTION_LEN + 1]byte 11 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 12 | MaxSockets uint16 13 | MaxUdpDg uint16 14 | VendorInfo *byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Port uint16 21 | Proto *byte 22 | } 23 | 24 | type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { 25 | PerProcessUserTimeLimit int64 26 | PerJobUserTimeLimit int64 27 | LimitFlags uint32 28 | MinimumWorkingSetSize uintptr 29 | MaximumWorkingSetSize uintptr 30 | ActiveProcessLimit uint32 31 | Affinity uintptr 32 | PriorityClass uint32 33 | SchedulingClass uint32 34 | _ uint32 // pad to 8 byte boundary 35 | } 36 | --------------------------------------------------------------------------------