ogledit Where is it and can it be built?

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4182
Joined: Sun Jan 03, 2010 5:45 pm

Re: ogledit Where is it and can it be built?

Post by PB »

I will publish it but as I wrote:
(1) I did not build it as a library, just dropped all the files into a project.
(2) I am on Windows (only).

If one is familiar with wxWidgets, the changes needed are simple, they just take some time.
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4182
Joined: Sun Jan 03, 2010 5:45 pm

Re: ogledit Where is it and can it be built?

Post by PB »

I realized why the changes I made were easy: wxUSE_DEPRECATED and wxUSE_PROLOGIO are set to 0 in ogl/basic.h.

Defining these two makes lots of stuff (including saving files) work but also opens the whole new can of worms. I think I was able to fix most of them but I failed (read gave up) when I learned about this

Code: Select all

IMPLEMENT_DYNAMIC_CLASS(wxExprDatabase, wxList)
I do not think this is possible in modern wxWidgets. I believe it should not be difficult to fix but who knows.

FWIW, here are my futile and pretty much useless changes. Please note that for sake of speed, I built ogl not as library but just dropped the required files into my project and set the include paths appropriately. I also did not bother to fix incorrect pointer casts in 64-bit build and used 32-bit build instead.

The commit history is a mess, as I firstly did not include the "deprecated" files.

https://github.com/PBfordev/ogltest
DavidHart
Site Admin
Site Admin
Posts: 4252
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Re: ogledit Where is it and can it be built?

Post by DavidHart »

IMPLEMENT_DYNAMIC_CLASS(wxExprDatabase, wxList)
I do not think this is possible in modern wxWidgets.
Out of curiosity, which part of that line is the problem?

I know that 'IMPLEMENT_DYNAMIC_CLASS' should now be 'wxIMPLEMENT_DYNAMIC_CLASS(...);'. There were wxList changes too, but I thought they can be overcome using wxList<T>::compatibility_iterator.
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4182
Joined: Sun Jan 03, 2010 5:45 pm

Re: ogledit Where is it and can it be built?

Post by PB »

DavidHart wrote: Mon Jun 07, 2021 6:32 pm Out of curiosity, which part of that line is the problem?

Code: Select all

Error	C2039	'ms_classInfo': is not a member of 'wxList'
Error	C2440	'return': cannot convert from 'wxExprDatabase *' to 'wxObject *'
I think wxList cannot be used like this, the OGL code seems to use some superancient wxList API from which had it contain untyped nodes.
stahta01
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 548
Joined: Fri Nov 03, 2006 2:00 pm

Re: ogledit Where is it and can it be built?

Post by stahta01 »

For those like me wandering what OGL means.
Object Graphics Library
OGL defines an API for applications that need to display objects connected by lines. The objects can be moved around and interacted with. You can find this in contrib/src/ogl, contrib/include/wx/ogl, and contrib/samples/ogl.
Tim S.
olduser
Earned a small fee
Earned a small fee
Posts: 12
Joined: Sun Jun 06, 2021 7:16 am

Re: ogledit Where is it and can it be built?

Post by olduser »

Also, there are ogl (opengl) programs in samples that already do work in the latest wxwidgets.
Like pyramid or cube.
They build and work fine without any special config parameters.

But the items in the former "contrib" directory don't exist anymore.
User avatar
doublemax
Moderator
Moderator
Posts: 19102
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: ogledit Where is it and can it be built?

Post by doublemax »

ogl and OpenGL are two different, totally unrelated things.
Use the source, Luke!
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4182
Joined: Sun Jan 03, 2010 5:45 pm

Re: ogledit Where is it and can it be built?

Post by PB »

I had never used either but at the first glance, wxArt2D seems a bit similar to ogl. However, it is also unmaintained.
olduser
Earned a small fee
Earned a small fee
Posts: 12
Joined: Sun Jun 06, 2021 7:16 am

Re: ogledit Where is it and can it be built?

Post by olduser »

PB wrote: Tue Jun 08, 2021 5:39 am I had never used either but at the first glance, wxArt2D seems a bit similar to ogl. However, it is also unmaintained.
At least there are some build instructions here (I have never used it either)

https://www.wxart2d.org/cgi-bin/moin.cgi/WxArt2dInstall
stahta01
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 548
Joined: Fri Nov 03, 2006 2:00 pm

Re: ogledit Where is it and can it be built?

Post by stahta01 »

2 year old project https://github.com/firodj/wxOgl

Edit: It might have some fixes; but, I failed to find any.

Edit2: https://sourceforge.net/projects/wxsf/ wxShapeFramework another project that is dead or maybe just dying

Tim S.
ollydbg23
Super wx Problem Solver
Super wx Problem Solver
Posts: 438
Joined: Fri Dec 12, 2008 10:31 am

Re: ogledit Where is it and can it be built?

Post by ollydbg23 »

https://github.com/PBfordev/ogltest

There is not such repo now, did you remove this repo?

Also, I see that the wxArt2D is quite complex to build.

So, I'd like to try either VZ's repo: vadz/grapheditor: Graph editor library for wxWidgets (including OGL) — https://github.com/vadz/grapheditor
I'm not sure why the Graphviz headers and libraries is needed.

Another repo I found is: https://github.com/firodj/wxOgl, maybe this is simpler than VZ's.
ollydbg23
Super wx Problem Solver
Super wx Problem Solver
Posts: 438
Joined: Fri Dec 12, 2008 10:31 am

Re: ogledit Where is it and can it be built?

Post by ollydbg23 »

To build the https://github.com/firodj/wxOgl

I just drop the source code and files under OglEdit subfolder to a wx project, and I got such build errors:

Code: Select all

[  5.0%] g++.exe -Wall -std=c++17 -g -pipe -mthreads -Winvalid-pch -include wx_pch.h -IF:/msys2/mingw64/lib/wx/include/msw-unicode-3.1 -IF:/msys2/mingw64/include/wx-3.1 -mthreads -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMSW__ -DHAVE_W32API_H -D_UNICODE -fmessage-length=0 -pipe -D__WXDEBUG__ -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -DWX_PRECOMP -iquoteobj\Debug -Iobj\Debug -I. -I. -IInclude -c D:\code\wxOgl\wx_pch.h -o obj\Debug\wx_pch.h.gch
[ 10.0%] windres.exe  --include-dir F:/msys2/mingw64/lib/wx/include/msw-unicode-3.1 --include-dir F:/msys2/mingw64/include/wx-3.1 --define __WXMSW__ --define _UNICODE --define WXUSINGDLL   -J rc -O coff -i D:\code\wxOgl\resource.rc -o obj\Debug\resource.res
[ 15.0%] g++.exe -Wall -std=c++17 -g -pipe -mthreads -Winvalid-pch -include wx_pch.h -IF:/msys2/mingw64/lib/wx/include/msw-unicode-3.1 -IF:/msys2/mingw64/include/wx-3.1 -mthreads -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMSW__ -DHAVE_W32API_H -D_UNICODE -fmessage-length=0 -pipe -D__WXDEBUG__ -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -DWX_PRECOMP -iquoteobj\Debug -Iobj\Debug -I. -I. -IInclude -c D:\code\wxOgl\Sample\OglEdit\doc.cpp -o obj\Debug\Sample\OglEdit\doc.o
[ 20.0%] g++.exe -Wall -std=c++17 -g -pipe -mthreads -Winvalid-pch -include wx_pch.h -IF:/msys2/mingw64/lib/wx/include/msw-unicode-3.1 -IF:/msys2/mingw64/include/wx-3.1 -mthreads -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMSW__ -DHAVE_W32API_H -D_UNICODE -fmessage-length=0 -pipe -D__WXDEBUG__ -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -DWX_PRECOMP -iquoteobj\Debug -Iobj\Debug -I. -I. -IInclude -c D:\code\wxOgl\Sample\OglEdit\ogledit.cpp -o obj\Debug\Sample\OglEdit\ogledit.o
[ 25.0%] windres.exe  --include-dir F:/msys2/mingw64/lib/wx/include/msw-unicode-3.1 --include-dir F:/msys2/mingw64/include/wx-3.1 --define __WXMSW__ --define _UNICODE --define WXUSINGDLL   -J rc -O coff -i D:\code\wxOgl\Sample\OglEdit\ogledit.rc -o obj\Debug\Sample\OglEdit\ogledit.res
[ 30.0%] g++.exe -Wall -std=c++17 -g -pipe -mthreads -Winvalid-pch -include wx_pch.h -IF:/msys2/mingw64/lib/wx/include/msw-unicode-3.1 -IF:/msys2/mingw64/include/wx-3.1 -mthreads -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMSW__ -DHAVE_W32API_H -D_UNICODE -fmessage-length=0 -pipe -D__WXDEBUG__ -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -DWX_PRECOMP -iquoteobj\Debug -Iobj\Debug -I. -I. -IInclude -c D:\code\wxOgl\Sample\OglEdit\palette.cpp -o obj\Debug\Sample\OglEdit\palette.o
[ 35.0%] g++.exe -Wall -std=c++17 -g -pipe -mthreads -Winvalid-pch -include wx_pch.h -IF:/msys2/mingw64/lib/wx/include/msw-unicode-3.1 -IF:/msys2/mingw64/include/wx-3.1 -mthreads -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMSW__ -DHAVE_W32API_H -D_UNICODE -fmessage-length=0 -pipe -D__WXDEBUG__ -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -DWX_PRECOMP -iquoteobj\Debug -Iobj\Debug -I. -I. -IInclude -c D:\code\wxOgl\Sample\OglEdit\view.cpp -o obj\Debug\Sample\OglEdit\view.o
[ 40.0%] g++.exe -Wall -std=c++17 -g -pipe -mthreads -Winvalid-pch -include wx_pch.h -IF:/msys2/mingw64/lib/wx/include/msw-unicode-3.1 -IF:/msys2/mingw64/include/wx-3.1 -mthreads -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMSW__ -DHAVE_W32API_H -D_UNICODE -fmessage-length=0 -pipe -D__WXDEBUG__ -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -DWX_PRECOMP -iquoteobj\Debug -Iobj\Debug -I. -I. -IInclude -c D:\code\wxOgl\Source\basic.cpp -o obj\Debug\Source\basic.o
[ 45.0%] g++.exe -Wall -std=c++17 -g -pipe -mthreads -Winvalid-pch -include wx_pch.h -IF:/msys2/mingw64/lib/wx/include/msw-unicode-3.1 -IF:/msys2/mingw64/include/wx-3.1 -mthreads -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMSW__ -DHAVE_W32API_H -D_UNICODE -fmessage-length=0 -pipe -D__WXDEBUG__ -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -DWX_PRECOMP -iquoteobj\Debug -Iobj\Debug -I. -I. -IInclude -c D:\code\wxOgl\Source\basic2.cpp -o obj\Debug\Source\basic2.o
[ 50.0%] g++.exe -Wall -std=c++17 -g -pipe -mthreads -Winvalid-pch -include wx_pch.h -IF:/msys2/mingw64/lib/wx/include/msw-unicode-3.1 -IF:/msys2/mingw64/include/wx-3.1 -mthreads -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMSW__ -DHAVE_W32API_H -D_UNICODE -fmessage-length=0 -pipe -D__WXDEBUG__ -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -DWX_PRECOMP -iquoteobj\Debug -Iobj\Debug -I. -I. -IInclude -c D:\code\wxOgl\Source\bmpshape.cpp -o obj\Debug\Source\bmpshape.o
[ 55.0%] g++.exe -Wall -std=c++17 -g -pipe -mthreads -Winvalid-pch -include wx_pch.h -IF:/msys2/mingw64/lib/wx/include/msw-unicode-3.1 -IF:/msys2/mingw64/include/wx-3.1 -mthreads -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMSW__ -DHAVE_W32API_H -D_UNICODE -fmessage-length=0 -pipe -D__WXDEBUG__ -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -DWX_PRECOMP -iquoteobj\Debug -Iobj\Debug -I. -I. -IInclude -c D:\code\wxOgl\Source\canvas.cpp -o obj\Debug\Source\canvas.o
[ 60.0%] g++.exe -Wall -std=c++17 -g -pipe -mthreads -Winvalid-pch -include wx_pch.h -IF:/msys2/mingw64/lib/wx/include/msw-unicode-3.1 -IF:/msys2/mingw64/include/wx-3.1 -mthreads -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMSW__ -DHAVE_W32API_H -D_UNICODE -fmessage-length=0 -pipe -D__WXDEBUG__ -D__GNUWIN32__ -D__WXMSW__ -DWXUSINGDLL -DwxUSE_UNICODE -DWX_PRECOMP -iquoteobj\Debug -Iobj\Debug -I. -I. -IInclude -c D:\code\wxOgl\Source\composit.cpp -o obj\Debug\Source\composit.o
D:\code\wxOgl\Source\composit.cpp: In member function 'virtual void wxCompositeShape::Copy(wxShape&)':
D:\code\wxOgl\Source\composit.cpp:363:31: error: cast from 'wxCompositeShape*' to 'long int' loses precision [-fpermissive]
  363 |   oglObjectCopyMapping.Append((long)this, &compositeCopy);
      |                               ^~~~~~~~~~
D:\code\wxOgl\Source\composit.cpp:381:33: error: cast from 'wxShape*' to 'long int' loses precision [-fpermissive]
  381 |     oglObjectCopyMapping.Append((long)object, newObject);
      |                                 ^~~~~~~~~~~~
D:\code\wxOgl\Source\composit.cpp:392:70: error: cast from 'wxShape*' to 'long int' loses precision [-fpermissive]
  392 |     wxShape *newConstraining = (wxShape *)(oglObjectCopyMapping.Find((long)constraint->m_constrainingObject)->GetData());
      |                                                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
D:\code\wxOgl\Source\composit.cpp:399:71: error: cast from 'wxShape*' to 'long int' loses precision [-fpermissive]
  399 |       wxShape *newConstrained = (wxShape *)(oglObjectCopyMapping.Find((long)constrainedObject)->GetData());
      |                                                                       ^~~~~~~~~~~~~~~~~~~~~~~
D:\code\wxOgl\Source\composit.cpp:422:47: error: cast from 'wxDivisionShape*' to 'long int' loses precision [-fpermissive]
  422 |     wxNode *node1 = oglObjectCopyMapping.Find((long)division);
      |                                               ^~~~~~~~~~~~~~
D:\code\wxOgl\Source\composit.cpp:428:44: error: cast from 'wxDivisionShape*' to 'long int' loses precision [-fpermissive]
  428 |       leftNode = oglObjectCopyMapping.Find((long)division->GetLeftSide());
      |                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
D:\code\wxOgl\Source\composit.cpp:430:43: error: cast from 'wxDivisionShape*' to 'long int' loses precision [-fpermissive]
  430 |       topNode = oglObjectCopyMapping.Find((long)division->GetTopSide());
      |                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
D:\code\wxOgl\Source\composit.cpp:432:45: error: cast from 'wxDivisionShape*' to 'long int' loses precision [-fpermissive]
  432 |       rightNode = oglObjectCopyMapping.Find((long)division->GetRightSide());
      |                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
D:\code\wxOgl\Source\composit.cpp:434:46: error: cast from 'wxDivisionShape*' to 'long int' loses precision [-fpermissive]
  434 |       bottomNode = oglObjectCopyMapping.Find((long)division->GetBottomSide());
      |                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Process terminated with status 1 (0 minute(s), 48 second(s))
9 error(s), 0 warning(s) (0 minute(s), 48 second(s))
It is related to the wxList issue, any one knows how to fix this issue?
User avatar
doublemax
Moderator
Moderator
Posts: 19102
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: ogledit Where is it and can it be built?

Post by doublemax »

This is just messy code that casts pointers to integers and put them into a wxList. Redefine that list to take void* (or a more specific type if that's possible) and get rid of all the ugly (long) casts.
Use the source, Luke!
PB
Part Of The Furniture
Part Of The Furniture
Posts: 4182
Joined: Sun Jan 03, 2010 5:45 pm

Re: ogledit Where is it and can it be built?

Post by PB »

ollydbg23 wrote: Thu Mar 31, 2022 2:28 pm https://github.com/PBfordev/ogltest

There is not such repo now, did you remove this repo?
As I do not think it is useful, I made it private. However, I have made it public again now.
ollydbg23
Super wx Problem Solver
Super wx Problem Solver
Posts: 438
Joined: Fri Dec 12, 2008 10:31 am

Re: ogledit Where is it and can it be built?

Post by ollydbg23 »

PB wrote: Thu Mar 31, 2022 3:55 pm
ollydbg23 wrote: Thu Mar 31, 2022 2:28 pm https://github.com/PBfordev/ogltest

There is not such repo now, did you remove this repo?
As I do not think it is useful, I made it private. However, I have made it public again now.
Thanks, I just drag your source codes to a wx project, and I got the same build error as from https://github.com/firodj/wxOgl
doublemax wrote: Thu Mar 31, 2022 3:25 pm This is just messy code that casts pointers to integers and put them into a wxList. Redefine that list to take void* (or a more specific type if that's possible) and get rid of all the ugly (long) casts.
The interesting is: both the code in https://github.com/firodj/wxOgl and https://github.com/PBfordev/ogltest, even VZ's https://github.com/vadz/grapheditor use the same pointer casting, but it looks like they don't cause the build error.

So, I guess there are some workaround. I just can't find the workaround yet. :(

EDIT:

Maybe, both of them are using the 32 bit compiler?
Post Reply