QTfrontend/SDLs.cpp
changeset 1223 41d7283934c1
parent 1191 5539aa59f703
child 1224 0b9fbee5ceda
--- a/QTfrontend/SDLs.cpp	Sat Aug 16 13:29:18 2008 +0000
+++ b/QTfrontend/SDLs.cpp	Sat Aug 16 14:28:44 2008 +0000
@@ -19,15 +19,22 @@
 #include "SDLs.h"
 
 #include "SDL.h"
+#include "hwconsts.h"
 
 SDLInteraction::SDLInteraction()
 {
 	SDL_Init(SDL_INIT_VIDEO);
+	SDL_Init(SDL_INIT_AUDIO);
+	Mix_OpenAudio(22050, 0x8010, 2, 512);
+	
+	Mix_Volume(-1, 50);
+	music = Mix_LoadMUS(QString(datadir->absolutePath() + "/Music/main theme.ogg").toAscii().constData());
+	StartMusic();
 }
 
 SDLInteraction::~SDLInteraction()
 {
-	SDL_Quit();
+//	SDL_Quit();
 }
 
 QStringList SDLInteraction::getResolutions() const
@@ -50,3 +57,12 @@
 
 	return result;
 }
+void SDLInteraction::StartMusic()
+{
+	Mix_PlayMusic(music, -1);
+}
+
+void SDLInteraction::StopMusic()
+{
+
+}