summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjusipat <justin10patrick@gmail.com>2022-01-25 10:35:31 -0700
committerjusipat <justin10patrick@gmail.com>2022-01-25 10:35:31 -0700
commitf02693eed80de7ebf1d03f3d7a8069dd8a3b53ae (patch)
treee21d8cb90a9d62068435a70fcb8754183aa65c88
parente0f29aa0b03807ef3968edd5673d9dc5637f32af (diff)
Added music player
-rw-r--r--.gitignore3
-rw-r--r--main.cpp11
-rw-r--r--res/Starliner.wav.REMOVED.git-id1
3 files changed, 14 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index d79e2a7..896b8e6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,4 +6,5 @@ Release/
*.sln
*.vcxproj
*.vcxproj.filters
-*.vcxproj.user \ No newline at end of file
+*.vcxproj.user
+/stb_image.h
diff --git a/main.cpp b/main.cpp
index 9e3b621..9499e7e 100644
--- a/main.cpp
+++ b/main.cpp
@@ -2,9 +2,14 @@
#include <cmath>
#include "window.h"
+#include "windows.h"
#include "bitmap.h"
#include "level.h"
+#include "iostream"
+#pragma comment(lib, "winmm.lib") // For audio files
+
+
struct Point2D {
float x, y;
};
@@ -85,10 +90,16 @@ int main(int argc, char **argv)
Bitmap bitmap(Width, Height);
+ //bool audio_play1 = PlaySound(TEXT("res\\Starliner.wav"), NULL, SND_LOOP | SND_ASYNC);
+ //Adds Starliner.wav and plays it on startup and loops,
+ //I imagine this would get very annoying during debug so it's commented out for now.
+
int xOffs = 0, yOffs = 0;
int xDrag, yDrag;
bool isDragging = false;
+
+
window.onMouseDown([&](int button, int x, int y) {
if (button == 1) {
static const auto update_direction = [&](int xt, int yt) {
diff --git a/res/Starliner.wav.REMOVED.git-id b/res/Starliner.wav.REMOVED.git-id
new file mode 100644
index 0000000..79f5427
--- /dev/null
+++ b/res/Starliner.wav.REMOVED.git-id
@@ -0,0 +1 @@
+fefc606c3ca8fd6ad7fd3f979a45037a42fda6a8 \ No newline at end of file