int main(int argc, char *argv[]) { int done; eolLine fps; int i; for(i = 1;i < argc;i++) { if(strcmp(argv[i],"-fs")== 0) { } if(strcmp(argv[i],"-wm")== 0) { } } Init_All(argv[0]); Setup_All(); done = 0; do { eol_input_update(); eol_mouse_update(); eol_level_update_active(); eol_entity_think_all(); eol_entity_update_all(); eol_particle_update_all(); eol_camera_update(); eol_window_update_all(); eol_graphics_frame_begin(); { eol_window_draw_all(); eol_mouse_draw(); } sprintf(fps,"FPS: %f",eol_graphics_get_FPS()); eol_font_draw_text_justify( fps, 640, 0, eol_vec3d(1,0,0), 1, 2, eolJustifyRight); eol_graphics_frame_end(); if((eol_input_quit_check()) || ((eol_input_is_key_released(SDLK_F4)) && (eol_input_is_mod_held(KMOD_ALT))) || ((eol_input_is_key_released(SDLK_q)) && (eol_input_is_mod_held(KMOD_ALT)))) { eol_dialog_quit(); } }while(!done); exit(0); return 0; }
void eol_component_label_draw(eolComponent *component, eolRect bounds) { eolComponentLabel *label = eol_component_get_label_data(component); if (label == NULL)return; if (label->buffer == NULL)return; if (label->font == NULL) { if (label->wordWrap) { eol_font_draw_text_block( label->buffer->str, bounds.x, bounds.y, bounds.w, 0, label->color, label->alpha, label->fontSize ); } else { eol_font_draw_text_justify( label->buffer->str, bounds.x, bounds.y, label->color, label->alpha, label->fontSize, label->justify ); } } else { if (label->wordWrap) { eol_font_draw_text_block_custom( label->buffer->str, bounds, label->color, label->alpha, label->font ); } else { eol_font_draw_text_justify_custom( label->buffer->str, bounds.x, bounds.y, label->color, label->alpha, label->font, label->justify ); } } }
void eol_component_button_draw(eolComponent *component,eolRect bounds) { eolRect r; eolComponentButton *button = NULL; eolSprite *img = NULL; eolInt x,y; button = eol_component_get_button_data(component); x = bounds.x; y = bounds.y; if (button == NULL)return; if ((component->state >= 0) && (component->state < eolButtonStateMax)) { img = button->button[component->state]; if (img != NULL) { r = eol_font_get_bounds( button->buttonText, button->fontSize ); eol_sprite_draw(img, 0, bounds.x, bounds.y); x = bounds.x + (img->frameWidth/2); y = bounds.y + (img->frameHeight/2) - (r.h*0.7); } eol_font_draw_text_justify( button->buttonText, x, y, _eol_component_button_color[component->state], button->alpha, button->fontSize, button->justify ); } }
void eol_component_entry_draw(eolComponent *component, eolRect bounds) { eolRect r; eolComponentEntry *entry = eol_component_get_entry_data(component); if (entry == NULL)return; r.x = bounds.x - 1; r.y = bounds.y - 1; r.w = bounds.w + 2; r.h = bounds.h + 2; eol_draw_solid_rect(r,eol_vec3d(1,1,1),1); eol_draw_solid_rect(bounds,entry->bgcolor,1); if (entry->buffer->len <= 0)return; if (entry->font == NULL) { if (entry->wordWrap) { eol_font_draw_text_block( entry->buffer->str, bounds.x, bounds.y, bounds.w, 0, entry->color, entry->alpha, entry->fontSize ); } else { eol_font_draw_text_justify( entry->buffer->str, bounds.x, bounds.y, entry->color, entry->alpha, entry->fontSize, entry->justify ); } } else { if (entry->wordWrap) { eol_font_draw_text_block_custom( entry->buffer->str, bounds, entry->color, entry->alpha, entry->font ); } else { eol_font_draw_text_justify_custom( entry->buffer->str, bounds.x, bounds.y, entry->color, entry->alpha, entry->font, entry->justify ); } } }
int main(int argc, char *argv[]) { int done; int i; float radius = 0.00001; eolVec3D point = {0,0,-5}; eolLine fps; eolLight *light = NULL; for(i = 1;i < argc;i++) { if(strcmp(argv[i],"-fs")== 0) { } if(strcmp(argv[i],"-wm")== 0) { } } Init_All(argv[0]); eol_camera_config(); eol_camera_set_height(30); eol_camera_init(); done = 0; MakeTestWindow(); eol_mouse_show(); light = eol_light_area_new(); eol_light_set_color(light,eol_vec3d(0.5,0.5,0.5)); eol_light_set_radius(light,radius); eol_lighting_setup_rep_plot(); srandom(SDL_GetTicks()); CreateTestLevel(); do { eol_light_move(light,point); eol_light_update(light); eol_input_update(); eol_mouse_update(); eol_level_update_active(); eol_entity_think_all(); eol_entity_update_all(); eol_particle_update_all(); eol_window_update_all(); eol_graphics_frame_begin(); eol_window_draw_all(); sprintf(fps,"FPS: %f",eol_graphics_get_FPS()); eol_font_draw_text_justify( fps, 640, 0, eol_vec3d(1,0,0), 1, 2, eolJustifyRight); eol_mouse_draw(); eol_graphics_frame_end(); if((eol_input_quit_check()) || ((eol_input_is_key_pressed(SDLK_F4)) && (eol_input_is_mod_held(KMOD_ALT)))) { eol_dialog_quit(); } }while(!done); exit(0); return 0; }