Skip to main content
GameDev.net gamedev.net
🔒 Locked

DirectDraw Clipping

Started by cb007sax Apr 14, 2002 at 7:20 PM 6 replies 350+ views
Original Post
cb007sax
cb007sax
Is there a way i can, in full screen mode, draw outside the screen, like in negative coordinates. Im doing an isometric map and i want to draw outside the screen so when i scroll it wont have blank spots. i know theres some clipper for direct draw but i thought it was only for windowed mode, im in full screen. what can i do?
cb007sax
cb007sax
so sad
Quantum
Quantum
You can use a clipper and just attach it to the whole window and it''ll do what you want.

  
LPDIRECTDRAWCLIPPER pDDClipper;
DirectDraw->CreateClipper(NULL, &pDDClipper, NULL);
pDDClipper->SetHWnd(NULL, hWnd);
DDSBack->SetClipper(pDDClipper);
Jason Zelos
Jason Zelos
You can also write all your tiles to a surface then blit a portion of that surface to the screen, you do not need to worry about clipping then. My engine(s) use this method to get around the tile offset problem.


for TileX = 0 to ScreenWidthInTiles+1
for TileY = 0 to ScreenHeightInTiles+1
TempSurface.Blit(TileX, TileY, TileSize, TileList[CurrentTileX+TileX][CurrentTileY+TileY])


and to blit to the backbuffer

BackBuffer.Blit(OffsetX, OffsetY, BackBufferSize, TempSurface)


Offset x and y are the view offsets from CurrentTileX and Y. Of course this p-code has no bounds checking.

If you use fine coords use :

CurrentTile = Position (int div) \ TileSize
Offset = Position modulus TileSize


,Jay
Big Sassy
Big Sassy
Yes, DirectDraw has a clipper for full-screen mode. Look at the documentation that comes with the SDK.
cb007sax
cb007sax
thanks guys trying out yoru solutions, i''ll tell u if they work
cb007sax
cb007sax
dd->CreateClipper(NULL, &pDDClipper, NULL);
pDDClipper->SetHWnd(NULL, Window);
backbuf->SetClipper(pDDClipper);

with that code i get blit errors, the clipper won''t work. ?? whats wrong

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.