/** @brief Main in-game rendering routine. * * @param b Board configuration to render. */ void draw_scene(board_t *b, GLuint fb, int reflections) { char temp[80]; int clock_seconds = 0; int clock_minutes = 0; glBindFramebuffer(GL_FRAMEBUFFER, fb); transition_update(); gg_dialog_cleanup(); glDisable(GL_BLEND); glDepthFunc(GL_ALWAYS); draw_backdrop(); glEnable(GL_BLEND); glDepthFunc(GL_LEQUAL); go_3d(get_screen_width(), get_screen_height()); render_scene_3d(b, fb, reflections); mouse_square = find_square(get_true_mouse_x(), get_true_mouse_y()); glBindFramebuffer(GL_FRAMEBUFFER, fb); resize_window(get_screen_width(), get_screen_height()); glPushMatrix(); draw_ui_elements(); // draw_move_list(get_col(COL_WHITE), get_col(COL_YELLOW)); // draw_capture_list(get_col(COL_WHITE)); clock_minutes = (((SDL_GetTicks() - get_turn_counter()) / 1000) / 60); clock_seconds = ((SDL_GetTicks() - get_turn_counter()) / 1000) - (clock_minutes * 60); snprintf(temp, sizeof(temp), "%i:%02i", clock_minutes, clock_seconds); /*text_draw_string( 303, 440, temp, 1, &col_black);*/ glPopMatrix(); /*if ( get_white_in_check() == TRUE ) text_draw_string_bouncy( 180, 420, "White is in check!", 1, get_col(COL_WHITE)); else if ( get_black_in_check() == TRUE ) text_draw_string_bouncy( 180, 420, "Black is in check!", 1, get_col(COL_WHITE));*/ gg_dialog_render_all(); if (get_fading_out()) { if (!draw_fade(FADE_OUT)) set_switch_to_menu(TRUE); } else { if (get_show_egg()) draw_sonic_fade(FADE_IN); else draw_fade(FADE_IN); } /* Draw mouse cursor.. */ draw_texture(get_mouse_cursor(), get_mouse_x(), (479 - get_mouse_y() - 32), 32, 32, 1.0f, get_col(COL_WHITE)); }
static void render_fire (uint32_t time_offset, void *params, int iparam, viewpoint *view, lighting *lights, int pass) { if (pass == PVR_LIST_OP_POLY) draw_backdrop (); if (pass == PVR_LIST_TR_POLY) { draw_texture (); warp_active = 1 - warp_active; } }
// Render the game to the screen void update_screen(void) { // Locals int elapsed; frame++; draw_backdrop(); draw_entities(); draw_overlay(); // Lock the refresh rate to 60 FPS SDL_Flip(screen); elapsed = frame_start_time - SDL_GetTicks(); if (elapsed < FRAME_TIME) { SDL_Delay(FRAME_TIME - elapsed); } }