mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-06-26 06:28:30 +02:00
c58c357a81
Previously, Flip Mode rendering had to be complicated and allocate another buffer to call FlipSurfaceVerticle, and it was just a mess. Instead, why not just do SDL_RenderCopyEx, and let SDL flip the screen for us? This ends up pretty massively simplifying the rendering code.
47 lines
861 B
C++
47 lines
861 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 resetRendererWorkaround(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 */
|