OpenCPN Partial API docs
Loading...
Searching...
No Matches
dychart.h
1/******************************************************************************
2 *
3 * Project: OpenCPN
4 * Purpose: Global Build Options
5 * Author: David Register
6 *
7 ***************************************************************************
8 * Copyright (C) 2010 by David S. Register *
9 * *
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
14 * *
15 * This program is distributed in the hope that it will be useful, *
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
18 * GNU General Public License for more details. *
19 * *
20 * You should have received a copy of the GNU General Public License *
21 * along with this program; if not, write to the *
22 * Free Software Foundation, Inc., *
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
24 ***************************************************************************
25 *
26 */
27
28//----------------------------------------------------------------------------------
29// Global Build options for opencpn
30//----------------------------------------------------------------------------------
31#ifndef _DYCHART_H_
32#define _DYCHART_H_
33
34#include "config.h"
35
36#include <cmath>
37#include <algorithm>
38
39// Profiling support
40
41// #include "/usr/include/valgrind/callgrind.h"
42
43// Chart cacheing policy defaults
44
45#define CACHE_N_LIMIT_DEFAULT 20 // Cache no more than n charts
46
47#define CACHE_MEM_LIMIT_DEFAULT 0 // Application memory useage target, kBytes
48
49// If defined, update the system time using GPS receiver data.
50// Time update is applied if the system time and GPS time differ
51// by more than one minute, and only once per session.
52// On Linux, this option requires root privileges, obtained by sudo.
53// Thus, the following line is required in etc/sudoers:
54//
55// nav ALL=NOPASSWD:/bin/date -s *
56//
57// Where "nav" is the user's user name.
58//
59// Also, the opencpn configuration file must contain the key
60// [Settings]
61// SetSystemTime=1
62// For security, this option is not available on the "Options" dialog
63#define ocpnUPDATE_SYSTEM_TIME
64
65//------------------------------------------------------------------------------
66// Some private, app global type definitions
67//------------------------------------------------------------------------------
68
69//------------------------------------------------------------------------------
70// Various compile time options
71//------------------------------------------------------------------------------
72
73#ifdef __MSVC__
74#pragma warning(disable : 4114)
75#pragma warning( \
76 disable : 4284) // This one is to do with "reverse iterator UDT..." Huh?
77#endif
78
79// Following definition required by GDAL
80#define notdef 1
81
82#ifdef __MSVC__
83// __MSVC__ randomly does not link snprintf, or _snprintf
84// Replace it with a local version, code is in cutil.c
85#undef snprintf
86#define snprintf mysnprintf
87#endif
88
89//------------------------------------------------------------------------------
90// Some Build constants
91//------------------------------------------------------------------------------
92
93// Home Base, used if the config file lat/lon seems bogus or missing
94
95// #define START_LAT 35.1025 // New Bern (Ver 1.0)
96// #define START_LON -77.0342
97
98// #define START_LAT 26.783 // Green Turtle Key (Ver 1.2)
99// #define START_LON -77.333
100
101// #define START_LAT 25.786 // Miami Beach (Ver 1.2.2)
102// #define START_LON -80.148
103
104#define START_LAT 33.358 // Georgetown, SC (Ver 1.2.4)
105#define START_LON -79.282
106
107//------------------------------------------------------------------------------
108// Some MSW and MSVCRT Specific Includes
109//------------------------------------------------------------------------------
110#ifdef __WXMSW__
111#include "wx/msw/private.h"
112#endif
113
114//------------------------------------------------------------------------------
115// Some Memory Leak Detection Code
116//------------------------------------------------------------------------------
117
118#ifdef __VISUALC__
119#include <wx/msw/msvcrt.h>
120#endif
121
122//----------------------------------------------------------------------------
123// Environment Access functions
124//----------------------------------------------------------------------------
125#ifdef __MSVC__
126#define _putenv _putenv // This is for MSVC
127#else
128#define _putenv putenv // This is for other Windows compiler
129#endif
130
131//----------------------------------------------------------------------------
132// Use the CPL Portability library only if S57 is enabled
133//----------------------------------------------------------------------------
134
135#define USE_CPL
136// #include "gdal/cpl_port.h"
137
138#ifndef NULL
139#define NULL 0
140#endif
141
142/***********************************************************************
143 * Define __POSIX__ to imply posix thread model compatibility
144 * Especially used for communication port multithreading.
145 *
146 * Posix thread model is available on selected platforms, see code.
147 */
148
149#ifdef __POSIX__
150#undef __POSIX__
151#endif
152
153#ifdef __WXOSX__
154#define __POSIX__
155#endif
156
157#ifdef __WXGTK__
158#define __POSIX__
159#endif
160
161#if defined(__OCPN__ANDROID__)
162#include <qopengl.h>
163#include <GL/gl_private.h> // this is a cut-down version of gl.h
164#include <GLES2/gl2.h>
165#else
166#ifdef ocpnUSE_GL
167#if defined(__MSVC__)
168#include "glew.h"
169#elif defined(__WXOSX__)
170#include <OpenGL/gl.h>
171#include <OpenGL/glu.h>
172typedef void (*_GLUfuncptr)();
173#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0
174#elif defined(__WXQT__) || defined(__WXGTK__)
175#include <GL/glew.h>
176#include <GL/glu.h>
177#endif
178#endif
179#endif
180
181/*
182#if defined(_WIN32) || defined(_WIN64)
183# include <gl/glew.h>
184# include <GL/gl.h>
185# include <GL/glu.h>
186#elif __APPLE__
187# include "TargetConditionals.h"
188# if (TARGET_OS_IPHONE && TARGET_IPHONE_SIMULATOR) || TARGET_OS_IPHONE
189# include <OpenGLES/ES2/gl.h>
190# include <OpenGLES/ES2/glext.h>
191# else
192# include <OpenGL/gl.h>
193# include <OpenGL/glu.h>
194# include <OpenGL/glext.h>
195# endif
196#elif defined(__ANDROID__) || defined(ANDROID)
197# include <GLES2/gl2.h>
198# include <GLES2/gl2ext.h>
199#elif defined(__linux__) || defined(__unix__) || defined(__posix__)
200# include <GL/gl.h>
201# include <GL/glu.h>
202# include <GL/glext.h>
203#else
204# error platform not supported.
205#endif
206*/
207
208#ifdef __OCPN__ANDROID__
209#include "qdebug.h"
210#endif
211
212#endif // __FILE__