Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jumpNrun
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wise2023_jumpnrun
jumpNrun
Commits
4f7f8f2e
Commit
4f7f8f2e
authored
1 year ago
by
187Bit
Browse files
Options
Downloads
Plain Diff
Merge branch 'main' of git.imp.fu-berlin.de:wise2023_jumpnrun/jumpnrun
parents
1a15c3dd
363fb027
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
init.c
+7
-0
7 additions, 0 deletions
init.c
with
7 additions
and
0 deletions
init.c
+
7
−
0
View file @
4f7f8f2e
#include
"init.h"
//Lädt Texturen rein
SDL_Texture
*
img_grassDark
;
SDL_Texture
*
img_grassBright
;
SDL_Texture
*
img_streetSingle
;
...
...
@@ -22,6 +23,8 @@ SDL_Texture *img_duck;
SDL_Texture
*
img_3D_Duck
;
TTF_Font
*
font
;
//V: all images and fonts to load are in file images
//N: images and fonts have been loaded into renderer
int
init
(
SDL_Renderer
*
renderer
)
{
//Initiiere Text
...
...
@@ -55,6 +58,7 @@ int init(SDL_Renderer* renderer) {
//Initiierung der Bilder
int
flags
=
IMG_INIT_PNG
|
IMG_INIT_JPG
;
//Fehlerbehandlung
if
((
IMG_Init
(
flags
)
!=
flags
))
{
SDL_Log
(
"SDL_Image konnte nicht initialisiert werden! SDL_image Error: %s
\n
"
,
IMG_GetError
());
return
(
1
);
...
...
@@ -72,6 +76,8 @@ int init(SDL_Renderer* renderer) {
}
//V: renderer, window and images have been loaded, fonts
//N: frees space of window, renderer and images, fonts
int
exitGame
(
SDL_Renderer
*
renderer
,
SDL_Window
*
window
)
{
SDL_DestroyRenderer
(
renderer
);
SDL_DestroyWindow
(
window
);
...
...
@@ -95,6 +101,7 @@ int exitGame(SDL_Renderer* renderer, SDL_Window* window) {
SDL_DestroyTexture
(
img_plank
);
SDL_DestroyTexture
(
img_duck
);
SDL_DestroyTexture
(
img_3D_Duck
);
TTF_CloseFont
(
font
);
SDL_Quit
();
return
0
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment