Skip to content

Render OCCT view into a floating window#5

Open
MattiaMontanari wants to merge 1 commit intoeryar:mainfrom
MattiaMontanari:mm-offscreen
Open

Render OCCT view into a floating window#5
MattiaMontanari wants to merge 1 commit intoeryar:mainfrom
MattiaMontanari:mm-offscreen

Conversation

@MattiaMontanari
Copy link
Contributor

I'm trying to expand the example by moving the 3D interactive scene into a floating window. My understanding is that this requires OCC to render into a buffer and then imgui::Image (or similar functionality) to render the buffer into the GUI. However I'm getting stuck.

I've imported a new class adapted from here OffScreenRenderer. I initialise it but then I get an OpenGL error when I try to render the image into the buffer with ToPixMap.

@gkv311 maybe you can help me. Do you know if the error comes from the fact that an application cannot have on-screen and off-screen renderers at the same time? Or perhaps because I'm using a general Aspect_NeutralWindow for the off-screen renderer?

@MattiaMontanari MattiaMontanari changed the title Add OcctOffscreen class and call it before main loop Render OCCT view into a floating window Feb 9, 2025
$<$<CONFIG:Release>:${RELEASE_LIBS}>
)

# Debug environment variables (for Windows)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep this for Windows users?

Handle(Aspect_DisplayConnection) aDispConnection =
new Aspect_DisplayConnection();
Handle(OpenGl_GraphicDriver) aDriver =
new OpenGl_GraphicDriver(aDispConnection, true);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps the issue lies in the fact that you have initialized a new OpenGL context here once again, which might be conflicting with the existing one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments