rotagon/sdl.c

31 lines
564 B
C
Raw Normal View History

2015-01-01 03:04:34 +00:00
/*
** sdl.c - <+DESC+>
**
** 2014 - Frank Villaro-Dixon <Frank@Villaro-Dixon.eu>
*/
#include <stdio.h>
#include <stdlib.h>
#include "SDL/SDL.h"
2015-01-01 11:05:40 +00:00
#include "SDL_mixer.h"
2015-01-01 03:04:34 +00:00
#include "game.h"
2015-01-01 04:32:07 +00:00
void
2015-01-01 03:04:34 +00:00
init_SDL(struct s_game *g)
{
/* initialize SDL */
2015-01-01 11:05:40 +00:00
SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO);
2015-01-01 03:04:34 +00:00
/* set the title bar */
SDL_WM_SetCaption("SDL Move", "SDL Move");
/* create window */
g->screen = SDL_SetVideoMode(SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
2015-01-01 11:05:40 +00:00
Mix_OpenAudio(22050,AUDIO_S16SYS,2,640);
Mix_Music *mus;
mus = Mix_LoadMUS("./mus.mp3");
Mix_PlayMusic(mus,1);
2015-01-01 03:04:34 +00:00
}