Skip to content

Commit

Permalink
You can now get the background color
Browse files Browse the repository at this point in the history
  • Loading branch information
BtheDestroyer committed Dec 31, 2016
1 parent 30d726b commit 873e8eb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/spritetools_render.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ float ST_RenderFPS(void);
/* Sets background to given color */
void ST_RenderSetBackground(u8 red, u8 green, u8 blue);

/* Returns background color in the RGBA8 format */
u32 ST_RenderGetBackground(void);

/*******************************\
|* Render Spritesheets *|
\*******************************/
Expand Down
10 changes: 10 additions & 0 deletions source/spritetools_render.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include <3ds.h>
#include <spritetools_render.h>

static u32 st_background = 0;

/*****************************\
|* General Functions *|
\*****************************/
Expand All @@ -17,6 +19,7 @@ int ST_RenderInit(void)
if (!sf2d_init())
return 0;
sf2d_set_clear_color(RGBA8(0x00, 0x00, 0x00, 0xFF));
st_background = RGBA8(0x00, 0x00, 0x00, 0xFF);

return 1;
}
Expand Down Expand Up @@ -67,6 +70,13 @@ float ST_RenderFPS(void)
void ST_RenderSetBackground(u8 red, u8 green, u8 blue)
{
sf2d_set_clear_color(RGBA8(red, green, blue, 0xFF));
st_background = RGBA8(red, green, blue, 0xFF);
}

/* Returns background color in the RGBA8 format */
u32 ST_RenderGetBackground(void)
{
return st_background;
}

/*******************************\
Expand Down

1 comment on commit 873e8eb

@BtheDestroyer
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.