GLUT crash
  • MDW
  • Order of the Butterfly
    Order of the Butterfly
    MDW
    Posts: 453 from 2003/7/26
    From: Wroclaw/Poland
    I don't use GLUT but now I want to create an example as simple as possible. In this case GLUT is very useful. Unfortunately I noticed that each application which uses GLUT crashes at exit. I have an old example which was working correctly in past. Now crashes always. I have no idea how to correctly implement a GLUT application without the crash. :(
    Is it a bug in GLUT?

    [ Edited by MDW 13.07.2023 - 17:44 ]
  • »13.07.23 - 16:44
    Profile Visit Website
  • MorphOS Developer
    bigfoot
    Posts: 508 from 2003/4/11
    It might be my bug. With the TinyGL updates I did, I also made a fresh MorphOS port of FreeGLUT to go with the example applications I made, so things have definitely changed on the MorphOS side. Can you show me a log of the crash you get?
    I rarely log in to MorphZone which means that I often miss private messages sent on here. If you wish to contact me, please email me at [username]@asgaard.morphos-team.net, where [username] is my username here on MorphZone.
  • »14.07.23 - 11:25
    Profile Visit Website
  • MDW
  • Order of the Butterfly
    Order of the Butterfly
    MDW
    Posts: 453 from 2003/7/26
    From: Wroclaw/Poland
    Quote:

    bigfoot wrote:
    It might be my bug. With the TinyGL updates I did, I also made a fresh MorphOS port of FreeGLUT to go with the example applications I made, so things have definitely changed on the MorphOS side. Can you show me a log of the crash you get?

    I have sent you mail with (subject “glReadPixels again”) with attached simple example program which after build with the latest SDK always crashes after press Esc. I also noticed that now glReadPixels saves black screen instead of screenshot. This is the same test which was working well after your fix of the function in March 2022.
  • »14.07.23 - 12:44
    Profile Visit Website
  • MorphOS Developer
    bigfoot
    Posts: 508 from 2003/4/11
    Ah, I didn't realise those two were related.

    I've found the problem. I'll fix it soon. In the meanwhile, you can work around the bug by modifying your linking. Either link libglut before libGL, or completely omit libGL, ie, change the following:

    Code:
    -lGL -lglut


    To

    Code:
    -lglut -lGL


    That should avoid the crash until I get this issue sorted out.
    I rarely log in to MorphZone which means that I often miss private messages sent on here. If you wish to contact me, please email me at [username]@asgaard.morphos-team.net, where [username] is my username here on MorphZone.
  • »14.07.23 - 14:10
    Profile Visit Website
  • MDW
  • Order of the Butterfly
    Order of the Butterfly
    MDW
    Posts: 453 from 2003/7/26
    From: Wroclaw/Poland
    Quote:

    bigfoot wrote:
    I've found the problem. I'll fix it soon. In the meanwhile, you can work around the bug by modifying your linking. Either link libglut before libGL, or completely omit libGL, ie, change the following:

    Code:
    -lGL -lglut


    To

    Code:
    -lglut -lGL


    That should avoid the crash until I get this issue sorted out.


    Yes, it works. Now the test application doesn't crash at the end. Thank you for the solution!

    The crash still occurs if I use:
    Code:
    glutDestroyWindow(glutGetWindow());

    or just:
    Code:
    exit(0);


    However from my test point of view it is not a problem.
  • »14.07.23 - 16:41
    Profile Visit Website
  • MorphOS Developer
    bigfoot
    Posts: 508 from 2003/4/11
    That's weird. That's not happening for me. Any chance I could get you to supply me with a log? :P
    I rarely log in to MorphZone which means that I often miss private messages sent on here. If you wish to contact me, please email me at [username]@asgaard.morphos-team.net, where [username] is my username here on MorphZone.
  • »14.07.23 - 16:57
    Profile Visit Website
  • MDW
  • Order of the Butterfly
    Order of the Butterfly
    MDW
    Posts: 453 from 2003/7/26
    From: Wroclaw/Poland
    ---

    [ Edited by MDW 18.07.2023 - 21:50 ]
  • »18.07.23 - 20:24
    Profile Visit Website