Improved text rendering and fixed a bug with the texture rendering
This commit is contained in:
1 parent
4659a4cd49
commit
8a4697e121
4 files changed
+44
-8
No files matched your search
@@ -74,8 +74,9 @@ void clip_render_rects_to_drawing_area(RenderRect *src, RenderRect *dest);
|
||||
|
||||
RenderRect get_texture_asset_rect(AssetID id);
|
||||
void render_texture_asset(AssetID id, RenderRect *src, RenderRect *dest);
|
||||
void render_text_with_font_asset(AssetID id, const char *text, float x,
|
||||
float y);
|
||||
TextSize get_text_size_from_font_asset(AssetID id, const char *text);
|
||||
void render_text_with_font_asset(AssetID id, const char *text, float x, float y,
|
||||
SDL_Color color);
|
||||
void set_font_asset_size(AssetID id, uint32_t size);
|
||||
// END RENDERING API
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define RENDERER_H
|
||||
|
||||
#include "SDL.h"
|
||||
#include "SDL_pixels.h"
|
||||
#include "SDL_render.h"
|
||||
#include "SDL_surface.h"
|
||||
#include "SDL_video.h"
|
||||
@@ -14,6 +15,11 @@ extern "C" {
|
||||
|
||||
typedef struct renderer Renderer;
|
||||
|
||||
typedef struct {
|
||||
int32_t width;
|
||||
int32_t height;
|
||||
} TextSize;
|
||||
|
||||
typedef struct {
|
||||
float x;
|
||||
float y;
|
||||
@@ -36,6 +42,7 @@ Renderer *create_renderer(SDL_Window *window);
|
||||
*/
|
||||
void get_render_output_size(Renderer *renderer, int32_t *w, int32_t *h);
|
||||
|
||||
void set_render_draw_color(const Renderer *renderer, SDL_Color color);
|
||||
void render_clear(const Renderer *renderer, SDL_Color color);
|
||||
void draw_rect(const Renderer *renderer, SDL_Color color, float x, float y,
|
||||
float w, float h);
|
||||
|
||||
Reference in new issue
Block a user