Click here to Skip to main content
11,796,774 members (66,919 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: MFC OpenGL
I was running a Marching Cubes implementation which creates a set of vertices which are stored in an std::vector. The vertices are rendered using OpenGL displaylists. The application seems to work correctly when running within the Visual Studio IDE. But on running the executable directly, the vertices are not rendered when the application was minimized or the focus was altered in some way. The vertices are generated nevertheless, as they can be exported and viewed. The application has a GUI made in MFC. The same issue was observed using VBOs instead of displaylists, so displaylist does not seem to be the lone problem. Please provide your insights on this issue.
Posted 3-Jan-13 0:15am
Santhosh G_ at 9-Jan-13 13:42pm
Try to use BYTE buffer to hold the vertex information.

"But on running the executable directly, the vertices are not rendered when the application was minimized or the focus was altered in some way." It means rendering is not happening after minimize, is it correct ?

What is the behavior while drawing with glBegin() glEnd() primitives.
RESMIS at 10-Jan-13 22:39pm
The vertex data has floating point dimensions and BYTE seems insufficient. The best I could do was use float.

Yes, rendering with displaylists is not happening on losing focus. The triangle data is generated and few variables are updated as I use some of them to find the center of mass of the rendered object. This seems to happen even after one or two renderings were done without disturbing the focus but on a new render with loss of focus, the old displaylists stay but with new center of mass showing that the old variables have been updated.

As you suggested, I tried the Immediate mode rendering and it does work even after losing focus. But it makes the rendering incredibly slow which was the reason I started using displaylists in the first place.

So, the problem seems to be in the rendering part but I can't pinpoint it to some specific code. Is it because it is working on a large amount of data at once that it is failing?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Maciej Los 480
1 Abhinav S 369
2 OriginalGriff 360
3 CPallini 285
4 KrunalRohit 249
0 OriginalGriff 2,032
1 Maciej Los 1,725
2 KrunalRohit 1,310
3 CPallini 1,055
4 ppolymorphe 883

Advertise | Privacy | Mobile
Web01 | 2.8.151002.1 | Last Updated 3 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100