diff options
| author | 2019-10-26 02:57:15 -0400 | |
|---|---|---|
| committer | 2019-10-26 02:57:15 -0400 | |
| commit | 330f4f2c8abdaf694d64c73d0c11c597787a3be7 (patch) | |
| tree | 17f00fbb6a11b96c8bcb25ee0fa3a4ac77933f8d | |
| parent | bc09954f9105ed62acd583c0c36a7ca1cf92349b (diff) | |
| download | cetris-330f4f2c8abdaf694d64c73d0c11c597787a3be7.tar.gz cetris-330f4f2c8abdaf694d64c73d0c11c597787a3be7.tar.bz2 cetris-330f4f2c8abdaf694d64c73d0c11c597787a3be7.zip | |
more sdl ui
| -rw-r--r-- | frontends/sdl/sdl_ui.c | 17 | ||||
| -rw-r--r-- | meson_options.txt | 2 |
2 files changed, 17 insertions, 2 deletions
diff --git a/frontends/sdl/sdl_ui.c b/frontends/sdl/sdl_ui.c index 0f40bbc..0efd9cb 100644 --- a/frontends/sdl/sdl_ui.c +++ b/frontends/sdl/sdl_ui.c @@ -12,7 +12,7 @@ #define W 480 #define H 640 -#define X_OFFSET 40 +#define X_OFFSET 60 #define Y_OFFSET 30 SDL_Renderer* render; @@ -65,6 +65,21 @@ void draw() { SDL_SetRenderDrawColor(render, 255, 255, 255, 255); SDL_RenderClear(render); + SDL_Rect board = {X_OFFSET, Y_OFFSET, 250, 500}; + SDL_SetRenderDrawColor(render, 240, 240, 240, 255); + SDL_RenderFillRect(render, &board); + SDL_RenderDrawRect(render, &board); + + SDL_SetRenderDrawColor(render, 255, 255, 255, 255); + for (int x = 0; x < CETRIS_BOARD_X + 1; x++) { + int rx = X_OFFSET + 1 + (x * 25); + SDL_RenderDrawLine(render, rx, Y_OFFSET + 1, rx, Y_OFFSET + 500); + } + for (int y = 0; y < CETRIS_BOARD_Y - CETRIS_BOARD_VISABLE + 1; y++) { + int ry = Y_OFFSET + (y * 25); + SDL_RenderDrawLine(render, X_OFFSET + 1, ry, X_OFFSET + 250, ry); + } + SDL_Rect b = {0, 0, 25, 25}; for (int y = 0; y < 4; y++) { diff --git a/meson_options.txt b/meson_options.txt index 70b2bb2..aa1f181 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,3 +1,3 @@ -option('curses-frontend', type : 'boolean', value : true)
+option('curses-frontend', type : 'boolean', value : false)
option('gl-frontend', type : 'boolean', value : false)
option('sdl-frontend', type : 'boolean', value : true)
|