P-E-R-R-Y
Utilitaires, contrats et vendors du moteur, en une seule doc
Loading...
Searching...
No Matches
SdlTexture Class Reference

Une image en memoire vive, televersee a la demande. More...

#include <SdlTexture.hpp>

Inheritance diagram for SdlTexture:
Collaboration diagram for SdlTexture:

Public Member Functions

 SdlTexture (std::string path)
 ~SdlTexture ()
bool isReady () const override
 notice if the texture is ready
Vector2f getSize () const override
 Get the Size object.
SDL_Texture * handle (SDL_Renderer *renderer) const
 La texture pour CE renderer, fabriquee au besoin.
 SdlTexture (std::string path)
 ~SdlTexture ()
bool isReady () const override
 notice if the texture is ready
Vector2f getSize () const override
 Get the Size object.
SDL_Texture * handle (SDL_Renderer *renderer) const
 La texture pour CE renderer, fabriquee au besoin.
Public Member Functions inherited from graphic::ITexture
virtual ~ITexture ()=default

Detailed Description

Une image en memoire vive, televersee a la demande.

C'est LA difference avec sfml et raylib, et elle vient du contrat : createTexture(path) ne recoit pas de fenetre, alors qu'une SDL_Texture appartient a un SDL_Renderer, qui appartient a une fenetre.

On garde donc la SDL_Surface - de la memoire vive, qui ne depend de rien - et on ne fabrique la texture qu'au premier dessin, pour le renderer qui la demande. Changer de fenetre refabrique, et l'ancienne est liberee.

Le meme objet traverse donc un changement de fenetre sans que l'appelant ait a le recharger.

Constructor & Destructor Documentation

◆ SdlTexture() [1/2]

SdlTexture::SdlTexture ( std::string path)
inline

◆ ~SdlTexture() [1/2]

SdlTexture::~SdlTexture ( )
inline

◆ SdlTexture() [2/2]

SdlTexture::SdlTexture ( std::string path)
inline

◆ ~SdlTexture() [2/2]

SdlTexture::~SdlTexture ( )
inline

Member Function Documentation

◆ getSize() [1/2]

Vector2f SdlTexture::getSize ( ) const
inlineoverridevirtual

Get the Size object.

Returns
Vector2f

Implements graphic::ITexture.

◆ getSize() [2/2]

Vector2f SdlTexture::getSize ( ) const
inlineoverridevirtual

Get the Size object.

Returns
Vector2f

Implements graphic::ITexture.

◆ handle() [1/2]

SDL_Texture * SdlTexture::handle ( SDL_Renderer * renderer) const
inline

La texture pour CE renderer, fabriquee au besoin.

◆ handle() [2/2]

SDL_Texture * SdlTexture::handle ( SDL_Renderer * renderer) const
inline

La texture pour CE renderer, fabriquee au besoin.

◆ isReady() [1/2]

bool SdlTexture::isReady ( ) const
inlineoverridevirtual

notice if the texture is ready

Returns
bool

Implements graphic::ITexture.

◆ isReady() [2/2]

bool SdlTexture::isReady ( ) const
inlineoverridevirtual

notice if the texture is ready

Returns
bool

Implements graphic::ITexture.


The documentation for this class was generated from the following files: