revert change in rasterworks_example.c

git-svn-id: svn://kolibrios.org@6496 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Serhii Sakhno 2016-08-21 23:16:26 +00:00
parent 7dc0d7cd36
commit 69a0fb65c6

View File

@ -14,14 +14,13 @@ int main()
kolibri_gui_init();
kolibri_rasterworks_init();
/* Set gui_event to REDRAW so that window is drawn in first iteration */
unsigned int gui_event;
unsigned int gui_event = KOLIBRI_EVENT_REDRAW;
oskey_t key;
unsigned int pressed_button
//extern volatile unsigned press_key;
kolibri_window *main_window = kolibri_new_window(50, 50, 800, 300, "rasterworks example");
extern volatile unsigned press_key;
int ln_str = countUTF8Z("Пример работы", -1);
void *buffi = malloc(768*256*3 * sizeof(char));
@ -39,28 +38,40 @@ int main()
drawText(buffi, 0, 128, "Пример работы", ln_str, 0xFF000000, 0x8030C18);
drawText(buffi, 0, 160, "Пример работы", ln_str, 0xFF000000, 0x0F031428);
while(gui_event = get_os_event())
do /* Start of main activity loop */
{
switch (gui_event)
if(gui_event == KOLIBRI_EVENT_REDRAW)
{
case KOLIBRI_EVENT_REDRAW:
kolibri_handle_event_redraw(main_window);
DrawBitmap(buffi, 5, 5, 768, 256);
break;
}
else if(gui_event == KOLIBRI_EVENT_KEY)
{
key = get_key();
switch (key.code)
{
}
press_key = key.val;
case KOLIBRI_EVENT_BUTTON:
pressed_button = kolibri_button_get_identifier();
kolibri_handle_event_key(main_window);
}
else if(gui_event == KOLIBRI_EVENT_BUTTON)
{
unsigned int pressed_button = kolibri_button_get_identifier();
switch (pressed_button)
{
case BUTTON_CLOSE:
kolibri_exit();
}
break;
case KOLIBRI_EVENT_MOUSE:
}
else if(gui_event == KOLIBRI_EVENT_MOUSE)
{
kolibri_handle_event_mouse(main_window);
break;
}
}
} while((gui_event = get_os_event())); /* End of main activity loop */
/* kolibri_quit(); */
return 0;
}