diff --git a/include/sfml_init.h b/include/sfml_init.h new file mode 100644 index 0000000..cd07958 --- /dev/null +++ b/include/sfml_init.h @@ -0,0 +1,14 @@ +/* +** EPITECH PROJECT, 2020 +** My3D +** File description: +** sfml_init +*/ + +#ifndef MY_RPG_SFML_INIT_H +#define MY_RPG_SFML_INIT_H + +#define TEXTURE_WIDTH 16 +#define TEXTURE_HEIGHT 16 + +#endif //MY_RPG_SFML_INIT_H diff --git a/src/sfml_renderer/sfml_init.c b/src/sfml_renderer/sfml_init.c index 6fdcb59..cb25035 100644 --- a/src/sfml_renderer/sfml_init.c +++ b/src/sfml_renderer/sfml_init.c @@ -8,6 +8,7 @@ #include "components/transform_component.h" #include #include +#include "sfml_init.h" sfRenderStates *sfml_init_render_state(void) { @@ -27,9 +28,10 @@ sfVertexArray *sfml_init_verticies(void) sfVertexArray *arr = sfVertexArray_create(); sfVertex v[4] = { {.position = {0, 0}, .texCoords = {0, 0}, .color = sfWhite}, - {.position = {0, 0}, .texCoords = {64, 0}, .color = sfWhite}, - {.position = {0, 0}, .texCoords = {0, 64}, .color = sfWhite}, - {.position = {0, 0}, .texCoords = {64, 64}, .color = sfWhite} + {.position = {0, 0}, .texCoords = {TEXTURE_WIDTH, 0}, .color = sfWhite}, + {.position = {0, 0}, .texCoords = {0, TEXTURE_HEIGHT}, .color = sfWhite}, + {.position = {0, 0}, .texCoords = {TEXTURE_WIDTH, \ +TEXTURE_HEIGHT}, .color = sfWhite} }; for (int i = 0; i < 4; i++)