本想通过 SDL_CreateWindow 创建一个 超大窗口(2000,800). 按原比例显示一张图片. 但是一旦设置宽度或高度超过屏幕分辨率.就参数无效,变成屏幕大小窗口.
通过跟踪SDL 代码: SDL_windowswindow.c SetupWindowData函数中有如下代码:
/* We tried to create a window larger than the desktop and Windows didn't allow it. Override! */
WIN_SetWindowPositionInternal(_this, window, SWP_NOCOPYBITS | SWP_NOZORDER | SWP_NOACTIVATE );
WIN_SetWindowPositionInternal(_this, window, SWP_NOCOPYBITS | SWP_NOZORDER | SWP_NOACTIVATE );
一旦通过这个方法修改:
此时系统所以调用 WIN_SetWindowPositionInternal的函数都要修改,否则还是无效, 类似:
SDL_SetWindowSize(screen, 2000, 800); 调用导致无效.
通过下载最新的SDL 2.0.4 发现这里还是未做修改,不知是否是个bug.
参考;
http://stackoverflow.com/questions/445893/create-window-larger-than-desktop-display-resolution