diff options
author | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2020-06-09 18:37:09 -0300 |
---|---|---|
committer | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2020-06-09 18:37:09 -0300 |
commit | 8321d2612f6ee88bafd97c1bf08fb9f0b7a9db5b (patch) | |
tree | 750b535468c5968b201b9ab66ad8a147318f9d44 | |
parent | c5636d2031b20e673441e095d90ba94942698e7c (diff) | |
download | PSP.git-8321d2612f6ee88bafd97c1bf08fb9f0b7a9db5b.tar.gz PSP.git-8321d2612f6ee88bafd97c1bf08fb9f0b7a9db5b.tar.xz PSP.git-8321d2612f6ee88bafd97c1bf08fb9f0b7a9db5b.zip |
Some OpenGL canvas fix
-rw-r--r-- | Project/Project.project | 2 | ||||
-rw-r--r-- | Project/Workspace.cpp | 15 | ||||
-rw-r--r-- | Project/WorkspaceBase.cpp | 2 | ||||
-rw-r--r-- | Project/WorkspaceBitmaps.cpp | 4 | ||||
-rw-r--r-- | Project/compile_flags.txt | 9 |
5 files changed, 24 insertions, 8 deletions
diff --git a/Project/Project.project b/Project/Project.project index 25c00fe..74cb0a2 100644 --- a/Project/Project.project +++ b/Project/Project.project @@ -521,7 +521,7 @@ <SearchPaths/> </Completion> </Configuration> - <Configuration Name="Release_Windows_x64" CompilerType="MinGW 64bit ( MSYS2 64bit )" DebuggerType="GNU gdb debugger" Type="Executable" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append"> + <Configuration Name="Release_Windows_x64" CompilerType="MinGW ( mingw-w64 )" DebuggerType="GNU gdb debugger" Type="Executable" BuildCmpWithGlobalSettings="append" BuildLnkWithGlobalSettings="append" BuildResWithGlobalSettings="append"> <Compiler Options="-O2;-std=c++17;-Wall;$(shell wx-config --cflags)" C_Options="-O2;-Wall" Assembler="" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" PCHFlags="" PCHFlagsPolicy="0"> <IncludePath Value="."/> <Preprocessor Value="NDEBUG"/> 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); diff --git a/Project/WorkspaceBase.cpp b/Project/WorkspaceBase.cpp index 6fc2b79..ae718fb 100644 --- a/Project/WorkspaceBase.cpp +++ b/Project/WorkspaceBase.cpp @@ -41,7 +41,7 @@ WorkspaceBase::WorkspaceBase(wxWindow* parent, wxWindowID id, const wxPoint& pos m_timer->Start(1500, false); SetName(wxT("WorkspaceBase")); - SetSize(500,300); + SetSize(wxDLG_UNIT(this, wxSize(500,300))); if (GetSizer()) { GetSizer()->Fit(this); } diff --git a/Project/WorkspaceBitmaps.cpp b/Project/WorkspaceBitmaps.cpp index b370872..5dab0cb 100644 --- a/Project/WorkspaceBitmaps.cpp +++ b/Project/WorkspaceBitmaps.cpp @@ -44,6 +44,6 @@ void wxC52C4InitBitmapResources() else wxFileSystem::AddHandler(new wxMemoryFSHandlerBase); } - XRC_ADD_FILE(wxT("XRC_resource/WorkspaceBitmaps.cpp$C__Users_NDSE-69_Documents_GitHub_PSP_Project_WorkspaceBitmaps.xrc"), xml_res_file_0, xml_res_size_0, wxT("text/xml")); - wxXmlResource::Get()->Load(wxT("memory:XRC_resource/WorkspaceBitmaps.cpp$C__Users_NDSE-69_Documents_GitHub_PSP_Project_WorkspaceBitmaps.xrc")); + XRC_ADD_FILE(wxT("XRC_resource/WorkspaceBitmaps.cpp$C__Users_thale_Documents_GitHub_PSP_Project_WorkspaceBitmaps.xrc"), xml_res_file_0, xml_res_size_0, wxT("text/xml")); + wxXmlResource::Get()->Load(wxT("memory:XRC_resource/WorkspaceBitmaps.cpp$C__Users_thale_Documents_GitHub_PSP_Project_WorkspaceBitmaps.xrc")); } diff --git a/Project/compile_flags.txt b/Project/compile_flags.txt index 2bba831..aece3ee 100644 --- a/Project/compile_flags.txt +++ b/Project/compile_flags.txt @@ -1,3 +1,9 @@ +-IC:\mingw-w64\lib\gcc\x86_64-w64-mingw32\8.1.0\include\c++ +-IC:\mingw-w64\lib\gcc\x86_64-w64-mingw32\8.1.0\include\c++\x86_64-w64-mingw32 +-IC:\mingw-w64\lib\gcc\x86_64-w64-mingw32\8.1.0\include\c++\backward +-IC:\mingw-w64\lib\gcc\x86_64-w64-mingw32\8.1.0\include +-IC:\mingw-w64\lib\gcc\x86_64-w64-mingw32\8.1.0\include-fixed +-IC:\mingw-w64\x86_64-w64-mingw32\include -IC:\Users\thale\Documents\GitHub\PSP\Project -IC:\wxWidgets-3.1.3\lib\gcc_dll\mswu -IC:\wxWidgets-3.1.3\include @@ -7,5 +13,6 @@ -D__WXMSW__ -DNDEBUG -DUNICODE +-std=c++11 -target -i686-pc-windows-gnu +x86_64-pc-windows-gnu |