Hello,
I'm writing a game engine for mobile devices, and I'm trying to support multiple resolutions. The game world can be much larger than the screen, so I'm using a clipper to create a viewport on the world.
My device has a resolution of 240x320. When I set the viewport to 240x320 and my world to 240x320, all is fine. I can slide the world outside the screen without problems. However, when my viewport is 220x320 and my world is 240x320, blitting fails with DDERR_INVALIDPARAMS
when the surface moves outside the screen on the left:
(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)
Moving the surface outside the screen on the right works fine, the surface is clipped correctly.
How can I clip surfaces on my backbuffer when the surface is larger than the backbuffer?
Thanks in advance