| [ Return to Bugs & Features | Roadmap 2.0 | Post Text | Post File ]
STR #1394
Application: | FLTK Library |
Status: | 5 - New |
Priority: | 3 - Moderate, e.g. unable to compile the software |
Scope: | 2 - Specific to an operating system |
Subsystem: | Unassigned |
Summary: | Adding GlWindow to a window after show() is called causes crash |
Version: | 2.0-current |
Created By: | greg.ercolano |
Assigned To: | Unassigned |
Fix Version: | Unassigned |
Update Notification: | |
Trouble Report Files:
[ Post File ]No files
Trouble Report Comments:
[ Post Text ]
|
#1 | greg.ercolano 12:04 Aug 19, 2006 |
| This is under fedora3, but might be under other OS's too.
-------- snip #include <fltk/run.h> #include <fltk/GlWindow.h> #include <fltk/Window.h> #include <fltk/gl.h> class MyGlWindow : public fltk::GlWindow { void draw() { if (!valid()) { valid(1); glLoadIdentity(); glViewport(0,0,w(),h()); } glClearColor(1.0,0.0,0.0,1.0); glClear(GL_COLOR_BUFFER_BIT); } public: MyGlWindow(int x, int y, int w, int h) : fltk::GlWindow(x,y,w,h) { } }; int main() { fltk::Window fig(400,400); fig.resizable(fig); fig.show(); // (A) fig.begin(); MyGlWindow mygl(0,0,400,400); mygl.end(); fig.end(); //fig.show(); // (B) fltk::run(); } -------- snip
FLTK crashes if you uncomment (A), and comment (B). It runs fine if you switch to comment (A) and *uncomment* (B).
So it seems if one tries to create the GL window after calling show(), you'll get the crash. Hopefully it wouldn't be a problem to do this, as I could see where one wants to dynamically add a GlWindow to a Window, after the Window has been created and show()n. (See Herbert Egger's 8/18/06 post on fltk.opengl) | |
[ Return to Bugs & Features | Post Text | Post File ]
|
| |