forked from gameprogcpp/code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTexture.h
More file actions
34 lines (28 loc) · 914 Bytes
/
Texture.h
File metadata and controls
34 lines (28 loc) · 914 Bytes
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
// ----------------------------------------------------------------
// From Game Programming in C++ by Sanjay Madhav
// Copyright (C) 2017 Sanjay Madhav. All rights reserved.
//
// Released under the BSD License
// See LICENSE in root directory for full details.
// ----------------------------------------------------------------
#include <string>
class Texture
{
public:
Texture();
~Texture();
bool Load(const std::string& fileName);
void Unload();
void CreateFromSurface(struct SDL_Surface* surface);
void CreateForRendering(int width, int height, unsigned int format);
void SetActive(int index = 0);
int GetWidth() const { return mWidth; }
int GetHeight() const { return mHeight; }
unsigned int GetTextureID() const { return mTextureID; }
const std::string& GetFileName() const { return mFileName; }
private:
std::string mFileName;
unsigned int mTextureID;
int mWidth;
int mHeight;
};