summaryrefslogtreecommitdiffstats
path: root/Project/Workspace.cpp
diff options
context:
space:
mode:
authorThales Lima Oliveira <thaleslima.ufu@gmail.com>2020-06-09 18:37:09 -0300
committerThales Lima Oliveira <thaleslima.ufu@gmail.com>2020-06-09 18:37:09 -0300
commit8321d2612f6ee88bafd97c1bf08fb9f0b7a9db5b (patch)
tree750b535468c5968b201b9ab66ad8a147318f9d44 /Project/Workspace.cpp
parentc5636d2031b20e673441e095d90ba94942698e7c (diff)
downloadPSP.git-8321d2612f6ee88bafd97c1bf08fb9f0b7a9db5b.tar.gz
PSP.git-8321d2612f6ee88bafd97c1bf08fb9f0b7a9db5b.tar.xz
PSP.git-8321d2612f6ee88bafd97c1bf08fb9f0b7a9db5b.zip
Some OpenGL canvas fix
Diffstat (limited to 'Project/Workspace.cpp')
-rw-r--r--Project/Workspace.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/Project/Workspace.cpp b/Project/Workspace.cpp
index af95fbf..37fb027 100644
--- a/Project/Workspace.cpp
+++ b/Project/Workspace.cpp
@@ -62,6 +62,8 @@ Workspace::Workspace(wxWindow* parent, wxString name, wxStatusBar* statusBar, wx
m_statusBar->SetStatusWidths(4, widths);
m_properties = new PropertiesData();
+
+ m_glCanvas->SetBackgroundStyle(wxBG_STYLE_CUSTOM);
}
Workspace::~Workspace()
@@ -82,9 +84,13 @@ void Workspace::OnPaint(wxPaintEvent& event)
{
if(!m_glCanvas->IsShown()) return;
- wxPaintDC dc(m_glCanvas);
+
+ //dc.Clear();
- m_glContext->SetCurrent(*m_glCanvas);
+ //m_glContext->SetCurrent(*m_glCanvas);
+ m_glCanvas->SetCurrent(*m_glContext);
+ wxPaintDC dc(m_glCanvas);
+
SetViewport();
// Set GLCanvas scale and translation.
@@ -129,8 +135,11 @@ void Workspace::OnPaint(wxPaintEvent& event)
void Workspace::SetViewport()
{
+
+ glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
+ glDepthMask(GL_TRUE);
glClearColor(1.0, 1.0, 1.0, 1.0); // White background.
- glClear(GL_COLOR_BUFFER_BIT);
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glDisable(GL_DEPTH_TEST);
glDisable(GL_TEXTURE_2D);
glEnable(GL_COLOR_MATERIAL);