mightymandel v16

GPU-based Mandelbrot set explorer

poll.c File Reference

(v16)

#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <stdlib.h>
#include "logging.h"
#include "stopwatch.h"
#include "startup.h"
#include "render.h"
#include "interact.h"
#include "poll.h"
#include "filename.h"
#include "record.h"
+ Include dependency graph for poll.c:

Go to the source code of this file.

Data Structures

struct  poll

Functions

struct pollpoll_new (GLFWwindow *window, bool interactive, struct render_options *render_options, double ui_poll_timeout, double display_timeout, struct filename *filename, struct record *record)
 Create a new polling state structure.
void poll_delete (struct poll *poll)
 Delete a polling state structure.
enum poll_result poll_ui (struct poll *poll, bool should_wait)
 Poll the user interface for any events.
char * collect_metadata_to_string (const char *prefix, struct render_options *render_options, struct tiling *tiling, struct zoom *zoom, int pass)
void poll_swap_buffers (struct poll *poll)
 Display the result.
void poll_set_timeout (struct poll *poll, double timeout)

Data Structure Documentation

struct poll

Definition at line 18 of file poll.c.

+ Collaboration diagram for poll:
Data Fields
double display_timeout Time between displays.
struct filename * filename Filename generator.
bool interactive Whether to expect UI changes.
struct stopwatch * last_display Time since last display.
struct stopwatch * last_timeout Time since last set timeout.
struct stopwatch * last_ui_poll Time since last UI poll.
struct record * record Image recorder.
struct render_options * render_options Render options reference.
bool save_screenshot Whether to save a screenshot.
int screenshot_count Number of screenshots saved.
double timeout Timeout.
double ui_poll_timeout Time between UI polls.
GLFWwindow * window Window pointer reference.

Function Documentation

char* collect_metadata_to_string ( const char *  prefix,
struct render_options render_options,
struct tiling tiling,
struct zoom zoom,
int  pass 
)
void poll_delete ( struct poll poll)

Delete a polling state structure.

Parameters
pollThe polling state.

Definition at line 55 of file poll.c.

References poll::last_display, poll::last_ui_poll, and stopwatch_delete().

Referenced by main().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

struct poll* poll_new ( GLFWwindow *  window,
bool  interactive,
struct render_options render_options,
double  ui_poll_timeout,
double  display_timeout,
struct filename filename,
struct record record 
)
read

Create a new polling state structure.

Returns
The polling state.

Definition at line 34 of file poll.c.

References poll::display_timeout, poll::filename, poll::interactive, poll::last_display, poll::last_timeout, poll::last_ui_poll, poll::record, poll::render_options, poll::save_screenshot, poll::screenshot_count, stopwatch_new(), stopwatch_start(), poll::timeout, poll::ui_poll_timeout, and poll::window.

Referenced by main().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void poll_set_timeout ( struct poll poll,
double  timeout 
)

Definition at line 126 of file poll.c.

References poll::last_timeout, stopwatch_reset(), and poll::timeout.

Referenced by main().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void poll_swap_buffers ( struct poll poll)

Display the result.

Parameters
pollThe polling state.

Definition at line 114 of file poll.c.

References collect_metadata_to_string(), poll::filename, filename_name(), render_options::height, poll::record, record_do(), poll::render_options, poll::save_screenshot, poll::screenshot_count, render_options::width, and poll::window.

+ Here is the call graph for this function:

enum poll_result poll_ui ( struct poll poll,
bool  should_wait 
)

Poll the user interface for any events.

Parameters
pollThe polling state.
should_waitShould be false except in interactive main().
Returns
What the renderer should do next.

Definition at line 61 of file poll.c.

References interact::centerx, interact::centery, debug_message, poll::display_timeout, interact_reset(), poll::interactive, poll::last_display, poll::last_timeout, poll::last_ui_poll, poll_abort, poll_continue, poll_display, poll_timeout, interact::quit, interact::radius, poll::render_options, render_options_set_location(), interact::save_screenshot, poll::save_screenshot, interact::show_glitches, render_options::show_glitches, stopwatch_elapsed(), stopwatch_reset(), poll::timeout, poll::ui_poll_timeout, interact::updated, interact::weight, render_options::weight, and poll::window.

Referenced by fpxx_start_atom_abort(), main(), and render_calculate().

+ Here is the call graph for this function:

+ Here is the caller graph for this function: