Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Fatal errors

Author
Message
Dark Lord
18
Years of Service
User Offline
Joined: 19th Aug 2005
Location: Australia
Posted: 12th Sep 2005 08:57
WARNING: READ WHOLE MESSAGE BEFORE RUNNING MY PROGRAM

I have made a sphere object that rotates around on my screen as one of my first projects with the SDK.

This program has some really nasty errors:
1) If you press ESC,ALT-F4,F12 it stuffs up real bad, last time I pressed one of those keys I had to restart my PC.

Been in full screen mode doesnt help either it makes the errors even more catastrophic. If you are going to try pressing one of the above keys while running my program I advise taking it out of full screen mode by removing the 'dbSetWindowOff()' command.

I think the DarkGameSDK really hates the for loop, perhaps there is some kind of while loop that works better.
Mike Johnson
TGC Developer
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 12th Sep 2005 10:32
Can you repost your source code? I can't see anything when clicking on the source button.

Do you have a call to LoopSDK in your source? This is required to quit correctly for the window close button, alt - f4 etc.
Dark Lord
18
Years of Service
User Offline
Joined: 19th Aug 2005
Location: Australia
Posted: 13th Sep 2005 12:38
I did not call loop SDK

oh and here is the code... remember dont press any alt-f4 kindof buttons unless you really want to restart:

#include "DarkSDK.h"

// Function prototypes
void makeBob();

void DarkSDK ()
{
// Game entry point
// Set the window mode off
dbSetWindowOff();
dbSyncOn();
dbSyncRate(40);
dbSetDisplayMode(1024,768,32);
dbHideMouse();
// Create Bob
makeBob();

float angle = 0;
for(;
{
dbSetCursor(0,0);
if ( dbSpaceKey()==1 ) { break; }
angle = dbWrapValue(angle+1);
dbYRotateObject(1,angle);
dbSync();
}
}

/* Functions:
void makeBob() - creates the Bob object and textures it
*/
void makeBob ()
{
// Create a blank sphere object
dbMakeObjectSphere(1,100);
}
Dark Lord
18
Years of Service
User Offline
Joined: 19th Aug 2005
Location: Australia
Posted: 14th Sep 2005 02:58
Sorry that smiley wasnt supposed to be there
Dark Lord
18
Years of Service
User Offline
Joined: 19th Aug 2005
Location: Australia
Posted: 15th Sep 2005 02:32
I cut down the code size to this but when I press F12 I get this error: Unhandled exception at 0x7c901230. For some reason the standard DBPro exit keys arnt working.


// Include the DarkSDK header file
#include "DarkSDK.h"

// Main Loop
void DarkSDK ()
{
// Set-up sync
dbSyncOn();
dbSyncRate(40);

// This should *work* but doesnt
while(LoopSDK())
{
dbPrint("Looping");
dbSync();
}
}

If anyone could fix this problem then that would be very useful...
Kaiyodo
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: UK
Posted: 17th Sep 2005 00:28
When you're running under the debugger the F12 key is set up to cause a 'User Breakpoint', that's a feature of Visual Studio not a bug It stops execution immediately and pops you back into the debugger. If you run without debugging then F12 won't do anything.

As for the standard DBPro exit keys not working, I wasn't sure they did in the SDK? I've always added 'if(dbKeyState(1)) break;' inside my main while loop to get the ESC key to work.

Kaiyodo
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 22nd Sep 2005 23:54
The Dark SDK doesn't automagically handle the escape key.

You need to manually check for it. Note the change in the following code:


Cheers,
Ancient Lady
Dark Lord
18
Years of Service
User Offline
Joined: 19th Aug 2005
Location: Australia
Posted: 15th Oct 2005 01:25
Thankyou for the help people

Login to post a reply

Server time is: 2024-04-19 00:56:21
Your offset time is: 2024-04-19 00:56:21