Rose
Classes | Namespaces | Typedefs | Enumerations | Functions
GraphicsModel.h File Reference

Abstraction of the graphics model. More...

#include "Configuration.h"
#include <SDL.h>
#include <memory>
#include <functional>
#include <Utilities.h>
#include "Visual.h"
#include "Color.h"
#include "Texture.h"
#include "CommonSignals.h"
Include dependency graph for GraphicsModel.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  rose::gm::SdlWindowDestroy
 A functor to destroy an SDL_Window in a std::unique_ptr (rose::sdl::Window). More...
 
struct  rose::gm::RenderFlip
 A Widget manipulator to indicate if and how rendering a texture should be flipped. More...
 
class  rose::gm::Context
 Context More...
 
class  rose::gm::Context::RendererDestroy
 A functor to destroy an SDL_Renderer. More...
 
class  rose::gm::RenderTargetGuardException
 Thrown by RenderTargetGuard on errors. More...
 
class  rose::gm::DrawColorGuardException
 Thrown by DrawColorGuard on errors. More...
 
class  rose::gm::RenderTargetGuard
 Store the current render target replacing it with a new render target. More...
 
class  rose::gm::DrawColorGuard
 Store the current draw color replacing it with a new draw color. More...
 
class  rose::gm::ClipRectangleGuard
 Store the current clip rectangle replacing it with a new clip rectangle. More...
 
class  rose::gm::GraphicsModel
 

Namespaces

 rose
 ToDo: There is an issue that the initial scroll interaction is lost if the click/press lands on a Widget and not a Container (by user observation).
 

Typedefs

using rose::gm::SdlWindow = std::unique_ptr< SDL_Window, SdlWindowDestroy >
 An SDL_Window unique pointer.
 

Enumerations

enum  rose::gm::RoseErrorCode {
  rose::gm::RoseErrorCode::OK, rose::gm::RoseErrorCode::ROSE_EXCEPTION, rose::gm::RoseErrorCode::SDL_WINDOW_CREATE, rose::gm::RoseErrorCode::SDL_RENDERER_CREATE,
  rose::gm::RoseErrorCode::XDG_PATH_FAIL
}
 Rose object error codes.
 

Functions

uint32_t rose::gm::mapRGBA (SDL_PixelFormat *format, const color::RGBA &color)
 Map a color::RGBA to a uint32_t. More...
 
color::RGBA rose::gm::getRGBA (SDL_PixelFormat *format, uint32_t pixel)
 

Detailed Description

Abstraction of the graphics model.

Author
Richard Buckley richa.nosp@m.rd.b.nosp@m.uckle.nosp@m.y@ie.nosp@m.ee.or.nosp@m.g
Version
1.0
Date
2021-03-04

Function Documentation

◆ mapRGBA()

uint32_t rose::gm::mapRGBA ( SDL_PixelFormat *  format,
const color::RGBA color 
)

Map a color::RGBA to a uint32_t.

Parameters
formatA pointer to an SDL_PixelFormat (from a Surface object for example).
colorThe color::RGBA to map.
Returns
The color::RGBA mapped to a uint32_t