diff --git a/src/graphics.h b/src/graphics.h index 02f6143..9b2d7b4 100644 --- a/src/graphics.h +++ b/src/graphics.h @@ -1,3 +1,21 @@ +SDL_Surface * unigi_platform_surface; +uint8_t * unigi_platform_pixels1; +uint16_t * unigi_platform_pixels2; +uint32_t * unigi_platform_pixels4; + +unigi_type_error unigi_window_create(unigi_type_resolution resolution, char * title) { + unigi_platform_surface = SDL_SetVideoMode(resolution.width,resolution.height,resolution.depth,SDL_SWSURFACE); + if (unigi_platform_surface == NULL) { + printf("[unigi] Could not initialize window: SDL -> %s\n",SDL_GetError()); + return 1; + } + unigi_platform_pixels1 = (uint8_t *)(unigi_platform_surface->pixels); + unigi_platform_pixels2 = (uint16_t *)(unigi_platform_surface->pixels); + unigi_platform_pixels4 = (uint32_t *)(unigi_platform_surface->pixels); + SDL_WM_SetCaption(title,NULL); + return 0; +} + uint8_t * unigi_platform_palette1; uint16_t * unigi_platform_palette2; uint32_t * unigi_platform_palette4; diff --git a/src/main.h b/src/main.h index 006a797..e8af719 100644 --- a/src/main.h +++ b/src/main.h @@ -1,6 +1,5 @@ #include #include -#include "window.h" #include "graphics.h" #include "input.h" diff --git a/src/window.h b/src/window.h deleted file mode 100644 index 55b6912..0000000 --- a/src/window.h +++ /dev/null @@ -1,17 +0,0 @@ -SDL_Surface * unigi_platform_surface; -uint8_t * unigi_platform_pixels1; -uint16_t * unigi_platform_pixels2; -uint32_t * unigi_platform_pixels4; - -unigi_type_error unigi_window_create(unigi_type_resolution resolution, char * title) { - unigi_platform_surface = SDL_SetVideoMode(resolution.width,resolution.height,resolution.depth,SDL_SWSURFACE); - if (unigi_platform_surface == NULL) { - printf("[unigi] Could not initialize window: SDL -> %s\n",SDL_GetError()); - return 1; - } - unigi_platform_pixels1 = (uint8_t *)(unigi_platform_surface->pixels); - unigi_platform_pixels2 = (uint16_t *)(unigi_platform_surface->pixels); - unigi_platform_pixels4 = (uint32_t *)(unigi_platform_surface->pixels); - SDL_WM_SetCaption(title,NULL); - return 0; -}