Game Development Community

Infinite loop when no gfx HW accelerator is found

by Mikael "soho" · in Torque Game Engine · 10/30/2004 (2:45 pm) · 12 replies

I ran a unmodified torqueDemo.exe in the example directory on my laptop. This resulted in a infinite loop where it just kept on dumping info to the console.log file (atleast I think its an infinite loop, the program just sits there).

Might be an idea to add some kind of warning if no hardware accelerator is found and fail the program?

Here is some from the console.log file, the whole file is about 24mb:

//-------------------------- 10/30/2004 -- 17:11:51 -----
Processor Init:
Intel Pentium III, ~1.00 Ghz
(timed at roughly 997 Mhz)
FPU detected
MMX detected
SSE detected

Math Init:
Installing Standard C extensions
Installing Assembly extensions
Installing FPU extensions
Installing MMX extensions
Installing SSE extensions

Input Init:
keyboard0 input device created.
mouse0 input device created.
DirectInput enabled.

--------- Loading MODS ---------
Loading compiled script starter.fps/main.cs.
Loading compiled script common/main.cs.
Missing file: common/defaults.cs!
Loading compiled script starter.fps/client/defaults.cs.
Loading compiled script starter.fps/server/defaults.cs.
Missing file: starter.fps/client/prefs.cs!
Missing file: starter.fps/server/prefs.cs!

--------- Parsing Arguments ---------

--------- Initializing MOD: Common ---------
Loading compiled script common/client/canvas.cs.
Loading compiled script common/client/audio.cs.

--------- Initializing MOD: FPS Starter Kit ---------
Loading compiled script starter.fps/client/init.cs.
Loading compiled script starter.fps/server/init.cs.
Loading compiled script starter.fps/data/init.cs.
Loading compiled script starter.fps/data/terrains/grassland/propertyMap.cs.
Missing file: starter.fps/data/terrains/scorched/propertyMap.cs!

--------- Initializing MOD: FPS Starter Kit: Server ---------
Loading compiled script common/server/audio.cs.
Loading compiled script common/server/server.cs.
Loading compiled script common/server/message.cs.
Loading compiled script common/server/commands.cs.
Loading compiled script common/server/missionInfo.cs.
Loading compiled script common/server/missionLoad.cs.
Loading compiled script common/server/missionDownload.cs.
Loading compiled script common/server/clientConnection.cs.
Loading compiled script common/server/kickban.cs.
Loading compiled script common/server/game.cs.
Loading compiled script starter.fps/server/scripts/commands.cs.
Loading compiled script starter.fps/server/scripts/centerPrint.cs.
Loading compiled script starter.fps/server/scripts/game.cs.

--------- Initializing MOD: FPS Starter Kit: Client ---------
Loading compiled script starter.fps/client/ui/customProfiles.cs.
Loading compiled script common/client/message.cs.
Loading compiled script common/client/mission.cs.
Loading compiled script common/client/missionDownload.cs.
Loading compiled script common/client/actionMap.cs.
Loading compiled script common/editor/editor.cs.
Loading compiled script common/editor/particleEditor.cs.
Loading compiled script common/client/scriptDoc.cs.
Video Init:
Accelerated OpenGL display device not detected.
Accelerated D3D device not detected.
Voodoo 2 display device not detected.

"OpenGL" display device not found!
"OpenGL" display device not found!
"D3D" display device not found!
"Voodoo2" display device not found!
Loading compiled script common/ui/defaultProfiles.cs.
Loading compiled script common/ui/GuiEditorGui.gui.

#1
10/30/2004 (2:47 pm)
This shouldn't happen: glGenTextures
This shouldn't happen: glBindTexture
This shouldn't happen: glTexImage2D
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
This shouldn't happen: glGenTextures
This shouldn't happen: glBindTexture
This shouldn't happen: glTexImage2D
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
This shouldn't happen: glGenTextures
This shouldn't happen: glBindTexture
This shouldn't happen: glTexImage2D
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
This shouldn't happen: glGenTextures
This shouldn't happen: glBindTexture
This shouldn't happen: glTexImage2D
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
This shouldn't happen: glGenTextures
This shouldn't happen: glBindTexture
This shouldn't happen: glTexImage2D
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
This shouldn't happen: glGenTextures
This shouldn't happen: glBindTexture
This shouldn't happen: glTexImage2D
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
This shouldn't happen: glGenTextures
This shouldn't happen: glBindTexture
This shouldn't happen: glTexImage2D
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
Loading compiled script common/ui/ConsoleDlg.gui.
This shouldn't happen: glGenTextures
This shouldn't happen: glBindTexture
This shouldn't happen: glTexImage2D
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
Loading compiled script common/ui/InspectDlg.gui.
Loading compiled script common/ui/InspectAddFieldDlg.gui.
Loading compiled script common/ui/LoadFileDlg.gui.
Loading compiled script common/ui/SaveFileDlg.gui.
Loading compiled script common/ui/MessageBoxOkDlg.gui.
Loading compiled script common/ui/MessageBoxYesNoDlg.gui.
Loading compiled script common/ui/MessageBoxOKCancelDlg.gui.
Loading compiled script common/ui/MessagePopupDlg.gui.
Loading compiled script common/ui/HelpDlg.gui.
Loading compiled script common/ui/RecordingsDlg.gui.
Loading compiled script common/ui/NetGraphGui.gui.
Loading compiled script common/client/metrics.cs.
Loading compiled script common/ui/FrameOverlayGui.gui.
Loading compiled script common/client/messageBox.cs.
Loading compiled script common/client/screenshot.cs.
Loading compiled script common/client/cursor.cs.
Loading compiled script common/client/help.cs.
Loading compiled script common/client/recordings.cs.

OpenAL Driver Init:
OpenAL
Vendor: Creative Labs Inc.
Version: OpenAL 1.0
Renderer: Software
Extensions: EAX 2.0, EAX 3.0, EAX Unified, and EAX-AC3
#2
10/30/2004 (2:48 pm)
Loading compiled script starter.fps/client/scripts/audioProfiles.cs.
Loading compiled script starter.fps/client/ui/defaultGameProfiles.cs.
Loading compiled script starter.fps/client/ui/PlayGui.gui.
Loading compiled script starter.fps/client/ui/ChatHud.gui.
This shouldn't happen: glGenTextures
This shouldn't happen: glBindTexture
This shouldn't happen: glTexImage2D
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
This shouldn't happen: glGenTextures
This shouldn't happen: glBindTexture
This shouldn't happen: glTexImage2D
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
Loading compiled script starter.fps/client/ui/playerList.gui.
This shouldn't happen: glGenTextures
This shouldn't happen: glBindTexture
This shouldn't happen: glTexImage2D
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
Loading compiled script starter.fps/client/ui/mainMenuGui.gui.
Missing file: starter.fps/client/ui/QuitGui.gui!
Loading compiled script starter.fps/client/ui/aboutDlg.gui.
Loading compiled script starter.fps/client/ui/startMissionGui.gui.
This shouldn't happen: glGenTextures
This shouldn't happen: glBindTexture
This shouldn't happen: glTexImage2D
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
Loading compiled script starter.fps/client/ui/joinServerGui.gui.
This shouldn't happen: glGenTextures
This shouldn't happen: glBindTexture
This shouldn't happen: glTexImage2D
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
This shouldn't happen: glGenTextures
This shouldn't happen: glBindTexture
This shouldn't happen: glTexImage2D
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
Loading compiled script starter.fps/client/ui/loadingGui.gui.
This shouldn't happen: glGenTextures
This shouldn't happen: glBindTexture
This shouldn't happen: glTexImage2D
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
#3
10/30/2004 (2:48 pm)
Loading compiled script starter.fps/client/ui/endGameGui.gui.
Loading compiled script starter.fps/client/ui/optionsDlg.gui.
Loading compiled script starter.fps/client/ui/remapDlg.gui.
Loading compiled script starter.fps/client/ui/StartupGui.gui.
Loading compiled script starter.fps/client/scripts/client.cs.
Loading compiled script starter.fps/client/scripts/game.cs.
Loading compiled script starter.fps/client/scripts/missionDownload.cs.
Loading compiled script starter.fps/client/scripts/serverConnection.cs.
Loading compiled script starter.fps/client/scripts/playerList.cs.
Loading compiled script starter.fps/client/scripts/loadingGui.cs.
Loading compiled script starter.fps/client/scripts/optionsDlg.cs.
Loading compiled script starter.fps/client/scripts/chatHud.cs.
Loading compiled script starter.fps/client/scripts/messageHud.cs.
Loading compiled script starter.fps/client/scripts/playGui.cs.
Loading compiled script starter.fps/client/scripts/centerPrint.cs.
Loading compiled script starter.fps/client/scripts/default.bind.cs.
Missing file: starter.fps/client/config.cs!
Binding server port to default IP
UDP initialized on port 0
This shouldn't happen: glGenTextures
This shouldn't happen: glBindTexture
This shouldn't happen: glTexImage2D
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
Unable to locate audio profile 'AudioStartup'
Engine initialized...
This shouldn't happen: glDrawBuffer
This shouldn't happen: glFinish
This shouldn't happen: glMatrixMode
This shouldn't happen: glLoadIdentity
This shouldn't happen: glOrtho
This shouldn't happen: glTranslatef
This shouldn't happen: glMatrixMode
This shouldn't happen: glLoadIdentity
This shouldn't happen: glViewport
This shouldn't happen: glDisable
This shouldn't happen: glDisable
This shouldn't happen: glEnable
This shouldn't happen: glBindTexture
This shouldn't happen: glTexEnvi
This shouldn't happen: glEnable
This shouldn't happen: glBlendFunc
This shouldn't happen: glColor4ub
This shouldn't happen: glBegin
This shouldn't happen: glTexCoord2f
This shouldn't happen: glVertex2f
This shouldn't happen: glTexCoord2f
This shouldn't happen: glVertex2f
This shouldn't happen: glTexCoord2f
This shouldn't happen: glVertex2f
This shouldn't happen: glTexCoord2f
This shouldn't happen: glVertex2f
This shouldn't happen: glEnd
This shouldn't happen: glDisable
This shouldn't happen: glDisable
This shouldn't happen: glEnable
This shouldn't happen: glBlendFunc
This shouldn't happen: glDisable
This shouldn't happen: glColor4ub
This shouldn't happen: glRecti
This shouldn't happen: glMatrixMode
This shouldn't happen: glLoadIdentity
This shouldn't happen: glOrtho
This shouldn't happen: glTranslatef
This shouldn't happen: glMatrixMode
This shouldn't happen: glLoadIdentity
This shouldn't happen: glViewport
This shouldn't happen: glGenTextures
This shouldn't happen: glBindTexture
This shouldn't happen: glTexImage2D
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
This shouldn't happen: glTexParameteri
This shouldn't happen: glDisable
This shouldn't happen: glEnable
This shouldn't happen: glBindTexture
This shouldn't happen: glTexEnvi
This shouldn't happen: glEnable
This shouldn't happen: glBlendFunc
This shouldn't happen: glColor4ub
#4
10/30/2004 (3:45 pm)
Hmmm... Good test, that. And yay... another "this error should not occur" error message.

Anybody have any thoughts on how to best fix this?
#5
10/30/2004 (5:33 pm)
I dont know where in the code to put such a thing, but just set a boolean variable like displayDeviceFound that is set true once a valid device is found, and checked before entering any main loops. If its still false, then just dump an error message to the user informing that no valid display devices were found, and then halt the program.
#6
10/31/2004 (9:22 am)
That's not an infinite loop. That's the rendering code. (which is technically a kind of infinite loop.

"This shouldn't happen: glcall" means that it tried to dynamically load that GL function pointer, but couldn't find it. The default function for ever GL call is actually a echo that says "This shouldn't happen: glCall". So what you are seeing is every gl call that Torque makes.
#7
10/31/2004 (9:36 am)
Guess that means we ought to put a better error message in there. Since it obviously _is_ happening...
#8
10/31/2004 (10:12 am)
Maybe bail when the device init stuff returns whatever code that leads to the OpenGL/d3d/voodoo2 device not found ?
By bail, I mean gracefully CTD, erh, exit to desktop :)
With a nice error message about being needing a new graphic card, etc.
Oh, isn't it time we ripped the V2 code out, and all its interesting side effects on the rendering code ? ;)
#9
11/28/2004 (1:59 pm)
I'm having that same problem.
I give the command line options: -game -autoVideo -windowed

And i get:

Video Init:
Accelerated OpenGL display device not detected.
Accelerated D3D device not detected.
Voodoo 2 display device not detected.

"" display device not found!
"OpenGL" display device not found!
"D3D" display device not found!
"Voodoo2" display device not found!
Loading compiled script common/ui/defaultProfiles.cs.
Loading compiled script common/ui/GuiEditorGui.gui.
This shouldn't happen: glGenTextures

Then about 10 megs of "This shouldn't happen"s.


So..... How do i fix it? :)
#10
11/28/2004 (2:10 pm)
Install OGL drivers? You could probably hack up some sort of global counter that would get incremented every time a valid driver is found. If it's zero, have the script pop up an error and quit out.

This is on my todo list for 1.4, but I'd suggest implementing a workaround for now.
#11
11/28/2004 (4:53 pm)
Yeah thx.. I thought my drivers were fine since some games ran fine...I was wrong :]

Now i just have to find some good ones...
#12
11/28/2004 (8:44 pm)
If you can't run MarbleBlast on it (free demo from our product page) then you probably don't have up to date drivers...