fuck yu alllll

This commit is contained in:
Stefan Neumann 2018-01-15 13:19:51 +01:00
parent ded8682f82
commit e7d5d2be45
3 changed files with 37 additions and 0 deletions

5
main.c
View File

@ -9,6 +9,7 @@
#include "breakout.h"
#include "vector.h"
#include "startmenu.h"
#ifndef __nullptr__
#define Nullptr(type) (type *)0
@ -125,8 +126,11 @@ void DrawFrame(){
SDL_RenderCopy(renderer, Message, NULL, &Message_rect); // you put the renderer's name first, the Message, the crop size(you can ignore this if you don't want to dabble with cropping), and the rect which is the size and coordinate of your texture
SDL_FreeSurface(surfaceMessage);
Startmenu_Draw(renderer);
SDL_DestroyTexture(Message);
SDL_RenderPresent(renderer);
} /* DrawFrame */
void printFontStyle(TTF_Font * ffont){
@ -170,6 +174,7 @@ void INITIALIZE() {
renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);
printf("Renderer was created!\n");
BREAKOUT_INITIALIZE(renderer, width, height);
Load_Textures(renderer);
} /* INITIALIZE */
void QUIT(){

17
startmenu.c Normal file
View File

@ -0,0 +1,17 @@
#include <stdio.h>
#include <stdlib.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
SDL_Texture* TITLE_Texture;
SDL_Rect TargetRect;
void Load_Textures (SDL_Renderer* renderer) {
TITLE_Texture = IMG_LoadTexture(renderer, "assets/images/Texts.png");
TargetRect = (SDL_Rect){.x = 200,.y = 100, .w=1000, .h=256};
}
void Startmenu_Draw (SDL_Renderer* renderer) {
SDL_RenderCopy(renderer, TITLE_Texture, NULL, &TargetRect);
}

15
startmenu.h Normal file
View File

@ -0,0 +1,15 @@
#ifndef __Startmenu__
#define __Startmenu__
#include <stdio.h>
#include <stdlib.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
void Load_Textures (SDL_Renderer* renderer);
void Startmenu_Draw (SDL_Renderer* renderer);
#endif