繁体   English   中英

DirectDraw:如果曲面大于后缓冲区,则剪切将失败

[英]DirectDraw: Clipping fails if surface is larger than backbuffer

我正在为移动设备编写游戏引擎,并且试图支持多种分辨率。 游戏世界可能比屏幕大得多,因此我正在使用剪切器在世界上创建视口。

我的设备的分辨率为240x320。 当我将视口设置为240x320并将世界设置为240x320时,一切都很好。 我可以毫无问题地将屏幕滑出屏幕。 但是,当我的视口是220x320且我的世界是240x320时,当曲面移到左侧屏幕的外部时,使用DDERR_INVALIDPARAMS失败:

(09:02:06) - INFO - ERROR! DirectDraw: One or more of the passed parameters are incorrect. (DDERR_INVALIDPARAMS)
(09:02:06) - INFO - ERROR! Couldn't copy to screen. (RECT: -1, 0, 239, 320) (line 125 in file .\src\SurfaceDirectDraw.cpp)
(09:02:06) - INFO - Dimensions: (0, 0, 240, 320)
(09:02:06) - INFO - ERROR! DirectDraw: One or more of the passed parameters are incorrect. (DDERR_INVALIDPARAMS)
(09:02:06) - INFO - ERROR! Couldn't copy to screen. (RECT: -2, 0, 238, 320) (line 125 in file .\src\SurfaceDirectDraw.cpp)
(09:02:06) - INFO - Dimensions: (0, 0, 240, 320)
(09:02:06) - INFO - ERROR! DirectDraw: One or more of the passed parameters are incorrect. (DDERR_INVALIDPARAMS)
(09:02:06) - INFO - ERROR! Couldn't copy to screen. (RECT: -3, 0, 237, 320) (line 125 in file .\src\SurfaceDirectDraw.cpp)
(09:02:06) - INFO - Dimensions: (0, 0, 240, 320)

将表面移到屏幕右侧的右边可以正常工作,正确修剪了表面。

当表面大于后缓冲时,如何在后缓冲上修剪表面?

提前致谢

我真的不知道即时消息是否正确(DirectDraw多年未使用),但我猜想它与负裁剪有关。 因此,也许您应该将0/0设置为最左/上的位置,以免得到负数。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM