1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-01 18:43:33 +02:00
VVVVVV/desktop_version/src/Screen.h
Misa f5166c437e Add forced fullscreen mode
This is mainly to make sure the game is definitely set to fullscreen in
Big Picture and on the Steam Deck, and to also remove windowed options
that wouldn't make sense if you're not on a desktop (toggling
fullscreen, resize to nearest). Those options would also be removed on
console and mobile too.

There's a bit of an annoying bug where if you launch the game in forced
fullscreen mode, but then exit and relaunch in normal mode, your game
will have fullscreen window sizes but it won't be fullscreen. This is
because forced fullscreen mode tries to preserve your non-forced
fullscreen setting, but due to the way window sizes are stored and
queried, it can't preserve the non-forced window size. This is a bit
difficult to work around, so I'm just putting in a FIXME here because we
can fix it later and I'd rather have a slightly buggy forced fullscreen
mode than not have one at all.

Closes #849.
2021-12-25 23:01:45 -08:00

51 lines
1006 B
C++

#ifndef SCREEN_H
#define SCREEN_H
#include <SDL.h>
#include "ScreenSettings.h"
class Screen
{
public:
void init(const struct ScreenSettings* settings);
void destroy(void);
void GetSettings(struct 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 toggleScalingMode(void);
void toggleLinearFilter(void);
void toggleVSync(void);
bool isForcedFullscreen(void);
bool isWindowed;
bool isFiltered;
bool badSignalEffect;
int scalingMode;
bool vsync;
SDL_Window *m_window;
SDL_Renderer *m_renderer;
SDL_Texture *m_screenTexture;
SDL_Surface* m_screen;
};
#ifndef GAMESCREEN_DEFINITION
extern Screen gameScreen;
#endif
#endif /* SCREEN_H */