96 static bool CanClipViewport(
const ViewPort &vp);
99 static bool HasNormalizedViewPort(
const ViewPort &vp);
100 static void MultMatrixViewPort(
ViewPort &vp,
float lat = 0,
float lon = 0);
104 static void DrawRegion(
ViewPort &vp,
const LLRegion ®ion);
105 static void SetClipRegion(
ViewPort &vp,
const LLRegion ®ion);
106 static void SetClipRect(
const ViewPort &vp,
const wxRect &rect,
107 bool g_clear =
false);
108 static void DisableClipRegion();
109 void SetColorScheme(ColorScheme cs);
110 void RenderTextures(
ocpnDC &dc,
float *coords,
float *uvCoords,
int nVertex,
112 static void RenderSingleTexture(
ocpnDC &dc,
float *coords,
float *uvCoords,
115 void RenderColorRect(wxRect r, wxColor &color);
117 static bool s_b_useScissorTest;
118 static bool s_b_useStencil;
119 static bool s_b_useStencilAP;
120 static bool s_b_useFBO;
121 static std::unordered_map<wxPenStyle, std::array<wxDash, 2>> dash_map;
123 void SendJSONConfigMessage();
130 void SetContext(wxGLContext *pcontext) { m_pcontext = pcontext; }
131 int GetCanvasIndex() {
return m_pParentCanvas->m_canvasIndex; }
133 int GetGLCanvasWidth() {
return m_glcanvas_width; }
134 int GetGLCanvasHeight() {
return m_glcanvas_height; }
136 void OnPaint(wxPaintEvent &event);
137 void OnEraseBG(wxEraseEvent &evt);
139 void OnActivate(wxActivateEvent &event);
140 void OnSize(wxSizeEvent &event);
141 void MouseEvent(wxMouseEvent &event);
142 void FastPan(
int dx,
int dy);
143 void FastZoom(
float factor,
float cp_x,
float cp_y,
float post_x,
149#ifdef __OCPN__ANDROID__
150 void OnEvtPanGesture(wxQT_PanGestureEvent &event);
151 void OnEvtPinchGesture(wxQT_PinchGestureEvent &event);
152 void onGestureTimerEvent(wxTimerEvent &event);
153 void onGestureFinishTimerEvent(wxTimerEvent &event);
155#ifdef HAVE_WX_GESTURE_EVENTS
156 void OnEvtPanGesture(wxPanGestureEvent &event);
157 void OnEvtZoomGesture(wxZoomGestureEvent &event);
158 void onGestureTimerEvent(wxTimerEvent &event);
159 void onGestureFinishTimerEvent(wxTimerEvent &event);
163 void onZoomTimerEvent(wxTimerEvent &event);
165 wxString GetRendererString() {
return m_renderer; }
166 wxString GetVersionString() {
return m_version; }
167 wxString GetGLSLVersionString() {
return m_GLSLversion; }
168 void EnablePaint(
bool b_enable) { m_b_paint_enable = b_enable; }
174 void DrawGLOverLayObjects(
void);
178 void DrawDynamicRoutesTracksAndWaypoints(
ViewPort &vp);
179 void DrawStaticRoutesTracksAndWaypoints(
ViewPort &vp);
185 void ShipDraw(
ocpnDC &dc);
187 void SetupCompression();
188 bool CanAcceleratePanning() {
return m_b_BuiltFBO; }
189 bool UsingFBO() {
return m_b_BuiltFBO; }
191 bool isInGesture() {
return m_binGesture; }
192 void ResetGridFont() { m_gridfont.Delete(); }
193 time_t m_last_render_time;
196 double mvmatrix[16], projmatrix[16];
203 void RenderS57TextOverlay(
ViewPort &VPoint);
204 void RenderMBTilesOverlay(
ViewPort &VPoint);
205 void RenderSingleMBTileOverlay(
int dbIndex,
bool bOVerlay,
ViewPort &VPoint,
207 LLRegion &screenLLRegion);
208 void RenderScene(
bool bRenderCharts =
true,
bool bRenderOverlays =
true);
210 void RenderGLAlertMessage();
216 bool buildFBOSize(
int fboSize);
218 void configureShaders(
ViewPort &vp);
222 void RenderNoDTA(
ViewPort &vp,
const LLRegion ®ion,
223 int transparency = 255);
228 void DrawFloatingOverlayObjects(
ocpnDC &dc);
231 void DrawChartBar(
ocpnDC &dc);
233 void DrawCloseMessage(wxString msg);
235 void DrawGLTidesInBBox(
ocpnDC &dc, LLBBox &BBox);
236 void DrawGLCurrentsInBBox(
ocpnDC &dc, LLBBox &BBox);
238 void ZoomProject(
float offset_x,
float offset_y,
float swidth,
float sheight);
239 wxBitmap &GetTouchBackingBitmap(
ViewPort &vp);
240 void CreateBackingTexture();
242 void RendertoTexture(GLint tex);
244 wxGLContext *m_pcontext;
246 int max_texture_dimension;
251 wxString m_version, m_GLSLversion;
252 wxString m_extensions;
257 bool m_b_paint_enable;
263 bool m_b_useFBOStencil;
265 GLuint m_renderbuffer;
267 GLuint m_cache_tex[2];
274 wxSize ownship_size, ownship_tex_size;
283 float m_lastfbo_offsetx;
284 float m_lastfbo_offsety;
285 float m_lastfbo_swidth;
286 float m_lastfbo_sheight;
288 float m_offsetxStep, m_offsetyStep, m_swidthStep, m_sheightStep;
289 float m_runoffsetx, m_runoffsety, m_runswidth, m_runsheight;
290 float m_nStep, m_nTotal, m_nRun;
292 double m_zoomFinalZoom;
293 int m_zoomFinaldx, m_zoomFinaldy;
298 double m_fbo_lat, m_fbo_lon;
300 wxPoint m_lpinchPoint;
306 wxTimer m_gestureEeventTimer;
307 wxTimer m_gestureFinishTimer;
308 bool m_bgestureGuard;
310 wxPoint m_pinchStart;
311 double m_pinchlat, m_pinchlon;
322 int m_currentTexWidth;
323 int m_currentTexHeight;
326 int m_glcanvas_width;
327 int m_glcanvas_height;
329 float m_total_zoom_val;
330 float m_final_zoom_val;
334 wxBitmap m_touch_backing_bitmap;
335 unsigned int m_TouchBackingTexture;
336 int m_tex_w, m_tex_h, m_image_width, m_image_height;
340 DECLARE_EVENT_TABLE()