107 static bool CanClipViewport(
const ViewPort &vp);
108 static ViewPort ClippedViewport(
const ViewPort &vp,
const LLRegion ®ion);
110 static bool HasNormalizedViewPort(
const ViewPort &vp);
111 static void MultMatrixViewPort(
ViewPort &vp,
float lat = 0,
float lon = 0);
115 static void DrawRegion(
ViewPort &vp,
const LLRegion ®ion);
116 static void SetClipRegion(
ViewPort &vp,
const LLRegion ®ion);
117 static void SetClipRect(
const ViewPort &vp,
const wxRect &rect,
118 bool g_clear =
false);
119 static void DisableClipRegion();
120 void SetColorScheme(ColorScheme cs);
121 void RenderTextures(
ocpnDC &dc,
float *coords,
float *uvCoords,
int nVertex,
123 static void RenderSingleTexture(
ocpnDC &dc,
float *coords,
float *uvCoords,
126 void RenderColorRect(wxRect r, wxColor &color);
128 static bool s_b_useScissorTest;
129 static bool s_b_useStencil;
130 static bool s_b_useStencilAP;
131 static bool s_b_useFBO;
132 static std::unordered_map<wxPenStyle, std::array<wxDash, 2>> dash_map;
134 void SendJSONConfigMessage();
141 void SetContext(wxGLContext *pcontext) { m_pcontext = pcontext; }
142 int GetCanvasIndex() {
return m_pParentCanvas->m_canvasIndex; }
144 int GetGLCanvasWidth() {
return m_glcanvas_width; }
145 int GetGLCanvasHeight() {
return m_glcanvas_height; }
147 void OnPaint(wxPaintEvent &event);
148 void OnEraseBG(wxEraseEvent &evt);
150 void OnActivate(wxActivateEvent &event);
151 void OnSize(wxSizeEvent &event);
152 void MouseEvent(wxMouseEvent &event);
153 void FastPan(
int dx,
int dy);
154 void FastZoom(
float factor,
float cp_x,
float cp_y,
float post_x,
160#ifdef __OCPN__ANDROID__
161 void OnEvtPanGesture(wxQT_PanGestureEvent &event);
162 void OnEvtPinchGesture(wxQT_PinchGestureEvent &event);
163 void onGestureTimerEvent(wxTimerEvent &event);
164 void onGestureFinishTimerEvent(wxTimerEvent &event);
166#ifdef HAVE_WX_GESTURE_EVENTS
167 void OnEvtPanGesture(wxPanGestureEvent &event);
168 void OnEvtZoomGesture(wxZoomGestureEvent &event);
169 void onGestureTimerEvent(wxTimerEvent &event);
170 void onGestureFinishTimerEvent(wxTimerEvent &event);
174 void onZoomTimerEvent(wxTimerEvent &event);
176 wxString GetRendererString() {
return m_renderer; }
177 wxString GetVersionString() {
return m_version; }
178 wxString GetGLSLVersionString() {
return m_GLSLversion; }
179 void EnablePaint(
bool b_enable) { m_b_paint_enable = b_enable; }
185 void DrawGLOverLayObjects(
void);
189 void DrawDynamicRoutesTracksAndWaypoints(
ViewPort &vp);
190 void DrawStaticRoutesTracksAndWaypoints(
ViewPort &vp);
196 void ShipDraw(
ocpnDC &dc);
198 void SetupCompression();
199 bool CanAcceleratePanning() {
return m_b_BuiltFBO; }
200 bool UsingFBO() {
return m_b_BuiltFBO; }
202 bool isInGesture() {
return m_binGesture; }
203 void ResetGridFont() { m_gridfont.Delete(); }
204 time_t m_last_render_time;
207 double mvmatrix[16], projmatrix[16];
214 void RenderS57TextOverlay(
ViewPort &VPoint);
215 void RenderMBTilesOverlay(
ViewPort &VPoint);
216 void RenderSingleMBTileOverlay(
int dbIndex,
bool bOVerlay,
ViewPort &VPoint,
218 LLRegion &screenLLRegion);
219 void RenderScene(
bool bRenderCharts =
true,
bool bRenderOverlays =
true);
221 void RenderGLAlertMessage();
227 bool buildFBOSize(
int fboSize);
229 void configureShaders(
ViewPort &vp);
233 void RenderNoDTA(
ViewPort &vp,
const LLRegion ®ion,
234 int transparency = 255);
239 void DrawFloatingOverlayObjects(
ocpnDC &dc);
242 void DrawChartBar(
ocpnDC &dc);
244 void DrawCloseMessage(wxString msg);
246 void DrawGLTidesInBBox(
ocpnDC &dc, LLBBox &BBox);
247 void DrawGLCurrentsInBBox(
ocpnDC &dc, LLBBox &BBox);
249 void ZoomProject(
float offset_x,
float offset_y,
float swidth,
float sheight);
250 wxBitmap &GetTouchBackingBitmap(
ViewPort &vp);
251 void CreateBackingTexture();
253 void RendertoTexture(GLint tex);
255 wxGLContext *m_pcontext;
257 int max_texture_dimension;
262 wxString m_version, m_GLSLversion;
263 wxString m_extensions;
268 bool m_b_paint_enable;
274 bool m_b_useFBOStencil;
276 GLuint m_renderbuffer;
278 GLuint m_cache_tex[2];
285 wxSize ownship_size, ownship_tex_size;
294 float m_lastfbo_offsetx;
295 float m_lastfbo_offsety;
296 float m_lastfbo_swidth;
297 float m_lastfbo_sheight;
299 float m_offsetxStep, m_offsetyStep, m_swidthStep, m_sheightStep;
300 float m_runoffsetx, m_runoffsety, m_runswidth, m_runsheight;
301 float m_nStep, m_nTotal, m_nRun;
303 double m_zoomFinalZoom;
304 int m_zoomFinaldx, m_zoomFinaldy;
309 double m_fbo_lat, m_fbo_lon;
311 wxPoint m_lpinchPoint;
317 wxTimer m_gestureEeventTimer;
318 wxTimer m_gestureFinishTimer;
319 bool m_bgestureGuard;
321 wxPoint m_pinchStart;
322 double m_pinchlat, m_pinchlon;
333 int m_currentTexWidth;
334 int m_currentTexHeight;
337 int m_glcanvas_width;
338 int m_glcanvas_height;
340 float m_total_zoom_val;
341 float m_final_zoom_val;
345 wxBitmap m_touch_backing_bitmap;
346 unsigned int m_TouchBackingTexture;
347 int m_tex_w, m_tex_h, m_image_width, m_image_height;
351 DECLARE_EVENT_TABLE()
OpenGL texture management.