Clipping problem...

Started by
4 comments, last by Kavos 23 years, 9 months ago
In my tile drawing engine i''m using the clipper to clip tiles, so far so good. I want to put a interface bar at the bottom of the screen so i change the clip list accordingly, hence the tiles are clipped at the bottom 1/4 of the screen, still so far so good but now I have a problem... How would a go about blitting the interface image to the screen if the clipper will clip it? Yes I know I could just overlap the interface bar over the tiles but thats wasteful, Thanks. ~Kavos
Advertisement
You''ll have to change the clipper so that it doesn''t clip the interface area. When you are done rendering the interface, change the clipper back to what it was. Or, use BltFast as it ignores the clipper, but now you''ll have to be careful not to blit outside the screen.

- WitchLord

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Well I hear changing the clipper that many times really slows down the game (remember, I would have to do this for everything i blt down there) and no BltFast doesn't ignore the clipper, BltFast can't be used with a surfaces attached to a clipper at all.

~Kavos

Edited by - Kavos on July 11, 2000 8:26:08 AM
If I''m not completely mistaken, then you can create two separate clipper objects with their own regions to clip. Then you would only set which clipper to use before blitting. I can''t see any reason why this would be slow.

Anyway, If you do want to use the clipper to mask out the interface you are going to either change the clipper between blitting or set it to null so you can use BltFast(). There is no alternative.

(remember that I''m an "expert" with Direct3D, not DirectDraw, so don''t blame me if I''m wrong )

- WitchLord

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

Heh well i''ll be... changing the clipper didn''t slow it down at all, thought it woulda though, thanks ;P

~Kavos
From what I''ve tried, a clipper is the BIGGEST waste you can do if you''re running in full screen mode (it''s necessary for windowed mode).

For my full screen 2d games, I just put in a few extra lines of code in my Sprite class Draw function that takes care of the clipping for me, it''s really pretty easy. Just adjust the src rect according to the clip boundaries and use BltFast, works perfectly for me, looks like I''m using a DX blitter but I''m really using Bltfast with no clipper :o)

------------------------------
fclose(fp)
------------------------------
ByteMe95::~ByteMe95()My S(h)ite

This topic is closed to new replies.

Advertisement