-
Notifications
You must be signed in to change notification settings - Fork 26
/
globals.h
88 lines (74 loc) · 2.14 KB
/
globals.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/*
* launcher-mobile: a multiplatform flexVDI/SPICE client
*
* Copyright (C) 2016 flexVDI (Flexible Software Solutions S.L.)
*
* This file is part of launcher-mobile.
*
* launcher-mobile is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* launcher-mobile 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with launcher-mobile. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _GLOBALS_H
#define _GLOBALS_H
#if defined(LINUX)
#include <GL/gl.h>
#elif defined(ANDROID)
#include <android/log.h>
#include <GLES/gl.h>
#else
#include <OpenGLES/ES1/gl.h>
#endif
#include <stdio.h>
#include "spice.h"
typedef struct _global_state_t {
char *save_path;
int conn_state;
int main_loop_running;
int display_state;
spice_conn_data_t *conn_data;
int enable_audio;
int width;
int height;
int guest_width;
int guest_height;
int content_scale;
int change_resolution;
int input_initialized;
int first_frame;
double mouse_fix[2];
double zoom;
double zoom_offset_x;
double zoom_offset_y;
GLuint main_texture[1];
int main_texture_created;
GLuint keyboard_texture[1];
char *spice_display_buffer;
int button_mask;
int keyboard_visible;
float keyboard_opacity;
float keyboard_offset;
float main_opacity;
float main_offset;
} global_state_t;
global_state_t global_state;
#define DISPLAY_INVALIDATE 0x1
#define DISPLAY_CHANGE_RESOLUTION 0x2
#define DISCONNECTED 0x0
#define CONNECTED 0x1
#define AUTOCONNECT 0x2
#ifdef ANDROIDX
#define GLUE_DEBUG(fmt, ...) __android_log_print(ANDROID_LOG_ERROR, "flexdp-engine", fmt, ## __VA_ARGS__);
#else
#define GLUE_DEBUG(fmt, ...) printf(fmt, ## __VA_ARGS__);
#endif
#endif