51 lines
835 B
C
51 lines
835 B
C
|
#include <gint/display.h>
|
||
|
#include <gint/keyboard.h>
|
||
|
|
||
|
static void draw_menu(int selected)
|
||
|
{
|
||
|
extern bopti_image_t img_logo;
|
||
|
extern bopti_image_t img_bouton;
|
||
|
extern bopti_image_t img_bouton_selection;
|
||
|
|
||
|
dclear(C_RGB(17,9,2));
|
||
|
dimage(72,20, &img_logo);
|
||
|
dimage(95,100, &img_bouton);
|
||
|
|
||
|
for(int i = 1; i <= 2; i++)
|
||
|
{
|
||
|
int x = 95;
|
||
|
int y = 100 + 45*(i-1);
|
||
|
|
||
|
if (i==selected)
|
||
|
dimage(x,y, &img_bouton_selection);
|
||
|
else
|
||
|
dimage(x,y, &img_bouton);
|
||
|
|
||
|
if (i==1)
|
||
|
dtext(172, 115, C_WHITE, "Jouer");
|
||
|
else
|
||
|
dtext(155, 160, C_WHITE, "Parametres");
|
||
|
}
|
||
|
}
|
||
|
|
||
|
int main(void)
|
||
|
{
|
||
|
int selected = 1;
|
||
|
int key = 0;
|
||
|
|
||
|
while (key != KEY_EXE)
|
||
|
{
|
||
|
draw_menu(selected);
|
||
|
dupdate();
|
||
|
|
||
|
key = getkey().key;
|
||
|
|
||
|
if (key == KEY_UP && selected == 2)
|
||
|
selected--;
|
||
|
if (key == KEY_DOWN && selected == 1)
|
||
|
selected++;
|
||
|
}
|
||
|
|
||
|
return 1;
|
||
|
}
|