Skip to content
Snippets Groups Projects
Commit 150dd99b authored by Michael's avatar Michael
Browse files

removed redundant menu.c

parent aea7f016
Branches
Tags
No related merge requests found
CFLAGS=$(shell pkg-config --cflags sdl2 SDL2_image SDL2_ttf) -std=c99 -Wall -Wextra -pedantic -g -O0
CPPFLAGS=-MMD -MF $*.d # Generate dependency files
LDLIBS=$(shell pkg-config --libs sdl2 SDL2_image SDL2_ttf) -lm
OBJ=output.o map.o rows.o auto.o charac.o main.o init.o gameLoop.o menu.o menu2.o title_screen.o file_own.o
OBJ=output.o map.o rows.o auto.o charac.o main.o init.o gameLoop.o menu2.o title_screen.o file_own.o
CC=gcc
all: main
......
#include "SDL_render.h"
#include "SDL_surface.h"
# include "header.h"
# include <stdbool.h>
# include <string.h>
# include <SDL_ttf.h>
# include <SDL.h>
# include <stdio.h>
#include <SDL_ttf.h>
/*
bool end_screen(SDL_Renderer* renderer) {
if (SDL_SetRenderDrawColor(renderer,255,255,255,0) !=0) {
SDL_Log("Farbe konnte nicht gesetzt werden! SDL_Error %s\n",SDL_GetError());
return(-1);
}
// Hintergrund für Schrift erstellen
SDL_Rect rect = {
.x = 250,
.y = 0,
.w = 600,
.h = 200 };
if (SDL_RenderFillRect(renderer,&rect)!=0) {
SDL_Log("Malen des Rechtecks fehlgeschlagen! SDL_Error %s\n",SDL_GetError());
return(-1);
}
// Text ausgeben
SDL_Surface* surfaceMessage = TTF_RenderText_Blended_Wrapped (font, "Nochmal? (y)/(n)", (SDL_Color) {255, 255, 255, 255}, 8*200);
if (surfaceMessage == NULL)
printf("Text Surface loading failed: %s\n", TTF_GetError());
SDL_Texture* Message = SDL_CreateTextureFromSurface(renderer, surfaceMessage);
SDL_RenderCopy(renderer, Message, NULL, &rect);
SDL_Event e;
int input;
bool quit = false;
SDL_RenderPresent(renderer);
enum keys {y = 29 , n = 17};
while (quit == false) {
while (SDL_PollEvent(&e)) {
switch (e.type) {
case SDL_QUIT:
exit(0);
case SDL_KEYDOWN:
input = e.key.keysym.scancode;
if (input == y) {
SDL_FreeSurface(surfaceMessage);
SDL_DestroyTexture(Message);
quit = true;
return(false);
}
if (input == n) {
SDL_FreeSurface(surfaceMessage);
SDL_DestroyTexture(Message);
return(true);
}
}
}
}
return(true);
}
*/
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment