mirror of https://git.sr.ht/~kikoodx/sle
37 lines
739 B
C
37 lines
739 B
C
/* SPDX-License-Identifier: GPL-3.0-or-later */
|
|
/* Copyright (C) 2021 KikooDX */
|
|
|
|
#include "conf.h"
|
|
#include "tile_picker/draw.h"
|
|
#include <raylib.h>
|
|
#include <stdlib.h>
|
|
|
|
int tile_picker_main(int argc, char **argv)
|
|
{
|
|
/* initialize raylib */
|
|
InitWindow(picker_window_width, picker_window_height,
|
|
"SLE secondary window");
|
|
SetTargetFPS(target_fps);
|
|
/* load textures */
|
|
const Texture2D tileset = LoadTexture(argv[1]);
|
|
|
|
/* only process if tileset is well loaded */
|
|
if (tileset.width > 0) {
|
|
while (!WindowShouldClose()) {
|
|
/* draw */
|
|
BeginDrawing();
|
|
|
|
ClearBackground(BLACK);
|
|
tileset_draw(tileset);
|
|
|
|
EndDrawing();
|
|
}
|
|
}
|
|
|
|
/* unload textures */
|
|
UnloadTexture(tileset);
|
|
CloseWindow();
|
|
|
|
return EXIT_SUCCESS;
|
|
}
|