145 static bool CanClipViewport(
const ViewPort &vp);
146 static ViewPort ClippedViewport(
const ViewPort &vp,
const LLRegion ®ion);
148 static bool HasNormalizedViewPort(
const ViewPort &vp);
149 static void MultMatrixViewPort(
ViewPort &vp,
float lat = 0,
float lon = 0);
153 static void DrawRegion(
ViewPort &vp,
const LLRegion ®ion);
154 static void SetClipRegion(
ViewPort &vp,
const LLRegion ®ion);
155 static void SetClipRect(
const ViewPort &vp,
const wxRect &rect,
156 bool g_clear =
false);
157 static void DisableClipRegion();
158 void SetColorScheme(ColorScheme cs);
159 void RenderTextures(
ocpnDC &dc,
float *coords,
float *uvCoords,
int nVertex,
161 static void RenderSingleTexture(
ocpnDC &dc,
float *coords,
float *uvCoords,
164 void RenderColorRect(wxRect r, wxColor &color);
166 static bool s_b_useScissorTest;
167 static bool s_b_useStencil;
168 static bool s_b_useStencilAP;
169 static bool s_b_useFBO;
170 static std::unordered_map<wxPenStyle, std::array<wxDash, 2>> dash_map;
172 void SendJSONConfigMessage();
179 void SetContext(wxGLContext *pcontext) { m_pcontext = pcontext; }
180 int GetCanvasIndex() {
return m_pParentCanvas->m_canvasIndex; }
182 int GetGLCanvasWidth() {
return m_glcanvas_width; }
183 int GetGLCanvasHeight() {
return m_glcanvas_height; }
185 void OnPaint(wxPaintEvent &event);
186 void OnEraseBG(wxEraseEvent &evt);
188 void OnActivate(wxActivateEvent &event);
189 void OnSize(wxSizeEvent &event);
190 void MouseEvent(wxMouseEvent &event);
191 void FastPan(
int dx,
int dy);
192 void FastZoom(
float factor,
float cp_x,
float cp_y,
float post_x,
198#ifdef __OCPN__ANDROID__
199 void OnEvtPanGesture(wxQT_PanGestureEvent &event);
200 void OnEvtPinchGesture(wxQT_PinchGestureEvent &event);
201 void onGestureTimerEvent(wxTimerEvent &event);
202 void onGestureFinishTimerEvent(wxTimerEvent &event);
204#ifdef HAVE_WX_GESTURE_EVENTS
205 void OnEvtPanGesture(wxPanGestureEvent &event);
206 void OnEvtZoomGesture(wxZoomGestureEvent &event);
207 void onGestureTimerEvent(wxTimerEvent &event);
208 void onGestureFinishTimerEvent(wxTimerEvent &event);
212 void onZoomTimerEvent(wxTimerEvent &event);
214 wxString GetRendererString() {
return m_renderer; }
215 wxString GetVersionString() {
return m_version; }
216 wxString GetGLSLVersionString() {
return m_GLSLversion; }
217 void EnablePaint(
bool b_enable) { m_b_paint_enable = b_enable; }
223 void DrawGLOverLayObjects(
void);
227 void DrawDynamicRoutesTracksAndWaypoints(
ViewPort &vp);
228 void DrawStaticRoutesTracksAndWaypoints(
ViewPort &vp);
234 void ShipDraw(
ocpnDC &dc);
236 void SetupCompression();
237 bool CanAcceleratePanning() {
return m_b_BuiltFBO; }
238 bool UsingFBO() {
return m_b_BuiltFBO; }
240 bool isInGesture() {
return m_binGesture; }
241 void ResetGridFont() { m_gridfont.Delete(); }
242 time_t m_last_render_time;
245 double mvmatrix[16], projmatrix[16];
252 void RenderS57TextOverlay(
ViewPort &VPoint);
253 void RenderMBTilesOverlay(
ViewPort &VPoint);
254 void RenderSingleMBTileOverlay(
int dbIndex,
bool bOVerlay,
ViewPort &VPoint,
256 LLRegion &screenLLRegion);
257 void RenderScene(
bool bRenderCharts =
true,
bool bRenderOverlays =
true);
259 void RenderGLAlertMessage();
265 bool buildFBOSize(
int fboSize);
267 void configureShaders(
ViewPort &vp);
271 void RenderNoDTA(
ViewPort &vp,
const LLRegion ®ion,
272 int transparency = 255);
277 void DrawFloatingOverlayObjects(
ocpnDC &dc);
280 void DrawChartBar(
ocpnDC &dc);
282 void DrawCloseMessage(wxString msg);
284 void DrawGLTidesInBBox(
ocpnDC &dc, LLBBox &BBox);
285 void DrawGLCurrentsInBBox(
ocpnDC &dc, LLBBox &BBox);
287 void ZoomProject(
float offset_x,
float offset_y,
float swidth,
float sheight);
288 wxBitmap &GetTouchBackingBitmap(
ViewPort &vp);
289 void CreateBackingTexture();
291 void RendertoTexture(GLint tex);
293 wxGLContext *m_pcontext;
295 int max_texture_dimension;
300 wxString m_version, m_GLSLversion;
301 wxString m_extensions;
306 bool m_b_paint_enable;
312 bool m_b_useFBOStencil;
314 GLuint m_renderbuffer;
316 GLuint m_cache_tex[2];
323 wxSize ownship_size, ownship_tex_size;
332 float m_lastfbo_offsetx;
333 float m_lastfbo_offsety;
334 float m_lastfbo_swidth;
335 float m_lastfbo_sheight;
337 float m_offsetxStep, m_offsetyStep, m_swidthStep, m_sheightStep;
338 float m_runoffsetx, m_runoffsety, m_runswidth, m_runsheight;
339 float m_nStep, m_nTotal, m_nRun;
341 double m_zoomFinalZoom;
342 int m_zoomFinaldx, m_zoomFinaldy;
347 double m_fbo_lat, m_fbo_lon;
349 wxPoint m_lpinchPoint;
355 wxTimer m_gestureEeventTimer;
356 wxTimer m_gestureFinishTimer;
357 bool m_bgestureGuard;
359 wxPoint m_pinchStart;
360 double m_pinchlat, m_pinchlon;
371 int m_currentTexWidth;
372 int m_currentTexHeight;
375 int m_glcanvas_width;
376 int m_glcanvas_height;
378 float m_total_zoom_val;
379 float m_final_zoom_val;
383 wxBitmap m_touch_backing_bitmap;
384 unsigned int m_TouchBackingTexture;
385 int m_tex_w, m_tex_h, m_image_width, m_image_height;
389 DECLARE_EVENT_TABLE()