kubo/kubo_wall.h

52 lines
1.4 KiB
C

/*
* Copyright Luka Jankovic 2025
*
* This file is part of Kubo.
*
* Kubo is free software: you can redistribute it and/or modify it under the
* terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version.
*
* Kubo is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with
* Kubo. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef KUBO_WALL_H
#define KUBO_WALL_H
#include <raylib.h>
#include <stdio.h>
#include <stdlib.h>
#include "kubo_dynarray.h"
#define KUBO_WALL_INIT_VERTICES 4
enum kubo_wall_state {
KUBO_WALL_INIT,
KUBO_WALL_DRAWING,
KUBO_WALL_DONE,
KUBO_WALL_SELECTED
};
KUBO_DYNARRAY_REGISTER(kubo_vector2_arr, Vector2)
struct kubo_wall {
struct kubo_vector2_arr vertices;
enum kubo_wall_state state;
};
void kubo_wall_init(struct kubo_wall *wall);
void kubo_wall_cleanup(struct kubo_wall *wall);
bool kubo_wall_add_vertex(struct kubo_wall *wall, Vector2 vec);
Vector2 kubo_wall_get_vertex(struct kubo_wall *wall, size_t index);
void kubo_wall_render(struct kubo_wall *wall, bool select, Camera2D *camera);
#endif