From d5ab786b4ae6077cff2ffc043025849cdf767446 Mon Sep 17 00:00:00 2001 From: Mark Watkins Date: Sun, 12 Jun 2011 17:12:44 +1000 Subject: [PATCH] Vertical Fonts, Shared Contexts, and temporary killed rounded dots due to GL_POINT_SMOOTH slowdown --- Projects/CodeBlocks/SleepyHead.depend | 20 +++--- src/GUIFrame.cpp | 12 ---- src/GUIFrame.h | 6 +- src/SleepyHeadMain.cpp | 75 +++++++++++++-------- src/SleepyHeadMain.h | 5 ++ src/WxWizFrame.fbp | 94 --------------------------- src/graphs/graph.cpp | 85 ++++++++++++++---------- src/graphs/graph.h | 5 +- src/version.h | 12 ++-- 9 files changed, 124 insertions(+), 190 deletions(-) diff --git a/Projects/CodeBlocks/SleepyHead.depend b/Projects/CodeBlocks/SleepyHead.depend index aa6a2b95..5a489a52 100644 --- a/Projects/CodeBlocks/SleepyHead.depend +++ b/Projects/CodeBlocks/SleepyHead.depend @@ -8210,12 +8210,12 @@ "wx/treebase.h" "wx/hashmap.h" -1307708368 source:/home/mark/projects/git/sleepyhead/src/GUIFrame.cpp +1307861037 source:/home/mark/projects/git/sleepyhead/src/GUIFrame.cpp "wx/wxprec.h" "GUIFrame.h" -1307708368 /home/mark/projects/git/sleepyhead/src/GUIFrame.h +1307861037 /home/mark/projects/git/sleepyhead/src/GUIFrame.h @@ -8231,10 +8231,10 @@ - - + + @@ -8258,7 +8258,7 @@ 1307418393 /home/mark/projects/git/sleepyhead/src/SleepyHeadApp.h -1307772405 /home/mark/projects/git/sleepyhead/src/SleepyHeadMain.h +1307862247 /home/mark/projects/git/sleepyhead/src/SleepyHeadMain.h "SleepyHeadApp.h" @@ -8300,13 +8300,14 @@ "tinyxml/tinyxml.h" -1307789091 /home/mark/projects/git/sleepyhead/src/graphs/graph.h +1307862530 /home/mark/projects/git/sleepyhead/src/graphs/graph.h + -1307858279 /home/mark/projects/git/sleepyhead/src/version.h +1307862688 /home/mark/projects/git/sleepyhead/src/version.h 1307627540 /home/mark/projects/git/sleepyhead/src/libs/sleeplib/prs1_loader.h "machine.h" @@ -8324,7 +8325,7 @@ "preferences.h" "tinyxml/tinyxml.h" -1307855899 source:/home/mark/projects/git/sleepyhead/src/SleepyHeadMain.cpp +1307862323 source:/home/mark/projects/git/sleepyhead/src/SleepyHeadMain.cpp "wx_pch.h" "version.h" @@ -8344,13 +8345,12 @@ "sleeplib/profiles.h" "sleeplib/machine_loader.h" -1307857375 source:/home/mark/projects/git/sleepyhead/src/graphs/graph.cpp +1307862554 source:/home/mark/projects/git/sleepyhead/src/graphs/graph.cpp - diff --git a/src/GUIFrame.cpp b/src/GUIFrame.cpp index c2e40c86..e68664f8 100644 --- a/src/GUIFrame.cpp +++ b/src/GUIFrame.cpp @@ -147,18 +147,6 @@ DailyPanel::DailyPanel( wxWindow* parent, wxWindowID id, const wxPoint& pos, con Calendar = new wxCalendarCtrl( this, wxID_ANY, wxDefaultDateTime, wxDefaultPosition, wxDefaultSize, wxCAL_MONDAY_FIRST|wxCAL_SEQUENTIAL_MONTH_SELECTION|wxCAL_SHOW_SURROUNDING_WEEKS ); m_mgr.AddPane( Calendar, wxAuiPaneInfo() .Left() .Caption( wxT("Selected Day") ).PaneBorder( false ).Dock().Fixed().BottomDockable( false ).TopDockable( false ) ); - ScrolledWindow = new wxScrolledWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL ); - ScrolledWindow->SetScrollRate( 5, 5 ); - m_mgr.AddPane( ScrolledWindow, wxAuiPaneInfo() .Center() .Caption( wxT("Daily Information") ).CloseButton( false ).MaximizeButton( false ).MinimizeButton( false ).PinButton( true ).Dock().Resizable().FloatingSize( wxSize( -1,-1 ) ).Row( 0 ).Layer( 1 ).CentrePane() ); - - fgSizer = new wxFlexGridSizer( 0, 1, 0, 0 ); - fgSizer->AddGrowableCol( 0 ); - fgSizer->SetFlexibleDirection( wxVERTICAL ); - fgSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_ALL ); - - ScrolledWindow->SetSizer( fgSizer ); - ScrolledWindow->Layout(); - fgSizer->Fit( ScrolledWindow ); Notebook = new wxAuiNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_NB_TAB_MOVE|wxAUI_NB_TAB_SPLIT ); m_mgr.AddPane( Notebook, wxAuiPaneInfo() .Left() .Caption( wxT("Summary") ).PaneBorder( false ).Dock().Resizable().FloatingSize( wxSize( 280,480 ) ).DockFixed( false ).Position( 1 ).BestSize( wxSize( 280,480 ) ) ); diff --git a/src/GUIFrame.h b/src/GUIFrame.h index 074104c5..01a637bb 100644 --- a/src/GUIFrame.h +++ b/src/GUIFrame.h @@ -24,10 +24,10 @@ #include #include #include -#include -#include #include #include +#include +#include #include #include #include @@ -91,8 +91,6 @@ class DailyPanel : public wxPanel protected: wxCalendarCtrl* Calendar; - wxScrolledWindow* ScrolledWindow; - wxFlexGridSizer* fgSizer; wxAuiNotebook* Notebook; // Virtual event handlers, overide them in your derived class diff --git a/src/SleepyHeadMain.cpp b/src/SleepyHeadMain.cpp index e3f38a4b..53578141 100644 --- a/src/SleepyHeadMain.cpp +++ b/src/SleepyHeadMain.cpp @@ -596,6 +596,21 @@ void Summary::OnClose(wxCloseEvent &event) Daily::Daily(wxWindow *win,Profile *p) :DailyPanel(win),profile(p) { + GraphWindow = new wxScrolledWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL ); + GraphWindow->SetScrollRate( 5, 5 ); + + m_mgr.AddPane( GraphWindow, wxAuiPaneInfo() .Center() .Caption( wxT("Graphs") ).CloseButton( false ).MaximizeButton( false ).MinimizeButton( false ).PinButton( true ).Dock().Resizable().FloatingSize( wxDefaultSize ).DockFixed( false ).MinSize( wxSize( 440,400 ) ) ); + m_mgr.Update(); + gwSizer = new wxFlexGridSizer( 0, 1, 0, 0 ); + gwSizer->AddGrowableCol( 0 ); + gwSizer->SetFlexibleDirection( wxVERTICAL ); + gwSizer->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_ALL ); + + GraphWindow->SetSizer( gwSizer ); + GraphWindow->Layout(); + gwSizer->Fit(GraphWindow); + + tiap_bmp=teap_bmp=tap_bmp=ahi_bmp=NULL; HTMLInfo=new wxHtmlWindow(this); HTMLInfo->SetBorders(4); @@ -608,20 +623,20 @@ Daily::Daily(wxWindow *win,Profile *p) AddCPAPData(tap_iap=new TAPData(CPAP_IAP)); AddCPAPData(tap=new TAPData(CPAP_Pressure)); - TAP=new gGraphWindow(ScrolledWindow,-1,wxT(""),wxPoint(0,0), wxSize(600,30), wxNO_BORDER); //Time@Pressure + TAP=new gGraphWindow(GraphWindow,-1,wxT(""),wxPoint(0,0), wxSize(600,30), wxNO_BORDER); //Time@Pressure //TAP->SetMargins(20,15,5,50); TAP->SetMargins(0,1,0,1); TAP->AddLayer(new gCandleStick(tap)); - TAP_EAP=new gGraphWindow(ScrolledWindow,-1,wxT(""),wxPoint(0,0), wxSize(600,30), wxNO_BORDER); //Time@EPAP + TAP_EAP=new gGraphWindow(GraphWindow,-1,wxT(""),wxPoint(0,0), wxSize(600,30), wxNO_BORDER); //Time@EPAP TAP_EAP->SetMargins(0,1,0,1); TAP_EAP->AddLayer(new gCandleStick(tap_eap)); - TAP_IAP=new gGraphWindow(ScrolledWindow,-1,wxT(""),wxPoint(0,0), wxSize(600,30), wxNO_BORDER); //Time@IPAP + TAP_IAP=new gGraphWindow(GraphWindow,-1,wxT(""),wxPoint(0,0), wxSize(600,30), wxNO_BORDER); //Time@IPAP TAP_IAP->SetMargins(0,1,0,1); TAP_IAP->AddLayer(new gCandleStick(tap_iap)); - G_AHI=new gGraphWindow(ScrolledWindow,-1,wxT(""),wxPoint(0,0), wxSize(600,30), wxNO_BORDER); //Event Breakdown") + G_AHI=new gGraphWindow(GraphWindow,-1,wxT(""),wxPoint(0,0), wxSize(600,30), wxNO_BORDER); //Event Breakdown") G_AHI->SetMargins(0,1,0,1); AddCPAPData(g_ahi=new AHIData()); gCandleStick *l=new gCandleStick(g_ahi); @@ -644,7 +659,7 @@ Daily::Daily(wxWindow *win,Profile *p) //pulse->ForceMinY(40); //pulse->ForceMaxY(120); - PULSE=new gGraphWindow(ScrolledWindow,-1,wxT("Pulse"),wxPoint(0,0), wxSize(600,130), wxNO_BORDER); + PULSE=new gGraphWindow(GraphWindow,-1,wxT("Pulse"),wxPoint(0,0), wxSize(600,130), wxNO_BORDER); PULSE->AddLayer(new gXAxis(wxBLACK)); PULSE->AddLayer(new gYAxis(wxBLACK)); PULSE->AddLayer(new gFooBar()); @@ -653,7 +668,7 @@ Daily::Daily(wxWindow *win,Profile *p) AddOXIData(spo2=new EventData(OXI_SPO2,0,65536,true)); //spo2->ForceMinY(60); //spo2->ForceMaxY(100); - SPO2=new gGraphWindow(ScrolledWindow,-1,wxT("SpO2"),wxPoint(0,0), wxSize(600,130), wxNO_BORDER); + SPO2=new gGraphWindow(GraphWindow,-1,wxT("SpO2"),wxPoint(0,0), wxSize(600,130), wxNO_BORDER); SPO2->AddLayer(new gXAxis(wxBLACK)); SPO2->AddLayer(new gYAxis(wxBLACK)); SPO2->AddLayer(new gFooBar()); @@ -661,31 +676,35 @@ Daily::Daily(wxWindow *win,Profile *p) SPO2->LinkZoom(PULSE); PULSE->LinkZoom(SPO2); + + + AddCPAPData(leakdata=new EventData(CPAP_Leak,0)); + //leakdata->ForceMinY(0); + //leakdata->ForceMaxY(120); + LEAK=new gGraphWindow(GraphWindow,-1,wxT("Leaks"),wxPoint(0,0), wxSize(600,130), wxNO_BORDER); + LEAK->AddLayer(new gXAxis(wxBLACK)); + LEAK->AddLayer(new gYAxis(wxBLACK)); + LEAK->AddLayer(new gFooBar()); + LEAK->AddLayer(new gLineChart(leakdata,wxPURPLE,4096,false,false,false)); + + AddCPAPData(snore=new EventData(CPAP_SnoreGraph,0)); //snore->ForceMinY(0); //snore->ForceMaxY(15); - SNORE=new gGraphWindow(ScrolledWindow,-1,wxT("Snore"),wxPoint(0,0), wxSize(600,130), wxNO_BORDER); + SNORE=new gGraphWindow(GraphWindow,-1,wxT("Snore"),wxPoint(0,0), wxSize(600,130), wxNO_BORDER); SNORE->AddLayer(new gXAxis(wxBLACK)); SNORE->AddLayer(new gYAxis(wxBLACK)); SNORE->AddLayer(new gFooBar()); SNORE->AddLayer(new gLineChart(snore,wxDARK_GREY,4096,false,false,true)); - AddCPAPData(leakdata=new EventData(CPAP_Leak,0)); - //leakdata->ForceMinY(0); - //leakdata->ForceMaxY(120); - LEAK=new gGraphWindow(ScrolledWindow,-1,wxT("Leaks"),wxPoint(0,0), wxSize(600,130), wxNO_BORDER); - LEAK->AddLayer(new gXAxis(wxBLACK)); - LEAK->AddLayer(new gYAxis(wxBLACK)); - LEAK->AddLayer(new gFooBar()); - LEAK->AddLayer(new gLineChart(leakdata,wxPURPLE,4096,false,false,false)); AddCPAPData(pressure_iap=new EventData(CPAP_IAP)); AddCPAPData(pressure_eap=new EventData(CPAP_EAP)); AddCPAPData(prd=new EventData(CPAP_Pressure)); - PRD=new gGraphWindow(ScrolledWindow,-1,wxT("Pressure"),wxPoint(0,0), wxSize(600,130), wxNO_BORDER); + PRD=new gGraphWindow(GraphWindow,-1,wxT("Pressure"),wxPoint(0,0), wxSize(600,130), wxNO_BORDER); PRD->AddLayer(new gXAxis(wxBLACK)); PRD->AddLayer(new gYAxis(wxBLACK)); PRD->AddLayer(new gFooBar()); @@ -694,7 +713,7 @@ Daily::Daily(wxWindow *win,Profile *p) PRD->AddLayer(new gLineChart(pressure_eap,wxRED,4096,false,true,true)); AddCPAPData(frw=new WaveData(CPAP_FlowRate)); - FRW=new gGraphWindow(ScrolledWindow,-1,wxT("Flow Rate"),wxPoint(0,0), wxSize(600,150), wxNO_BORDER); + FRW=new gGraphWindow(GraphWindow,-1,wxT("Flow Rate"),wxPoint(0,0), wxSize(600,150), wxNO_BORDER); AddCPAPData(flags[0]=new FlagData(CPAP_CSR,7,1,0)); AddCPAPData(flags[1]=new FlagData(CPAP_ClearAirway,6)); @@ -724,7 +743,7 @@ Daily::Daily(wxWindow *win,Profile *p) FRW->AddLayer(new gLineOverlayBar(flags[2],wxAQUA,wxT("OA"))); FRW->AddLayer(new gLineOverlayBar(flags[1],wxPURPLE,wxT("CA"))); - SF=new gGraphWindow(ScrolledWindow,-1,wxT("Event Flags"),wxPoint(0,0), wxSize(600,180), wxNO_BORDER); + SF=new gGraphWindow(GraphWindow,-1,wxT("Event Flags"),wxPoint(0,0), wxSize(600,180), wxNO_BORDER); // SF->SetMargins(10,15,20,80); // #if defined(__UNIX__) @@ -766,13 +785,15 @@ Daily::Daily(wxWindow *win,Profile *p) SF->AddLayer(new gXAxis(wxBLACK)); SF->AddLayer(new gFooBar()); - fgSizer->Add(SF,1,wxEXPAND); - fgSizer->Add(FRW,1,wxEXPAND); - fgSizer->Add(PRD,1,wxEXPAND); - fgSizer->Add(LEAK,1,wxEXPAND); - fgSizer->Add(SNORE,1,wxEXPAND); - fgSizer->Add(PULSE,1,wxEXPAND); - fgSizer->Add(SPO2,1,wxEXPAND); + gwSizer->Add(SF,1,wxEXPAND); + gwSizer->Add(FRW,1,wxEXPAND); + gwSizer->Add(PRD,1,wxEXPAND); + gwSizer->Add(LEAK,1,wxEXPAND); + gwSizer->Add(SNORE,1,wxEXPAND); + gwSizer->Add(PULSE,1,wxEXPAND); + gwSizer->Add(SPO2,1,wxEXPAND); + + gwSizer->Layout(); G_AHI->Hide(); TAP->Hide(); TAP_IAP->Hide(); @@ -1107,8 +1128,8 @@ void Daily::RefreshData() PULSE->Show(false); SPO2->Show(false); } - fgSizer->Layout(); - ScrolledWindow->FitInside(); + gwSizer->Layout(); + GraphWindow->FitInside(); if (cpap) { diff --git a/src/SleepyHeadMain.h b/src/SleepyHeadMain.h index c5985376..cd2fec52 100644 --- a/src/SleepyHeadMain.h +++ b/src/SleepyHeadMain.h @@ -85,6 +85,11 @@ protected: wxBitmap *ahi_bmp,*tap_bmp,*teap_bmp,*tiap_bmp; + // Add it's own wxGLCanvas in place of scrolledwindow + wxScrolledWindow *GraphWindow; + wxFlexGridSizer* gwSizer; + + }; const wxEventType wxEVT_DO_SCREENSHOT = wxNewEventType(); diff --git a/src/WxWizFrame.fbp b/src/WxWizFrame.fbp index e927d3c6..4cf3c08a 100644 --- a/src/WxWizFrame.fbp +++ b/src/WxWizFrame.fbp @@ -760,100 +760,6 @@ - - 1 - 1 - 1 - 1 - - - - Daily Information - 1 - 1 - 0 - - 1 - 0 - Dock - 1 - Center - 1 - - 1 - - 0 - 0 - wxID_ANY - 1 - - 0 - - - 0 - -1,-1 - 1 - ScrolledWindow - 1 - 779,393 - -1,-1 - protected - 1 - - - Resizable - 0 - 5 - 5 - 1 - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - wxHSCROLL|wxVSCROLL - - - - - - - - - - - - - - - - - - - - - - - - - 1 - wxVERTICAL - 0 - - 0 - - fgSizer - wxFLEX_GROWMODE_ALL - protected - 0 - 0 - - 1 1 diff --git a/src/graphs/graph.cpp b/src/graphs/graph.cpp index a4c9be53..1a43b2aa 100644 --- a/src/graphs/graph.cpp +++ b/src/graphs/graph.cpp @@ -10,7 +10,6 @@ License: LGPL #include #include #include -#include #include @@ -55,7 +54,8 @@ bool gfont_init=false; FTFont *normalfont=NULL; FTFont *largefont=NULL; -FTFont *rotfont=NULL; +FTFont *texfont=NULL; +//FTFont *rotfont=NULL; list font_paths; @@ -77,7 +77,13 @@ void GraphInit() normalfont=new FTGLPixmapFont(fontfile.mb_str()); largefont=new FTGLPixmapFont(fontfile.mb_str()); - rotfont=new FTGLTextureFont(fontfile.mb_str()); + texfont=new FTGLTextureFont(pref.Get("{home}{sep}FreeSans.ttf").mb_str()); // each context needs it's own texture font. Should be sharing one context.. + if (texfont->Error()) { + delete texfont; + texfont=NULL; + } else { + texfont->FaceSize(15); + } if (normalfont->Error()) { delete normalfont; normalfont=NULL; @@ -86,13 +92,9 @@ void GraphInit() delete largefont; largefont=NULL; } - if (rotfont->Error()) { - delete rotfont; - rotfont=NULL; - } largefont->FaceSize(30); normalfont->FaceSize(14); - rotfont->FaceSize(14); + //rotfont->FaceSize(20); bigfont=new wxFont(32,wxFONTFAMILY_ROMAN,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL); boldfont=new wxFont(12,wxFONTFAMILY_ROMAN,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD); smallfont=new wxFont(10,wxFONTFAMILY_ROMAN,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_NORMAL); @@ -105,7 +107,7 @@ void GraphDone() delete smallfont; delete boldfont; delete bigfont; - delete rotfont; + delete texfont; delete normalfont; gfont_init=false; } @@ -145,24 +147,26 @@ void DrawText(wxString text, float x, float y, float angle=0, const wxColor & co //glPushAttrib(GL_LIST_BIT|GL_CURRENT_BIT|GL_ENABLE_BIT|GL_TRANSFORM_BIT); - glPushMatrix(); //glEnable(GL_BLEND); // glPixelTransferf(GL_RED_BIAS, -1.0f); //glPixelTransferf(GL_GREEN_BIAS, -1.0f); //glPixelTransferf(GL_BLUE_BIAS, -1.0f); //glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); + // glPushAttrib( GL_ENABLE_BIT | GL_HINT_BIT | GL_LINE_BIT | GL_PIXEL_MODE_BIT); + +// glEnable(GL_BLEND); + // glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // GL_ONE + glColor4ub(color.Red(),color.Green(),color.Blue(),color.Alpha()); - glDisable(GL_BLEND); - glDisable(GL_LIGHTING); - glDisable(GL_DEPTH_TEST); - //glDisable(GL_TEXTURE_2D); + glPushMatrix(); + //glEnable(GL_TEXTURE_2D); //glBlendFunc(GL_ZERO, GL_ONE, GL_SRC_COLOR, GL_ZERO); // glBlendFunc(GL_ONE, GL_ZERO); //glLoadIdentity(); glTranslatef(x,y,0); - glRotatef(90.0, 0.0f, 0.0f, 1.0f); + glRotatef(angle, 0.0f, 0.0f, 1.0f); font->Render(text.mb_str(),-1,FTPoint(-w/2.0,-h/2.0)); glTranslatef(-x,-y,0); //glDisable(GL_BLEND); @@ -282,8 +286,10 @@ gGraphWindow::gGraphWindow() { } +wxGLContext *shared_context=NULL; + gGraphWindow::gGraphWindow(wxWindow *parent, wxWindowID id,const wxString & title,const wxPoint &pos,const wxSize &size,long flags) -: wxGLCanvas( parent, (wxGLContext *)NULL, id, pos, size, flags, title, (int *)wx_gl_attribs, wxNullPalette ) +: wxGLCanvas( parent, shared_context, id, pos, size, flags, title, (int *)wx_gl_attribs, wxNullPalette ) { m_scrX = m_scrY = 64; m_title=title; @@ -299,19 +305,21 @@ gGraphWindow::gGraphWindow(wxWindow *parent, wxWindowID id,const wxString & titl m_foobar_moved=0; gtitle=foobar=xaxis=yaxis=NULL; + if (!shared_context) { #if defined(__DARWIN__) - // Screw you apple.. - int *attribList = (int*) NULL; - AGLPixelFormat aglpf=aglChoosePixelFormat(NULL,0,attribList); - gl_context=new wxGLContext(aglpf,this,wxNullPalette,NULL); - // Mmmmm.. Platform incosistency with wx.. - + // Screw you apple.. + int *attribList = (int*) NULL; + AGLPixelFormat aglpf=aglChoosePixelFormat(NULL,0,attribList); + shared_context=new wxGLContext(aglpf,this,wxNullPalette,NULL); + // Mmmmm.. Platform incosistency with wx.. #else - gl_context=new wxGLContext(this,NULL); + shared_context=new wxGLContext(this,NULL); #endif - GraphInit(); // Font -//rotfont->FaceSize(14); + } + + GraphInit(); // Font + texfont=::texfont; AddLayer(new gGraphTitle(title,wxVERTICAL,boldfont)); } @@ -841,9 +849,9 @@ void gGraphWindow::OnPaint(wxPaintEvent& event) GetClientSize(&m_scrX, &m_scrY); #if !defined(__DARWIN__) - gl_context->SetCurrent(*this); // A generic Context needs to be used.. Not one per graph window + shared_context->SetCurrent(*this); // A generic Context needs to be used.. Not one per graph window #else - gl_context->SetCurrent(); + shared_context->SetCurrent(); #endif glViewport(0, 0, m_scrX, m_scrY); @@ -874,7 +882,7 @@ void gGraphWindow::OnPaint(wxPaintEvent& event) glVertex2f(m_scrX, m_scrY); glEnd(); - glEnable(GL_TEXTURE_2D); + // glEnable(GL_TEXTURE_2D); //glMatrixMode(GL_PROJECTION); //glPopMatrix(); //glMatrixMode(GL_MODELVIEW); @@ -895,7 +903,7 @@ void gGraphWindow::OnPaint(wxPaintEvent& event) RoundedRectangle(m_mouseRBrect.x,m_mouseRBrect.y,m_mouseRBrect.width-1,m_mouseRBrect.height,5,*wxDARK_GREY); } - //glEnable(GL_DEPTH_TEST); +// glEnable(GL_DEPTH_TEST); SwapBuffers(); @@ -1496,10 +1504,10 @@ void gGraphTitle::Plot(wxDC & dc, gGraphWindow & w) GetTextExtent(m_title,width,height); DrawText(m_title,4,scrx-height,0); } else { - GetTextExtent(m_title,width,height,rotfont); + GetTextExtent(m_title,width,height,w.texfont); int xp=(height/2)+5; if (m_alignment==wxALIGN_RIGHT) xp=scrx-4-height; - DrawText(m_title,xp,w.GetBottomMargin()+((scry-w.GetBottomMargin())/2.0)+(height/2),90.0,*wxBLACK,rotfont); + DrawText(m_title,xp,w.GetBottomMargin()+((scry-w.GetBottomMargin())/2.0)+(height/2),90.0,*wxBLACK,w.texfont); } } @@ -1758,7 +1766,7 @@ void gBarChart::Plot(wxDC & dc, gGraphWindow & w) if (m_direction==wxVERTICAL) { DrawText(str,start_px-textX-8,j); } else { - DrawText(str,j,start_py-16-(textX/2),90,*wxBLACK,rotfont); + DrawText(str,j,start_py-16-(textX/2),90,*wxBLACK,w.texfont); } } else draw_xticks_instead=true; @@ -2133,8 +2141,6 @@ void gLineOverlayBar::Plot(wxDC & dc, gGraphWindow & w) double x1,x2; - glEnable(GL_POINT_SMOOTH); - glEnable( GL_BLEND ); wxColor & col=color[0]; for (int n=0;nVC();n++) { @@ -2177,20 +2183,26 @@ void gLineOverlayBar::Plot(wxDC & dc, gGraphWindow & w) glVertex2f(x1,start_py+height-25); glEnd(); + //glEnable(GL_POINT_SMOOTH); glColor4ub(col.Red(),col.Green(),col.Blue(),col.Alpha()); glPointSize(6); glBegin(GL_POINTS); glVertex2f(x1,start_py+height-25); glEnd(); + // glDisable(GL_POINT_SMOOTH); } else { RoundedRectangle(x1,start_py,w1,height,2,col); } } else if (lo_type==LOT_Dot) { glColor4ub(col.Red(),col.Green(),col.Blue(),col.Alpha()); + //glEnable(GL_POINT_SMOOTH); + //glEnable(GL_BLEND); glPointSize(4); glBegin(GL_POINTS); glVertex2f(x1,start_py+(height/2)+14); glEnd(); + //glDisable(GL_POINT_SMOOTH); + //glDisable(GL_BLEND); } @@ -2200,6 +2212,7 @@ void gLineOverlayBar::Plot(wxDC & dc, gGraphWindow & w) if (done) break; } + } gFlagsLine::gFlagsLine(gPointData *d,const wxColor * col,wxString _label,int _line_num,int _total_lines) @@ -2236,8 +2249,8 @@ void gFlagsLine::Plot(wxDC & dc, gGraphWindow & w) // static wxColor col2=wxColor(0xe0,0xe0,0xff,0xff); static wxColor col2=wxColor(0xff,0xff,0xff,0xff); - dc.SetFont(*smallfont); - dc.SetTextForeground(*wxBLACK); + //dc.SetFont(*smallfont); + //dc.SetTextForeground(*wxBLACK); float line_h=float(height-2)/float(total_lines); diff --git a/src/graphs/graph.h b/src/graphs/graph.h index 6c7affe8..5186f291 100644 --- a/src/graphs/graph.h +++ b/src/graphs/graph.h @@ -9,6 +9,8 @@ License: LGPL #include #include +#include + #include #include @@ -119,6 +121,7 @@ public: }; +extern wxGLContext *shared_context; class gGraphWindow:public wxGLCanvas //Window // rename to gGraphWindow { @@ -225,7 +228,7 @@ class gGraphWindow:public wxGLCanvas //Window // rename to gGraphWindow void SetBlockMove(bool b) { m_block_move=b; }; wxGLContext *gl_context; - + FTFont *texfont; protected: listlink_zoom; diff --git a/src/version.h b/src/version.h index b2b04153..0fda5997 100644 --- a/src/version.h +++ b/src/version.h @@ -16,14 +16,14 @@ namespace AutoVersion{ //Standard Version Type static const long MAJOR = 0; static const long MINOR = 7; - static const long BUILD = 5075; - static const long REVISION = 11002; + static const long BUILD = 5135; + static const long REVISION = 11367; //Miscellaneous Version Types - static const long BUILDS_COUNT = 4576; - #define RC_FILEVERSION 0,7,5075,11002 - #define RC_FILEVERSION_STRING "0, 7, 5075, 11002\0" - static const char FULLVERSION_STRING[] = "0.7.5075.11002"; + static const long BUILDS_COUNT = 4705; + #define RC_FILEVERSION 0,7,5135,11367 + #define RC_FILEVERSION_STRING "0, 7, 5135, 11367\0" + static const char FULLVERSION_STRING[] = "0.7.5135.11367"; //These values are to keep track of your versioning state, don't modify them. static const long BUILD_HISTORY = 0;