14 lines
367 B
C
14 lines
367 B
C
#include<SDL2/SDL.h>
|
|
#include"button.h"
|
|
#include"tools.h"
|
|
|
|
void button_draw(SDL_Renderer*ren,TTF_Font*font,Button*button)
|
|
{
|
|
if(!ren)return;
|
|
if(!button)return;
|
|
SDL_Rect r={.x=button->x,.y=button->y,.w=button->w,.h=button->h};
|
|
SDL_SetRenderDrawColor(ren,0,0,128,255);
|
|
SDL_RenderFillRect(ren,&r);
|
|
print_text(ren,font,0xffffff,button->x,button->y,button->label);
|
|
}
|