Added support for desktop full screen with pillarboxing and letterboxing
and started adding some comments to the code
This commit is contained in:
1 parent
ffaa6e5ae7
commit
e110b1f2fd
10 files changed
+351
-77
No files matched your search
+28
-3
@@ -14,16 +14,41 @@ extern "C" {
|
||||
|
||||
typedef struct renderer Renderer;
|
||||
|
||||
Renderer *create_renderer();
|
||||
bool init_renderer(Renderer *renderer, SDL_Window *window);
|
||||
void get_drawable_size(Renderer *renderer, int32_t *w, int32_t *h);
|
||||
/**
|
||||
* Attempts to allocate a Renderer object on the heap.
|
||||
*
|
||||
* Returns the pointer to the object when it succeeds, or NULL if it fails.
|
||||
*/
|
||||
Renderer *create_renderer(SDL_Window *window);
|
||||
|
||||
/**
|
||||
* Returns the valid drawable area that the renderer can use.
|
||||
*
|
||||
* Useful when rendering on screens that support high DPI since the drawable
|
||||
* area is usually bigger than the user-defined size.
|
||||
*/
|
||||
void get_render_output_size(Renderer *renderer, int32_t *w, int32_t *h);
|
||||
|
||||
/**
|
||||
* Attempts to load an SDL_Texture from a file path.
|
||||
*
|
||||
* Returns a pointer to the object if it succeeds or NULL when it fails.
|
||||
*/
|
||||
SDL_Texture *load_texture(const Renderer *renderer, const char *path);
|
||||
|
||||
void render_clear(const Renderer *renderer, SDL_Color color);
|
||||
void fill_rect(const Renderer *renderer, SDL_Color color, float x, float y,
|
||||
float w, float h);
|
||||
void render_surface(const Renderer *renderer, SDL_Surface *surface, float x,
|
||||
float y, float w, float h);
|
||||
void render_texture(const Renderer *renderer, SDL_Texture *texture, float x,
|
||||
float y, float w, float h);
|
||||
void swap_buffers(const Renderer *renderer);
|
||||
|
||||
/**
|
||||
* Frees the memory allocated to the Renderer object and performs the
|
||||
* necessary cleanup.
|
||||
*/
|
||||
void destroy_renderer(Renderer **renderer);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
Reference in new issue
Block a user