From 39bd058acf5f2b9b039813fd574bdcb885907dae Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Mon, 1 Jun 2020 13:04:46 +0200 Subject: [PATCH] examples: tetris: remove GLFW dependency --- examples/tetris/README.md | 15 --------------- examples/tetris/tetris.v | 5 ++--- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/examples/tetris/README.md b/examples/tetris/README.md index c192b3d400..dc728bc1e0 100644 --- a/examples/tetris/README.md +++ b/examples/tetris/README.md @@ -1,17 +1,2 @@ -Tetris has a temporary dependency on GLFW. - -FreeType is needed to display the score and some text. A smaller stb library is going to be used instead. - -## macOS -`brew install glfw freetype` - -## Ubuntu -`sudo apt install libglfw3 libglfw3-dev libfreetype6-dev libssl-dev` - -## Arch (and Manjaro) -`sudo pacman -S glfw-x11 freetype2` - -## Windows -Copy `thirdparty/glfw/glfw3.dll` & `thirdparty/freetype/win64/freetype.dll` to this directory. diff --git a/examples/tetris/tetris.v b/examples/tetris/tetris.v index bce61b6a2a..40d5f08e52 100644 --- a/examples/tetris/tetris.v +++ b/examples/tetris/tetris.v @@ -8,7 +8,6 @@ import rand import time import gx import gg2 as gg -import glfw import sokol import sokol.sapp import math @@ -236,7 +235,7 @@ fn (mut g Game) run() { g.move_tetro() g.delete_completed_lines() } - glfw.post_empty_event() // force window redraw + //glfw.post_empty_event() // force window redraw time.sleep_ms(timer_period) } } @@ -414,7 +413,7 @@ fn on_event(e &sapp.Event, game mut Game) { } } -fn (game mut Game) key_down(key sapp.KeyCode) { +fn (mut game Game) key_down(key sapp.KeyCode) { // global keys match key { .escape {