diff options
author | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2020-06-02 21:47:06 -0300 |
---|---|---|
committer | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2020-06-02 21:47:06 -0300 |
commit | 113a35d0fe8938973fa1c100b77f456ed250e61b (patch) | |
tree | 586d1c3113082cbb2b92cd46c3c96a25a0e75e67 /Project/SyncGenerator.cpp | |
parent | 6ce2bdcf85dffee6b6ef7b95b888b8b96372a3d6 (diff) | |
download | PSP.git-113a35d0fe8938973fa1c100b77f456ed250e61b.tar.gz PSP.git-113a35d0fe8938973fa1c100b77f456ed250e61b.tar.xz PSP.git-113a35d0fe8938973fa1c100b77f456ed250e61b.zip |
OpenGL bugfixes and wxGC port alternative init
OpenGL major bugfixes;
Device context port alternative to OpenGL code init (WorkspaceDC). Some machines don't support OpenGL 3+;
Fixed some issues with MSVC.
Diffstat (limited to 'Project/SyncGenerator.cpp')
-rw-r--r-- | Project/SyncGenerator.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/Project/SyncGenerator.cpp b/Project/SyncGenerator.cpp index 78082d2..49571ac 100644 --- a/Project/SyncGenerator.cpp +++ b/Project/SyncGenerator.cpp @@ -15,6 +15,7 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ +#include "Workspace.h" #include "ControlElementContainer.h" #include "SyncGenerator.h" #include "SyncMachineForm.h" @@ -51,6 +52,15 @@ void SyncGenerator::DrawSymbol() const for(int i = 0; i < (int)m_sinePts.size(); i++) { sinePts.push_back(m_sinePts[i] + m_position); } DrawLine(sinePts); } + +void SyncGenerator::DrawDCSymbol(wxGraphicsContext* gc) const +{ + // Draw sine. + std::vector<wxPoint2DDouble> sinePts; + for (unsigned int i = 0; i < m_sinePts.size(); i++) { sinePts.push_back(m_sinePts[i] + m_position); } + gc->DrawLines(sinePts.size(), &sinePts[0]); +} + bool SyncGenerator::GetContextMenu(wxMenu& menu) { menu.Append(ID_EDIT_ELEMENT, _("Edit Generator")); @@ -60,7 +70,8 @@ bool SyncGenerator::GetContextMenu(wxMenu& menu) bool SyncGenerator::ShowForm(wxWindow* parent, Element* element) { - SyncMachineForm* generatorForm = new SyncMachineForm(parent, this); + Workspace* ws = static_cast<Workspace*>(parent); + SyncMachineForm* generatorForm = new SyncMachineForm(parent, this, ws->GetSharedGLContext()); generatorForm->SetTitle(_("Generator")); if(generatorForm->ShowModal() == wxID_OK) { generatorForm->Destroy(); |