Click here to Skip to main content
Rate this: bad
good
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 1:15am
RESMIS1.3K
Comments
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 OriginalGriff 400
1 Jochen Arndt 190
2 Richard MacCutchan 135
3 DamithSL 95
4 Garth J Lancaster 90
0 OriginalGriff 6,045
1 DamithSL 4,601
2 Maciej Los 4,032
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,220


Advertise | Privacy | Mobile
Web03 | 2.8.141220.1 | Last Updated 3 Jan 2013
Copyright © CodeProject, 1999-2014
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