breakout/startmenu.c

24 lines
740 B
C

#include <stdio.h>
#include <stdlib.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
SDL_Texture* TITLE_Texture;
SDL_Texture* PLAYBUTTON_Texture;
SDL_Rect TITLE_Rect;
SDL_Rect PLAYBUTTON_Rect;
void Load_Textures (SDL_Renderer* renderer) {
TITLE_Texture = IMG_LoadTexture(renderer, "assets/images/breaking_button.png");
TITLE_Rect = (SDL_Rect){.x = 710,.y = 200, .w=500, .h=223};
PLAYBUTTON_Texture = IMG_LoadTexture(renderer, "assets/images/play_button.png");
PLAYBUTTON_Rect = (SDL_Rect){.x = 710, .y = 500, .w=391, .h=223};
}
void Startmenu_Draw (SDL_Renderer* renderer) {
SDL_RenderCopy(renderer, TITLE_Texture, NULL, &TITLE_Rect);
SDL_RenderCopy(renderer, PLAYBUTTON_Texture, NULL, &PLAYBUTTON_Rect);
}