2008-08-06 18:36:30 +00:00
|
|
|
// This file is part of BOINC.
|
2005-01-20 23:22:22 +00:00
|
|
|
// http://boinc.berkeley.edu
|
2008-08-06 18:36:30 +00:00
|
|
|
// Copyright (C) 2008 University of California
|
2004-12-13 01:21:50 +00:00
|
|
|
//
|
2008-08-06 18:36:30 +00:00
|
|
|
// BOINC is free software; you can redistribute it and/or modify it
|
|
|
|
// under the terms of the GNU Lesser General Public License
|
|
|
|
// as published by the Free Software Foundation,
|
|
|
|
// either version 3 of the License, or (at your option) any later version.
|
2005-01-20 23:22:22 +00:00
|
|
|
//
|
2008-08-06 18:36:30 +00:00
|
|
|
// BOINC is distributed in the hope that it will be useful,
|
2005-01-20 23:22:22 +00:00
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
// See the GNU Lesser General Public License for more details.
|
|
|
|
//
|
2008-08-06 18:36:30 +00:00
|
|
|
// You should have received a copy of the GNU Lesser General Public License
|
|
|
|
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
|
2004-12-13 01:21:50 +00:00
|
|
|
|
2003-05-07 20:04:26 +00:00
|
|
|
#ifndef BOINC_GRAPHICS_API_H
|
|
|
|
#define BOINC_GRAPHICS_API_H
|
|
|
|
|
2007-01-04 11:28:41 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2004-12-13 01:21:50 +00:00
|
|
|
typedef void (*WORKER_FUNC_PTR)();
|
2004-12-04 00:56:22 +00:00
|
|
|
|
2004-12-13 01:21:50 +00:00
|
|
|
extern int boinc_init_graphics(WORKER_FUNC_PTR);
|
|
|
|
|
|
|
|
// Functions that must be supplied by the app
|
|
|
|
//
|
|
|
|
extern void app_graphics_render(int xs, int ys, double time_of_day);
|
|
|
|
extern void app_graphics_init(void);
|
|
|
|
// called each time a window is opened;
|
|
|
|
// called in the graphics thread
|
|
|
|
extern void app_graphics_reread_prefs(void);
|
|
|
|
// called when get REREAD_PREFS message from core client.
|
|
|
|
// called in the graphics thread
|
|
|
|
extern void app_graphics_resize(int width, int height);
|
2006-06-12 16:16:17 +00:00
|
|
|
extern void boinc_app_mouse_button(int x, int y, int which, int is_down);
|
2006-06-12 16:22:43 +00:00
|
|
|
extern void boinc_app_mouse_move(int x, int y, int left, int middle, int right);
|
2004-12-13 01:21:50 +00:00
|
|
|
extern void boinc_app_key_press(int, int);
|
|
|
|
extern void boinc_app_key_release(int, int);
|
2007-08-06 23:06:16 +00:00
|
|
|
extern void boinc_suspend_graphics_thread();
|
|
|
|
extern void boinc_resume_graphics_thread();
|
2004-12-04 00:56:22 +00:00
|
|
|
|
2004-12-13 01:21:50 +00:00
|
|
|
// C++ API follows here
|
2007-01-04 11:28:41 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
} // end extern "C"
|
2004-12-13 01:21:50 +00:00
|
|
|
|
2004-12-04 00:56:22 +00:00
|
|
|
#include "boinc_api.h"
|
|
|
|
|
2004-12-13 01:21:50 +00:00
|
|
|
extern int boinc_init_options_graphics(BOINC_OPTIONS&, WORKER_FUNC_PTR);
|
2007-01-04 11:28:41 +00:00
|
|
|
extern bool boinc_graphics_possible();
|
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;
|
2004-12-13 01:21:50 +00:00
|
|
|
#endif // WIN32
|
2003-10-02 18:51:38 +00:00
|
|
|
|
2004-12-04 00:56:22 +00:00
|
|
|
|
2004-12-13 01:21:50 +00:00
|
|
|
#endif // C++ API
|
2004-12-04 00:56:22 +00:00
|
|
|
|
2004-12-13 01:21:50 +00:00
|
|
|
#endif // double-inclusion protection
|