-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSprite.h
48 lines (38 loc) · 992 Bytes
/
Sprite.h
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
41
42
43
44
45
46
47
48
//Programmer: Axel Rotter Morgado
//Date: 18.04.2016
#ifndef SPRITE_H
#define SPRITE_H
#include <Windows.h>
#include "Circle.h"
#include "Vec2.h"
#include <cassert>
class Sprite
{
public:
Sprite(HINSTANCE hAppInst, int imageID, int maskID,
const Circle& bc, const Vec2& p0, const Vec2& v0);
~Sprite();
int width();
int height();
void update(float dt);
void draw(HDC hBackBufferDC, HDC hSpriteDC);
public:
// Make public
Circle mBoundingCircle;
Vec2 mPosition;
Vec2 mVelocity;
private:
// Make copy constructor and assignment operator private
// so client cannot copy Sprites. We do this because
// this class is not designed to be copied because it
// is not efficient--copying bitmaps is slow (lots of memory).
Sprite(const Sprite& rhs);
Sprite& operator=(const Sprite& rhs);
protected:
HINSTANCE mhAppInst;
HBITMAP mhImage;
HBITMAP mhMask;
BITMAP mImageBM;
BITMAP mMaskBM;
};
#endif // SPRITE_H