Vertical Fonts, Shared Contexts, and temporary killed rounded dots due to GL_POINT_SMOOTH slowdown

This commit is contained in:
Mark Watkins 2011-06-12 17:12:44 +10:00
parent 7cbde1615d
commit d5ab786b4a
9 changed files with 124 additions and 190 deletions

View File

@ -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"
<wx/wx.h>
"GUIFrame.h"
1307708368 /home/mark/projects/git/sleepyhead/src/GUIFrame.h
1307861037 /home/mark/projects/git/sleepyhead/src/GUIFrame.h
<wx/intl.h>
<wx/string.h>
<wx/bitmap.h>
@ -8231,10 +8231,10 @@
<wx/frame.h>
<wx/aui/aui.h>
<wx/calctrl.h>
<wx/sizer.h>
<wx/scrolwin.h>
<wx/panel.h>
<wx/html/htmlwin.h>
<wx/sizer.h>
<wx/scrolwin.h>
<wx/radiobut.h>
<wx/stattext.h>
<wx/datectrl.h>
@ -8258,7 +8258,7 @@
1307418393 /home/mark/projects/git/sleepyhead/src/SleepyHeadApp.h
<wx/app.h>
1307772405 /home/mark/projects/git/sleepyhead/src/SleepyHeadMain.h
1307862247 /home/mark/projects/git/sleepyhead/src/SleepyHeadMain.h
<wx/listbox.h>
<wx/treectrl.h>
"SleepyHeadApp.h"
@ -8300,13 +8300,14 @@
<map>
"tinyxml/tinyxml.h"
1307789091 /home/mark/projects/git/sleepyhead/src/graphs/graph.h
1307862530 /home/mark/projects/git/sleepyhead/src/graphs/graph.h
<wx/dcgraph.h>
<wx/glcanvas.h>
<FTGL/ftgl.h>
<sleeplib/machine.h>
<list>
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"
<wx/app.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
<wx/settings.h>
<wx/dcbuffer.h>
<wx/graphics.h>
<wx/glcanvas.h>
<wx/log.h>
<FTGL/ftgl.h>
<math.h>
<OpenGL/gl.h>
<AGL/agl.h>

View File

@ -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 ) ) );

View File

@ -24,10 +24,10 @@
#include <wx/frame.h>
#include <wx/aui/aui.h>
#include <wx/calctrl.h>
#include <wx/sizer.h>
#include <wx/scrolwin.h>
#include <wx/panel.h>
#include <wx/html/htmlwin.h>
#include <wx/sizer.h>
#include <wx/scrolwin.h>
#include <wx/radiobut.h>
#include <wx/stattext.h>
#include <wx/datectrl.h>
@ -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

View File

@ -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) {

View File

@ -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();

View File

@ -760,100 +760,6 @@
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
<object class="wxScrolledWindow" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_name"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption">Daily Information</property>
<property name="caption_visible">1</property>
<property name="center_pane">1</property>
<property name="close_button">0</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">1</property>
<property name="docking">Center</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="layer">1</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size">-1,-1</property>
<property name="moveable">1</property>
<property name="name">ScrolledWindow</property>
<property name="pane_border">1</property>
<property name="pane_position">779,393</property>
<property name="pane_size">-1,-1</property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="position"></property>
<property name="resize">Resizable</property>
<property name="row">0</property>
<property name="scroll_rate_x">5</property>
<property name="scroll_rate_y">5</property>
<property name="show">1</property>
<property name="size"></property>
<property name="subclass"></property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxHSCROLL|wxVSCROLL</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
<object class="wxFlexGridSizer" expanded="1">
<property name="cols">1</property>
<property name="flexible_direction">wxVERTICAL</property>
<property name="growablecols">0</property>
<property name="growablerows"></property>
<property name="hgap">0</property>
<property name="minimum_size"></property>
<property name="name">fgSizer</property>
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_ALL</property>
<property name="permission">protected</property>
<property name="rows">0</property>
<property name="vgap">0</property>
</object>
</object>
<object class="wxAuiNotebook" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>

View File

@ -10,7 +10,6 @@ License: LGPL
#include <wx/graphics.h>
#include <wx/glcanvas.h>
#include <wx/log.h>
#include <FTGL/ftgl.h>
#include <math.h>
@ -55,7 +54,8 @@ bool gfont_init=false;
FTFont *normalfont=NULL;
FTFont *largefont=NULL;
FTFont *rotfont=NULL;
FTFont *texfont=NULL;
//FTFont *rotfont=NULL;
list<wxString> 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;n<data->VC();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);

View File

@ -9,6 +9,8 @@ License: LGPL
#include <wx/dcgraph.h>
#include <wx/glcanvas.h>
#include <FTGL/ftgl.h>
#include <sleeplib/machine.h>
#include <list>
@ -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:
list<gGraphWindow *>link_zoom;

View File

@ -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;