Skip to content

Commit 873e8eb

Browse files
committed
You can now get the background color
1 parent 30d726b commit 873e8eb

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

include/spritetools_render.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ float ST_RenderFPS(void);
3737
/* Sets background to given color */
3838
void ST_RenderSetBackground(u8 red, u8 green, u8 blue);
3939

40+
/* Returns background color in the RGBA8 format */
41+
u32 ST_RenderGetBackground(void);
42+
4043
/*******************************\
4144
|* Render Spritesheets *|
4245
\*******************************/

source/spritetools_render.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
#include <3ds.h>
88
#include <spritetools_render.h>
99

10+
static u32 st_background = 0;
11+
1012
/*****************************\
1113
|* General Functions *|
1214
\*****************************/
@@ -17,6 +19,7 @@ int ST_RenderInit(void)
1719
if (!sf2d_init())
1820
return 0;
1921
sf2d_set_clear_color(RGBA8(0x00, 0x00, 0x00, 0xFF));
22+
st_background = RGBA8(0x00, 0x00, 0x00, 0xFF);
2023

2124
return 1;
2225
}
@@ -67,6 +70,13 @@ float ST_RenderFPS(void)
6770
void ST_RenderSetBackground(u8 red, u8 green, u8 blue)
6871
{
6972
sf2d_set_clear_color(RGBA8(red, green, blue, 0xFF));
73+
st_background = RGBA8(red, green, blue, 0xFF);
74+
}
75+
76+
/* Returns background color in the RGBA8 format */
77+
u32 ST_RenderGetBackground(void)
78+
{
79+
return st_background;
7080
}
7181

7282
/*******************************\

0 commit comments

Comments
 (0)