summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authoralekseiplusplus <alekseijeaves@protonmail.com>2023-08-03 11:50:22 +1000
committeralekseiplusplus <alekseijeaves@protonmail.com>2023-08-03 11:50:22 +1000
commitb8599585fad704b2ec3bdde69dca4dd9c2a6f8fd (patch)
tree275eda06de77d9e6d8d831a31179ad8cec33ad4d /src/main.c
parent9a6188f821b11b69fff3d3a303dbfcce2e52e6f4 (diff)
New direction for video
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c46
1 files changed, 2 insertions, 44 deletions
diff --git a/src/main.c b/src/main.c
index b3c6dbb..d5d5ded 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,55 +1,13 @@
#include"include.h"
-#define SCALE 2
-
-#define CHR_WIDTH 5
-#define CHR_HEIGHT 8
-
-#define WIDTH_SPACE 1 * SCALE
-
-#define MIN_WIDTH (40 * CHR_WIDTH) + 39*WIDTH_SPACE
-#define MIN_HEIGHT (24 * CHR_HEIGHT)
+int main() {
+
-int main(){
- // INITIALIZATION
- SDL_Init(SDL_INIT_TIMER | SDL_INIT_VIDEO);
- SDL_Window* window = SDL_CreateWindow(
- "Apple C",
- SDL_WINDOWPOS_CENTERED,
- SDL_WINDOWPOS_CENTERED,
- MIN_WIDTH * SCALE,
- MIN_HEIGHT * SCALE,
- SDL_WINDOW_SHOWN
- );
- SDL_Renderer* render = SDL_CreateRenderer(window, -1, 0);
- SDL_Surface* font_surface = SDL_LoadBMP("font.bmp");
- SDL_Texture* font_texture = SDL_CreateTextureFromSurface(render, font_surface);
- SDL_FreeSurface(font_surface);
- SDL_Rect character = {
- .x = 0,
- .y = 0,
- .w = CHR_WIDTH,
- .h = CHR_HEIGHT
- };
- SDL_Rect draw_character = {
- .x = 0,
- .y = 0,
- .w = CHR_WIDTH * SCALE,
- .h = CHR_HEIGHT * SCALE
- };
-
- SDL_SetRenderDrawColor (render, 0, 0, 0, 255);
- SDL_RenderClear (render);
- SDL_RenderCopy (render, font_texture, &character, &draw_character);
- SDL_RenderPresent (render);
- // Just delay before it dies
- SDL_Delay(1000);
- SDL_Quit();
return 0;
} \ No newline at end of file