Skip to content

Commit a492aa0

Browse files
committed
add BITMAP draw convenience functions
1 parent 347bc9d commit a492aa0

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

Source/Renderer/Draw.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#include "Draw.h"
2+
#include "GLResourceMan.h"
3+
4+
using namespace RTE;
5+
6+
void DrawTexture(BITMAP* bitmap, int posX, int posY, RLColor tint) {
7+
DrawTexture(g_GLResourceMan.GetStaticTextureFromBitmap(bitmap), posX, posY, tint);
8+
}
9+
10+
void DrawTextureV(BITMAP* bitmap, Vector2 pos, RLColor tint) {
11+
DrawTextureV(g_GLResourceMan.GetStaticTextureFromBitmap(bitmap), pos, tint);
12+
}
13+
14+
void DrawTextureEx(BITMAP* bitmap, Vector2 pos, float rotation, float scale, RLColor tint) {
15+
DrawTextureEx(g_GLResourceMan.GetStaticTextureFromBitmap(bitmap), pos, rotation, scale, tint);
16+
}
17+
void DrawTextureRec(BITMAP* bitmap, Rectangle source, Vector2 pos, RLColor tint) {
18+
DrawTextureRec(g_GLResourceMan.GetStaticTextureFromBitmap(bitmap), source, pos, tint);
19+
}
20+
void DrawTexturePro(BITMAP* bitmap, Rectangle source, Rectangle dest, Vector2 origin, float rotation, RLColor tint) {
21+
DrawTexturePro(g_GLResourceMan.GetStaticTextureFromBitmap(bitmap), source, dest, origin, rotation, tint);
22+
}

Source/Renderer/Draw.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,12 @@
44

55
struct BITMAP;
66
namespace RTE {
7+
8+
void DrawTexture(BITMAP* bitmap, int posX, int posY, RLColor tint);
9+
10+
void DrawTextureV(BITMAP* bitmap, Vector2 pos, RLColor tint);
11+
12+
void DrawTextureEx(BITMAP* bitmap, Vector2 pos, float rotation, float scale, RLColor tint);
13+
void DrawTextureRec(BITMAP* bitmap, Rectangle source, Vector2 pos, RLColor tint);
14+
void DrawTexturePro(BITMAP* bitmap, Rectangle source, Rectangle dest, Vector2 origin, float rotation, RLColor tint);
715
}

0 commit comments

Comments
 (0)