将项目移植到我的笔记本电脑会导致黑屏
所以我正在使用 SDL 在 openGL 中制作一些东西。 我即将乘坐长途航班,但我似乎无法让该项目在我的笔记本电脑上运行。 我以前在我的笔记本电脑上使用过 SDL,所以我认为这是 openGL 的错。 该笔记本电脑运行 win xp pro,并配有 intel 945 显卡。 我尝试过更新驱动程序,但没有效果。 我正在使用的图像不可能是问题,因为我已经对其进行了编码,因此如果无法找到该文件,程序就会关闭。 另外,编译时我完全没有收到任何错误,它只是创建了窗口,而不是我的所有图像,我得到了白色。 只是白色。
有任何想法吗? 拜托,我不想在这个 5 小时的航班上变得疯狂 =/
So I'm making something in openGL using SDL. I'm about to take a long flight, and I can't seem to get the project to work on my laptop. I've used SDL on my laptop before, so I'm left thinking it is openGL's fault. The laptop is on win xp pro, and has an intel 945 graphics "card." I've tried updating the drivers, but to no avail. The images I'm using can't be the problem because I have it coded so the program closes if it can't locate the file. Also, I get no errors at all when compiling, it just creates the window, and instead of all my images, I get white. Just white.
Any ideas? Please, I don't want to be on this 5 hr flight and go stir crazy =/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能需要提供更多信息,但我猜测您的纹理无效。 当存在纹理问题时,OpenGL 会绘制白色。 可能的原因是...
图像尺寸大于图形芯片的最大纹理尺寸
图像不是 2 的幂且该卡不支持矩形纹理。
您已耗尽纹理内存。
图形芯片不支持您的纹理环境,例如。 不支持的格式。
程序员错误。
尝试在单个四边形上绘制单个 128x128 纹理,颜色为紫色,透明颜色为橙色。 这将消除上述大部分问题,并为您提供一些调试工具。
You might need to provide a bit more info, but at a guess I'd say your textures are invalid. OpenGL draws white when there is a texture problem. Possible reasons are...
Image size is bigger than the max texture size of the graphics chip
Image isn't power of 2 and the card doesn't support rectangular textures.
You have run out of texture memory.
Your texture env isn't supported by the graphics chip, eg. unsupported format.
You aren't drawing what you think you are drawing, eg a white quad on a white background, in the position you think you are drawing it, ie you're looking in the wrong direction.
Programmer error.
Try drawing a single 128x128 texture on a single quad with a glcolor of purple and a clear colour of orange. This will eliminate most of the above problems and give you something to debug.