2003-05-07 20:04:26 +00:00
|
|
|
#ifndef BOINC_GRAPHICS_API_H
|
|
|
|
#define BOINC_GRAPHICS_API_H
|
|
|
|
|
2003-10-02 18:51:38 +00:00
|
|
|
// The API (functions called by the app)
|
2003-10-31 22:37:46 +00:00
|
|
|
extern int boinc_init_graphics();
|
|
|
|
extern int boinc_finish_graphics();
|
2003-10-02 21:30:14 +00:00
|
|
|
|
2003-10-02 18:51:38 +00:00
|
|
|
// Functions that must be supplied by the app
|
2004-05-27 23:46:07 +00:00
|
|
|
// application needs to define mouse, keyboard handlers
|
2003-10-02 18:51:38 +00:00
|
|
|
//
|
2003-10-31 22:37:46 +00:00
|
|
|
extern void app_graphics_render(int xs, int ys, double time_of_day);
|
|
|
|
extern void app_graphics_init();
|
|
|
|
// called each time a window is opened;
|
|
|
|
// called in the graphics thread
|
|
|
|
extern void app_graphics_reread_prefs();
|
|
|
|
// called when get REREAD_PREFS message from core client.
|
|
|
|
// called in the graphics thread
|
|
|
|
extern void app_graphics_resize(int width, int height);
|
2004-05-27 23:46:07 +00:00
|
|
|
extern void boinc_app_mouse_button(int x, int y, int which, bool is_down);
|
|
|
|
extern void boinc_app_mouse_move(int x, int y, bool left, bool middle, bool right);
|
|
|
|
extern void boinc_app_key_press(int, int);
|
|
|
|
extern void boinc_app_key_release(int, int);
|
2003-05-07 20:04:26 +00:00
|
|
|
|
2003-10-02 18:51:38 +00:00
|
|
|
// Implementation stuff
|
|
|
|
//
|
2003-10-14 20:37:02 +00:00
|
|
|
extern double boinc_max_fps;
|
|
|
|
extern double boinc_max_gfx_cpu_frac;
|
2003-10-05 05:26:59 +00:00
|
|
|
extern bool throttled_app_render(int, int, double);
|
2003-10-02 18:51:38 +00:00
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
extern HANDLE hQuitEvent;
|
|
|
|
extern HANDLE graphics_threadh;
|
2003-11-06 20:27:07 +00:00
|
|
|
extern BOOL win_loop_done;
|
2003-10-02 18:51:38 +00:00
|
|
|
#endif
|
|
|
|
|
2003-05-07 20:04:26 +00:00
|
|
|
#endif
|