12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- /*
- * Voxel-a-tord
- * display.h:
- * Copyright (c) 2021-2022 986-Studio. All rights reserved.
- *
- * Created by Manoël Trapier on 01/03/2021.
- */
- #ifndef VOXELATOR_SOURCE_INCLUDE_DISPLAY_H
- #define VOXELATOR_SOURCE_INCLUDE_DISPLAY_H
- #include <stdbool.h>
- #include <SDL.h>
- #include <colour.h>
- /***********************************************************************************************************************
- * Data types
- **********************************************************************************************************************/
- typedef struct window_t
- {
- int32_t height, width;
- } window_t;
- /***********************************************************************************************************************
- * Constants
- **********************************************************************************************************************/
- #define FPS (60)
- #define FRAME_TARGET_TIME (1000 / FPS)
- /***********************************************************************************************************************
- * Prototypes
- **********************************************************************************************************************/
- /* --- Window functions --- */
- bool initialiseWindow(int32_t screenWidth, int32_t screenHeight, bool fullScreen);
- void destroyWindow();
- void renderFrameBuffer();
- void getWindowSize(int32_t *width, int32_t *height);
- void displayWindowClear();
- void displayWindowRender();
- /* --- Drawing functions --- */
- void clearFrameBuffer(colour_t colour);
- void drawPixel(int32_t x, int32_t y, colour_t colour);
- void drawGrid(int spacing, colour_t colour);
- void drawRectangle(int32_t x, int32_t y, int32_t w, int32_t h, colour_t colour);
- void drawVLine(int32_t x, int32_t y0, int32_t y1, colour_t colour);
- void drawHLine(int32_t x0, int32_t y, int32_t x1, colour_t colour);
- void drawLine(int32_t x0, int32_t y0, int32_t x1, int32_t y1, colour_t colour);
- void drawText(int32_t x, int32_t y, colour_t colour, const char *format, ...);
- #endif /* VOXELATOR_SOURCE_INCLUDE_DISPLAY_H */
|