2005-01-20 23:22:22 +00:00
|
|
|
// Berkeley Open Infrastructure for Network Computing
|
|
|
|
// http://boinc.berkeley.edu
|
|
|
|
// Copyright (C) 2005 University of California
|
2004-12-13 01:21:50 +00:00
|
|
|
//
|
2005-01-20 23:22:22 +00:00
|
|
|
// This 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 2.1 of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This software is distributed in the hope that it will be useful,
|
|
|
|
// 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.
|
|
|
|
//
|
|
|
|
// To view the GNU Lesser General Public License visit
|
|
|
|
// http://www.gnu.org/copyleft/lesser.html
|
|
|
|
// or write to the Free Software Foundation, Inc.,
|
|
|
|
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
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
|
|
|
|
|
2004-12-04 00:56:22 +00:00
|
|
|
#ifdef __cplusplus
|
2004-10-26 21:12:00 +00:00
|
|
|
extern "C" {
|
2004-12-04 00:56:22 +00:00
|
|
|
#endif
|
2004-10-26 21:12:00 +00:00
|
|
|
|
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);
|
2004-12-04 00:56:22 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
2004-12-13 01:21:50 +00:00
|
|
|
} // extern "C"
|
2004-12-04 00:56:22 +00:00
|
|
|
#endif
|
|
|
|
|
2004-12-13 01:21:50 +00:00
|
|
|
// C++ API follows here
|
|
|
|
|
2004-12-04 00:56:22 +00:00
|
|
|
#if defined __cplusplus
|
|
|
|
#include "boinc_api.h"
|
|
|
|
|
2004-12-13 01:21:50 +00:00
|
|
|
extern int boinc_init_options_graphics(BOINC_OPTIONS&, WORKER_FUNC_PTR);
|
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
|