SDL_SetVideoMode问题
我正在使用 SDL_Image 在屏幕上显示 JPEG,但其显示分辨率存在一些问题。
我知道,如果我在调用 SDL_SetVideoMode 时将 0 传递给宽度、高度和位,则 SDL 将采用当前模式值,但是在我的情况下这些似乎是错误的。
我在带有自定义显示屏(1440x900 的 LED 屏幕)的嵌入式 Linux 系统上运行它,帧缓冲区为 1280x720。
已显示 JPEG,但似乎为 640x480,因此屏幕的大部分区域呈白色。当我使用 SDL_SetVideoMode 指定宽度和高度时,出现错误:
SDL_SetVideoMode:没有足够大的视频模式用于 1280x720
这是我正在使用的主要代码:
pImage = IMG_Load(file);
pScreen = SDL_SetVideoMode(0,0,0,SDL_ANYFORMAT);
SDL_BlitSurface(pImage,0,pScreen,0);
SDL_Flip(pScreen);
有人有任何想法/指针吗?
谢谢!
I'm using SDL_Image to display a JPEG on screen and having some issues with the resolution it's being displayed at.
I understand that if I pass 0 to width, height and bits when calling SDL_SetVideoMode that SDL takes the current modes values, however these seem to be wrong in my case.
I'm running this on an embedded linux system with a custom display (LED screen of 1440x900) and the framebuffer is 1280x720.
The JPEG is displayed but seems to be 640x480 and therefore leaves large parts of the screen white. When I specify width and height with SDL_SetVideoMode I get an error:
SDL_SetVideoMode: No video mode large enough for 1280x720
Here's the main code I'm using:
pImage = IMG_Load(file);
pScreen = SDL_SetVideoMode(0,0,0,SDL_ANYFORMAT);
SDL_BlitSurface(pImage,0,pScreen,0);
SDL_Flip(pScreen);
Anyone have any ideas/pointers?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是通过将自定义分辨率添加到 /etc/fb.modes 来解决的,如下所示:
仍然没有修复我上面评论中提到的 SDL_SetVideoMode 挂起...
This was fixed by adding the custom resolution to /etc/fb.modes like so:
Still no fix for the SDL_SetVideoMode hanging as referenced in my above comment...