forked from KolibriOS/kolibrios
revert change in rasterworks_example.c
git-svn-id: svn://kolibrios.org@6496 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
7dc0d7cd36
commit
69a0fb65c6
@ -14,14 +14,13 @@ int main()
|
|||||||
kolibri_gui_init();
|
kolibri_gui_init();
|
||||||
kolibri_rasterworks_init();
|
kolibri_rasterworks_init();
|
||||||
/* Set gui_event to REDRAW so that window is drawn in first iteration */
|
/* Set gui_event to REDRAW so that window is drawn in first iteration */
|
||||||
|
unsigned int gui_event = KOLIBRI_EVENT_REDRAW;
|
||||||
unsigned int gui_event;
|
|
||||||
oskey_t key;
|
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");
|
kolibri_window *main_window = kolibri_new_window(50, 50, 800, 300, "rasterworks example");
|
||||||
|
|
||||||
|
extern volatile unsigned press_key;
|
||||||
|
|
||||||
int ln_str = countUTF8Z("Пример работы", -1);
|
int ln_str = countUTF8Z("Пример работы", -1);
|
||||||
void *buffi = malloc(768*256*3 * sizeof(char));
|
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, 128, "Пример работы", ln_str, 0xFF000000, 0x8030C18);
|
||||||
drawText(buffi, 0, 160, "Пример работы", ln_str, 0xFF000000, 0x0F031428);
|
drawText(buffi, 0, 160, "Пример работы", ln_str, 0xFF000000, 0x0F031428);
|
||||||
|
|
||||||
while(gui_event = get_os_event())
|
do /* Start of main activity loop */
|
||||||
{
|
|
||||||
switch (gui_event)
|
|
||||||
{
|
{
|
||||||
case KOLIBRI_EVENT_REDRAW:
|
if(gui_event == KOLIBRI_EVENT_REDRAW)
|
||||||
kolibri_handle_event_redraw(main_window);
|
{
|
||||||
DrawBitmap(buffi, 5, 5, 768, 256);
|
kolibri_handle_event_redraw(main_window);
|
||||||
break;
|
DrawBitmap(buffi, 5, 5, 768, 256);
|
||||||
|
}
|
||||||
case KOLIBRI_EVENT_BUTTON:
|
else if(gui_event == KOLIBRI_EVENT_KEY)
|
||||||
pressed_button = kolibri_button_get_identifier();
|
{
|
||||||
switch (pressed_button)
|
key = get_key();
|
||||||
{
|
switch (key.code)
|
||||||
case BUTTON_CLOSE:
|
{
|
||||||
kolibri_exit();
|
}
|
||||||
}
|
press_key = key.val;
|
||||||
break;
|
|
||||||
|
kolibri_handle_event_key(main_window);
|
||||||
case KOLIBRI_EVENT_MOUSE:
|
}
|
||||||
kolibri_handle_event_mouse(main_window);
|
else if(gui_event == KOLIBRI_EVENT_BUTTON)
|
||||||
break;
|
{
|
||||||
}
|
unsigned int pressed_button = kolibri_button_get_identifier();
|
||||||
}
|
switch (pressed_button)
|
||||||
|
{
|
||||||
|
case BUTTON_CLOSE:
|
||||||
|
kolibri_exit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(gui_event == KOLIBRI_EVENT_MOUSE)
|
||||||
|
{
|
||||||
|
kolibri_handle_event_mouse(main_window);
|
||||||
|
}
|
||||||
|
|
||||||
|
} while((gui_event = get_os_event())); /* End of main activity loop */
|
||||||
|
|
||||||
|
/* kolibri_quit(); */
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user