aboutsummaryrefslogtreecommitdiffstats
path: root/window.cpp
diff options
context:
space:
mode:
authorClyne Sullivan <clyne@bitgloo.com>2024-08-05 15:47:55 -0400
committerClyne Sullivan <clyne@bitgloo.com>2024-08-05 15:47:55 -0400
commit456ef376530fc4644732d499c862f1413b9987d9 (patch)
treeab28615220d16a9c32b6b1dab6ad4313b43ac0fb /window.cpp
parent66991ce9b81f4af3c095d38fa2187837d94e5469 (diff)
level solid; basic collision/gravity
Diffstat (limited to 'window.cpp')
-rw-r--r--window.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/window.cpp b/window.cpp
index 3813a3c..e8677a8 100644
--- a/window.cpp
+++ b/window.cpp
@@ -70,3 +70,15 @@ SDL_Texture *sdl2LoadTexture(const char *path)
return tex;
}
+SDL_Surface *sdl2LoadSolid(const char *path)
+{
+ auto surface = IMG_Load(path);
+
+ if (surface == nullptr) {
+ std::cerr << "Unable to load image " << path << '!' << std::endl;
+ std::cerr << "SDL error: " << IMG_GetError() << std::endl;
+ }
+
+ return surface;
+}
+