forked from JailDoctor/JailAudio
First commit
This commit is contained in:
30
main.cpp
Normal file
30
main.cpp
Normal file
@@ -0,0 +1,30 @@
|
||||
#include "jail_audio.h"
|
||||
#include <stdlib.h>
|
||||
#include <SDL2/SDL.h>
|
||||
|
||||
SDL_Event event;
|
||||
SDL_Window *sdlWindow;
|
||||
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
SDL_Init(SDL_INIT_EVERYTHING);
|
||||
sdlWindow = SDL_CreateWindow("JailAudio", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 320, 240, SDL_WINDOW_SHOWN);
|
||||
JA_Init();
|
||||
|
||||
JA_PlayMusic("intro2.ogg");
|
||||
JA_Sound peiv = JA_LoadSound("menu_select.wav");
|
||||
|
||||
bool should_exit = false;
|
||||
while(!should_exit) {
|
||||
while(SDL_PollEvent(&event)) {
|
||||
if (event.type == SDL_QUIT) { should_exit = true; break; }
|
||||
if (event.type == SDL_KEYDOWN) {
|
||||
JA_PlaySound(peiv);
|
||||
}
|
||||
}
|
||||
}
|
||||
SDL_DestroyWindow(sdlWindow);
|
||||
SDL_Quit();
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user