SDL_SetVideoMode问题

发布于 2024-09-28 07:09:44 字数 545 浏览 0 评论 0原文

我正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一场春暖 2024-10-05 07:09:44

这是通过将自定义分辨率添加到 /etc/fb.modes 来解决的,如下所示:

mode "1280x720-59"
    # D: 172.00 MHz, H: 82.700 kHz, V: 66.00 Hz
    geometry 1280 720 1280 720 16
    timings 13000 300 70 26 3 80 5
endmode

仍然没有修复我上面评论中提到的 SDL_SetVideoMode 挂起...

This was fixed by adding the custom resolution to /etc/fb.modes like so:

mode "1280x720-59"
    # D: 172.00 MHz, H: 82.700 kHz, V: 66.00 Hz
    geometry 1280 720 1280 720 16
    timings 13000 300 70 26 3 80 5
endmode

Still no fix for the SDL_SetVideoMode hanging as referenced in my above comment...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文