diff options
Diffstat (limited to 'src/video/sdl.c')
-rw-r--r-- | src/video/sdl.c | 59 |
1 files changed, 41 insertions, 18 deletions
diff --git a/src/video/sdl.c b/src/video/sdl.c index 7161a08..a0cb0af 100644 --- a/src/video/sdl.c +++ b/src/video/sdl.c @@ -2,8 +2,7 @@ // Implements interface.h // Emulates the graphics of the Apple I computer with SDL. -#include"interface.h" -#include<SDL2/SDL.h> +#include<SDL/SDL.h> #define SCALE 2 @@ -15,24 +14,39 @@ #define MIN_WIDTH (40 * CHR_WIDTH) + 39*WIDTH_SPACE #define MIN_HEIGHT (24 * CHR_HEIGHT) -int TerminalInit(){ + + +SDL_Surface* MainWindow; +SDL_Surface* Font; + +void PrintInfo_SDL() +{ + + +} + + +int DisplayInit_SDL() +{ // INITIALIZATION SDL_Init(SDL_INIT_TIMER | SDL_INIT_VIDEO); - SDL_Window* window = SDL_CreateWindow( - "Apple C", + MainWindow = SDL_SetVideoMode(MIN_WIDTH*SCALE, MIN_HEIGHT*SCALE, 8, NULL); + + + /*= 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); + );*/ + Font = SDL_LoadBMP("font.bmp"); + + SDL_Surface* font_surface = SDL_LoadBMP("font.bmp"); + SDL_Rect character = { .x = 0, .y = 0, @@ -47,13 +61,22 @@ int TerminalInit(){ .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); + //SDL_SetRenderDrawColor (render, 0, 0, 0, 255); + //SDL_RenderClear (render); + //SDL_RenderCopy (render, font_texture, &character, &draw_character); + //SDL_RenderPresent (render); + +} +void DisplayClose_SDL() +{ + SDL_FreeSurface(MainWindow); + SDL_FreeSurface(Font); } -void TerminalClose() { - SDL_Quit(); -}
\ No newline at end of file + +void DisplayInput_SDL() +{ + + +} |