spacebox/src/Display.hpp

49 lines
1.4 KiB
C++

/* +------------------------------------------------------+
____/ \____ /| - Open source game framework licensed to freely use, |
\ / / | copy, modify and sell without restriction |
+--\ ^__^ /--+ | |
| ~/ \~ | | - created for <https://foam.shampoo.ooo> |
| ~~~~~~~~~~~~ | +------------------------------------------------------+
| SPACE ~~~~~ | /
| ~~~~~~~ BOX |/
+-------------*/
#pragma once
#include <sstream>
#include "glm/vec2.hpp"
#include "SDL.h"
#include "SDL_image.h"
#include "sdl2-gfx/SDL2_gfxPrimitives.h"
#include "sdl2-gfx/SDL2_rotozoom.h"
#include "Node.hpp"
#include "Box.hpp"
#include "Log.hpp"
namespace sb
{
class Display : public Node
{
public:
const static int bpp = 32;
inline const static Box ndc {-1.0f, -1.0f, 2.0f, 2.0f, true};
Display(Node*);
glm::ivec2 window_size() const;
Uint32 pixel_format(int = 0) const;
Box window_box(bool = false) const;
Box ndc_subsection(const Box&) const;
Box ndc_to_pixel(const Box&) const;
void screen_pixels(unsigned char*, int, int, int = 0, int = 0) const;
SDL_Surface* screen_surface() const;
SDL_Surface* screen_surface_from_pixels(unsigned char*, bool) const;
void respond(SDL_Event&);
void toggle_fullscreen() const;
};
}
#include "Game.hpp"