-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMenu.cpp
40 lines (34 loc) · 1.4 KB
/
CMenu.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//
// Created by igoryan on 15.04.15.
//
CMenu::CMenu() : CWindow() {
mTextMenu[new_game] = "New Game";
mTextMenu[out] = "out";
mPathToBackground = "menu_images/menu_background.jpg";
SDL_Surface *loaded = CLoadMedia::LoadJPG(mPathToBackground);
SDL_Texture *mBackground = SDL_CreateTextureFromSurface(mRender, loaded);
SDL_FreeSurface(loaded);
SDL_RenderClear(mRender);
SDL_RenderCopy(mRender, mBackground, NULL, NULL);
}
CMenu::CMenu(int x, int y, int width, int height, Uint32 flags) : CWindow("316 panzers",
x,
y,
width,
height,
flags) {
mTextMenu[new_game] = "New Game";
mTextMenu[out] = "out";
mPathToBackground = "menu_images/menu_background.jpg";
SDL_Surface *loaded = CLoadMedia::LoadJPG(mPathToBackground);
SDL_Texture *mBackground = SDL_CreateTextureFromSurface(mRender, loaded);
SDL_FreeSurface(loaded);
SDL_RenderClear(mRender);
SDL_RenderCopy(mRender, mBackground, NULL, NULL);
}
CMenu::~CMenu() {
}
void CMenu::show_window() {
SDL_RenderPresent(mRender);
}
#include "CWindow.cpp"