@@ -0,0 +1,5 @@ | |||
#include "constants.h" | |||
const int k_window_height = 800; | |||
const int k_window_width = 600; | |||
const char *k_window_title = "Hello World"; |
@@ -0,0 +1,5 @@ | |||
#pragma once | |||
extern const int k_window_width; | |||
extern const int k_window_height; | |||
extern const char *k_window_title; |
@@ -1 +0,0 @@ | |||
int x = 10; |
@@ -1,3 +0,0 @@ | |||
#pragma once | |||
extern int x; |
@@ -1,10 +1,16 @@ | |||
#include <math.h> | |||
#include <stdio.h> | |||
//#bb pkgs := sdl2 | |||
#include "hello world.h" | |||
//#bb ldflags := -lm | |||
#include <SDL.h> | |||
#include "constants.h" | |||
int main() { | |||
printf("sin(%i) is %f\n", x, sin(x)); | |||
SDL_Init(SDL_INIT_VIDEO); | |||
SDL_Window *win = SDL_CreateWindow(k_window_title, | |||
SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, | |||
k_window_width, k_window_height, 0); | |||
SDL_Delay(5000); | |||
SDL_DestroyWindow(win); | |||
SDL_Quit(); | |||
} |