Author Topic: My GLBasic Game crashes on my laptop die to play music when not in debug mode  (Read 2314 times)

Offline nabz32

  • Community Developer
  • Dr. Type
  • ******
  • Posts: 307
    • View Profile
Hi, I  recently compiled my game on a new laptop and the game crashes after compile
and won´t close unless I kill it using the task manager.

Tried to run it in debug mode and it crashes if no break points are set,
however if I set some breakpoints during the initialisation process the game starts up correctly,
however I get a random c0000005 crash somewhere during gameplay all the time.

I used a lenovo think pad T430 with an intel HD 4000 graphic chip for testing.
Could this be hardware related?
« Last Edit: 2017-Jan-04 by nabz32 »

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10697
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: My GLBasic Game crashes on my laptop
« Reply #1 on: 2016-Dec-15 »
Try to narrow down the bug and post code, please.

Gesendet von meinem GT-N7100


Offline dreamerman

  • Global Moderator
  • Dr. Type
  • *******
  • Posts: 288
    • View Profile
    • my personal website
Re: My GLBasic Game crashes on my laptop
« Reply #2 on: 2016-Dec-18 »
hm.. I have laptop with Intel HD (2500) + Win 8.1, all 2d projects (PolyVector, sprites, UseScreen), and small 3d test are working properly without problems.
Also Your Zombie Manor is working ok here, or it's some other project?
Are you using any c++ inline for extra OpenGL stuff or basic GLB functions, what OS version, any anti-virus software that could block app? (popup about that should be visible but you know how it is)
Check my source code editor for GLBasic - link

Offline nabz32

  • Community Developer
  • Dr. Type
  • ******
  • Posts: 307
    • View Profile
Re: My GLBasic Game crashes on my laptop
« Reply #3 on: 2017-Jan-03 »
Yes i have some inline code for light attenuation in my code:

Code: GLBasic [Select]
INLINE
    }; //namespace zumachen
        // Funktion definieren
    extern "C"{
        void __stdcall glLightf(int, int, float);
        void __stdcall glEnable( int );
        void __stdcall glDisable( int );
        }

        // Globale Konstanten
        #define GL_LIGHTING 0xB50
            #define GL_LIGHT0 0x4000
            #define GL_CONSTANT_ATTENUATION 0x1207
            #define GL_LINEAR_ATTENUATION 0x1208
            #define GL_QUADRATIC_ATTENUATION 0x1209
        // Namespace aufmachen
    namespace __GLBASIC__ {

ENDINLINE

FUNCTION glLightAttenuation: iLight%, konstant# , linear#, quadratic#
        INLINE
            glLightf(GL_LIGHT0+iLight , GL_CONSTANT_ATTENUATION,  konstant );
            glLightf(GL_LIGHT0+iLight , GL_LINEAR_ATTENUATION, linear);
            glLightf(GL_LIGHT0+iLight , GL_QUADRATIC_ATTENUATION, quadratic);
        ENDINLINE
ENDFUNCTION

FUNCTION switchAllLights: on%
        INLINE
                if( on == true ) glEnable(GL_LIGHTING) ;
                else glDisable(GL_LIGHTING);
        ENDINLINE
ENDFUNCTION

The memory usage of my project is roughly only at 64 mB when using low resolution textures.
I still have the preinstalled lenovo modified win7 on my laptop.
I´ll turn off all the special lenovo software and try it again.

Offline nabz32

  • Community Developer
  • Dr. Type
  • ******
  • Posts: 307
    • View Profile
Re: My GLBasic Game crashes on my laptop
« Reply #4 on: 2017-Jan-03 »
The project runs without problems in debug mode,
but when I compile it in normal mode there is only a black screen with nothing happening ( esc key won´t work for quitting anymore ).

After commenting out some lines, i found the reason for this behaviour is the PLAYMUSIC command.
In debug mode the music plays, but in normal compile mode the application hangs when calling PLAYMUSIC.
This is only happening when using my Lenovo Laptop. Very strange.
Are there some differences in how GLBasic will handle the PLAYMUSIC command when in debug mode compared to normal compile mode?

Edit: I used the playmusic command with mp3 files in this case.   
« Last Edit: 2017-Jan-03 by nabz32 »

Offline erico

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 4185
    • View Profile
    • Portfolio
I found better to use ogg music for pc, would that fix your problems?

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3611
    • View Profile
    • Space Fractal
im allways use mp3 here without issue, so its a qutie odd issue. have you tried to use full path?
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline nabz32

  • Community Developer
  • Dr. Type
  • ******
  • Posts: 307
    • View Profile
I use Full path, the Problem does not exist when i am on my Main pc.
When in debug mode the music play fine, maybe my ram on this laptop is faulty.
I will try it with ogg again.