MicBosi / VisualizationLibrary

Visualization Library is a C++ middleware for high-performance 2D and 3D graphics applications based on OpenGL 1.x-4.x supporting Windows, Linux and Mac OS X.
http://VisualizationLibrary.org
Other
339 stars 94 forks source link

Support wxWidgets 3 #172

Closed MicBosi closed 3 years ago

MicBosi commented 4 years ago

Support for wxWidgets 2.8 is now becoming obsolete. Would be nice to support 3.x as well. Contributions are welcome.

https://www.wxwidgets.org/downloads/

MicBosi commented 4 years ago

Related: https://github.com/MicBosi/VisualizationLibrary/issues/114

VirgiliuC commented 4 years ago

Hi Mic

Attached please find the vlWX Canvas zipped source files for wxWidgets 3.x.

Here is an example from our applications on how to use it:

...
#ifdef WXMSW_3.1

    wxGLAttributes glAttribs;
    wxGLContextAttrs contextAttribs;

    glAttribs.RGBA().Depth(24).DoubleBuffer().SampleBuffers(1).Samplers(8).EndList();

    if(use_OpenGL_Debug)
        contextAttribs.CompatibilityProfile().DebugCtx().EndList();
    else
        contextAttribs.CompatibilityProfile().OGLVersion(3,3).EndList();

    contextAttribs.SetNeedsARB(true);

//Create the canvas.
    mCanvas = new vlWX::WXGLCanvas(panGraphicsHost, NULL, wxID_ANY,
                                   panGraphicsHost->GetClientAreaOrigin(),
                                   panGraphicsHost->GetClientSize(),
                                   wxFULL_REPAINT_ON_RESIZE,
                                   &glAttribs, &contextAttribs);

#else // WXMSW < 3.1
...

where panGraphicsHost is a simple wxPanel hosting the VL canvas (the rendering surface).

We've been using VL + WX 3.x for quite a long while now and they work absolutely fine together. Hope that helps.

Regards, Virgiliu

vlWX.zip

MicBosi commented 4 years ago

Hey! 😃 Thanks @VirgiliuC!

MicBosi commented 3 years ago

Closing: https://github.com/MicBosi/VisualizationLibrary/commit/3fa9a8f68bed991fe53c19e8beb012171c4b2434