OpenGL程序适用于GL 3.x但不适用于4.x.

时间:2013-02-15 00:51:34

标签: visual-studio-2010 opengl hardware

为了解释这个问题,我是openGL和Visual Studio的新手,所以我可能会遗漏一些相当明显的东西。我正在关注一个openGL教程,该教程应该设置一个基本窗口,显示有关您正在使用的openGL版本的信息。

Tutorial | Setup

作为参考,我在NVidia GTX670m上运行64位Windows 7上的VS2010。当我指定样板程序在openGL v3.x中运行时。它运行得很好。当我指定它在v4.x中运行时。它崩溃了以下输出(问题继续之后):

'Engine.exe': Loaded 'D:\Engine\Engine\Release\Engine.exe', Symbols loaded.
'Engine.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Symbols loaded (source information stripped).
'Engine.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Symbols loaded (source information stripped).
'Engine.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Symbols loaded (source information stripped).
'Engine.exe': Loaded 'C:\Windows\SysWOW64\freeglut.dll', Binary was not built with debug information.
'Engine.exe': Loaded 'C:\Windows\SysWOW64\user32.dll', Symbols loaded (source information stripped).
'Engine.exe': Loaded 'C:\Windows\SysWOW64\gdi32.dll', Symbols loaded (source information stripped).
'Engine.exe': Loaded 'C:\Windows\SysWOW64\lpk.dll', Symbols loaded (source information stripped).
'Engine.exe': Loaded 'C:\Windows\SysWOW64\usp10.dll', Symbols loaded (source information stripped).
'Engine.exe': Loaded 'C:\Windows\SysWOW64\msvcrt.dll', Symbols loaded (source information stripped).
'Engine.exe': Loaded 'C:\Windows\SysWOW64\advapi32.dll', Symbols loaded (source information stripped).
'Engine.exe': Loaded 'C:\Windows\SysWOW64\sechost.dll', Symbols loaded (source information stripped).
'Engine.exe': Loaded 'C:\Windows\SysWOW64\rpcrt4.dll', Symbols loaded (source information stripped).
'Engine.exe': Loaded 'C:\Windows\SysWOW64\sspicli.dll', Symbols loaded (source information stripped).
'Engine.exe': Loaded 'C:\Windows\SysWOW64\cryptbase.dll', Symbols loaded (source information stripped).
'Engine.exe': Loaded 'C:\Windows\SysWOW64\opengl32.dll', Symbols loaded (source information stripped).
'Engine.exe': Loaded 'C:\Windows\SysWOW64\glu32.dll', Symbols loaded (source information stripped).
'Engine.exe': Loaded 'C:\Windows\SysWOW64\ddraw.dll', Symbols loaded (source information stripped).
'Engine.exe': Loaded 'C:\Windows\SysWOW64\dciman32.dll', Symbols loaded (source information stripped).
'Engine.exe': Loaded 'C:\Windows\SysWOW64\setupapi.dll', Symbols loaded (source information stripped).
'Engine.exe': Loaded 'C:\Windows\SysWOW64\cfgmgr32.dll', Symbols loaded (source information stripped).
'Engine.exe': Loaded 'C:\Windows\SysWOW64\oleaut32.dll', Symbols loaded (source information stripped).
'Engine.exe': Loaded 'C:\Windows\SysWOW64\ole32.dll', Symbols loaded.
'Engine.exe': Loaded 'C:\Windows\SysWOW64\devobj.dll', Symbols loaded (source information stripped).
'Engine.exe': Loaded 'C:\Windows\SysWOW64\dwmapi.dll', Symbols loaded (source information stripped).
'Engine.exe': Loaded 'C:\Windows\SysWOW64\winmm.dll', Symbols loaded (source information stripped).
'Engine.exe': Loaded 'C:\Windows\SysWOW64\msvcr100.dll', Symbols loaded (source information stripped).
'Engine.exe': Loaded 'C:\Windows\SysWOW64\imm32.dll', Symbols loaded (source information stripped).
'Engine.exe': Loaded 'C:\Windows\SysWOW64\msctf.dll', Symbols loaded (source information stripped).
'Engine.exe': Loaded 'C:\Windows\SysWOW64\nvinit.dll', Cannot find or open the PDB file
'Engine.exe': Loaded 'C:\Windows\SysWOW64\uxtheme.dll', Symbols loaded (source information stripped).
'Engine.exe': Loaded 'C:\Program Files (x86)\Common Files\Spigot\Search Settings\wth159.dll', Cannot find or open the PDB file
'Engine.exe': Loaded 'C:\Windows\SysWOW64\psapi.dll', Symbols loaded (source information stripped).
'Engine.exe': Loaded 'C:\Windows\SysWOW64\ig7icd32.dll', Cannot find or open the PDB file
'Engine.exe': Loaded 'C:\Windows\SysWOW64\version.dll', Symbols loaded (source information stripped).
'Engine.exe': Unloaded 'C:\Windows\SysWOW64\version.dll'
The program '[7332] Engine.exe: Native' has exited with code 1 (0x1).

在Google上搜索此问题时,我看到有人建议在调试菜单中从MS服务器中提取符号,然后关闭将警告视为错误的选项。我试过了两个,但程序仍然崩溃。即使没有,我觉得我还是应该调查原因。

假设: NVidia将GTX 670列为支持openGL 4.x.它没有明确表示支持670m,但我假设如果常规670是 - 移动版本是。

问题:如果程序在openGL v3.x中运行正常,我的硬件应该支持openGL v4.x,那导致程序崩溃的原因是什么?

2 个答案:

答案 0 :(得分:1)

你的程序没有崩溃。某些逻辑中的条件可能尚未满足,导致运行不同的分支,但它确实运行完毕。

您发布的所有输出都与您的“问题”没有任何关系,但最后一行除外,这表示代码输入了以ExitProcess(1)return EXIT_FAILURE结尾的分支。

答案 1 :(得分:0)

感谢大家的帮助。我最终在另一台机器上运行它并没有遇到问题。我的笔记本电脑的规格或freeglut

都有问题