anaglym/AV.h
Josh Holtrop 11680bf3d7 added ag.loadSound(), Engine::loadSound(), Engine::addSound(), and Engine::m_sounds
git-svn-id: svn://anubis/anaglym/trunk@261 99a6e188-d820-4881-8870-2d33a10e2619
2010-02-24 04:55:27 +00:00

60 lines
1.5 KiB
C++

#ifndef VIDEO_H
#define VIDEO_H
#include "FileLoader/FileLoader.h"
#include <SDL.h>
class AV
{
public:
class Sound
{
public:
Sound();
bool load(FileLoader & fileLoader,
const FileLoader::Path & path);
protected:
SDL_RWops * m_rwops;
};
AV();
~AV();
void start(int width = 0, int height = 0,
bool fullscreen = true, bool grab_input = true,
int samples = 4);
void stop();
int getDefaultWidth() { return m_defaultWidth; }
int getDefaultHeight() { return m_defaultHeight; }
void toggleFullScreen() { SDL_WM_ToggleFullScreen(m_surface); }
int getWidth() { return m_width; }
int getHeight() { return m_height; }
SDL_Surface * getSurface() { return m_surface; }
void setCursorVisible(bool visible)
{
SDL_ShowCursor(visible ? SDL_ENABLE : SDL_DISABLE);
}
bool getCursorVisible()
{
return SDL_ShowCursor(SDL_QUERY) == SDL_ENABLE;
}
void setInputGrabbed(bool grabbed)
{
SDL_WM_GrabInput(grabbed ? SDL_GRAB_ON : SDL_GRAB_OFF);
}
bool getInputGrabbed()
{
return SDL_WM_GrabInput(SDL_GRAB_QUERY) == SDL_GRAB_ON;
}
protected:
int m_defaultWidth;
int m_defaultHeight;
int m_width;
int m_height;
SDL_Surface * m_surface;
bool m_fullscreen;
};
#endif