mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-09-28 17:27:23 +02:00
6ba7058a0e
SDL just got an API to toggle VSync without having to tear down the renderer ( libsdl-org/SDL#4157 ). We can remove the workaround and use that instead. For now, we are putting it behind an ifdef until SDL 2.0.18 officially releases in November. Fixes #831.
46 lines
921 B
C++
46 lines
921 B
C++
#ifndef SCREEN_H
|
|
#define SCREEN_H
|
|
|
|
#include <SDL.h>
|
|
|
|
#include "ScreenSettings.h"
|
|
|
|
class Screen
|
|
{
|
|
public:
|
|
void init(const ScreenSettings& settings);
|
|
void destroy(void);
|
|
|
|
void GetSettings(ScreenSettings* settings);
|
|
|
|
void LoadIcon(void);
|
|
|
|
void ResizeScreen(int x, int y);
|
|
void ResizeToNearestMultiple(void);
|
|
void GetWindowSize(int* x, int* y);
|
|
|
|
void UpdateScreen(SDL_Surface* buffer, SDL_Rect* rect);
|
|
void FlipScreen(bool flipmode);
|
|
|
|
const SDL_PixelFormat* GetFormat(void);
|
|
|
|
void toggleFullScreen(void);
|
|
void toggleStretchMode(void);
|
|
void toggleLinearFilter(void);
|
|
void toggleVSync(void);
|
|
|
|
bool isWindowed;
|
|
bool isFiltered;
|
|
bool badSignalEffect;
|
|
int stretchMode;
|
|
bool vsync;
|
|
|
|
SDL_Window *m_window;
|
|
SDL_Renderer *m_renderer;
|
|
SDL_Texture *m_screenTexture;
|
|
SDL_Surface* m_screen;
|
|
|
|
SDL_Rect filterSubrect;
|
|
};
|
|
|
|
#endif /* SCREEN_H */
|