GLBasic forum

Feature request => 2D => Topic started by: AMC on 2009-Jun-06

Title: BLIT command
Post by: AMC on 2009-Jun-06
Hi, Could I possibly suggest the following command:

blit s1,x1,y1,x2,y2,s2,x,y,m

Where s1 is the source screen and x1,y1,x2,y2 is the part of the bitmap to be copied and s2 is the destination at x,y
(Mainly for the purposes of software scrolling!)
Also a color masking option would be nice like $000000 but $FF00FF seems to be popular these days. :-;

*AMC*

Title: Re: BLIT command
Post by: Moru on 2009-Jun-06
You can emulate this in GLBasic by using GRABSPRITE and DRAWSPRITE but I'm not sure how fast this would be :-)
I guess you could also use CREATESCREEN to draw all your grafics to a separate surface and then use DRAWSPRITE with this screen to draw it scrolling over the screen.
Title: Re: BLIT command
Post by: PeeJay on 2009-Jun-06
It may also be worth looking at the POLYVECTOR command for drawing parts of a graphic ....
Title: Re: BLIT command
Post by: Hemlos on 2009-Jun-06
Yes, POLYVECTOR handles an image with the texture coordinates, and color masking.

Title: Re: BLIT command
Post by: Kitty Hello on 2009-Jun-07
Or!
VIEWPORT x,y,w,h
DRAWSPRITE id, -x1, -y2
VIEWPORT 0,0,0,0
Title: Re: BLIT command
Post by: AMC on 2010-Aug-07
Thanks for all the help guys - sorted it!

BTW PeeJay, if you fancy a look at a remake of Boulderdash (Rock) goto www.amc.eclipse.co.uk - it is 15 years old and is coded 99% in assembler with a bit of Turbo Pascal to set up the memory model - also the sound doesn't work under XP, as we coded the SB16 directly. (69k download) but it is cool! - Wiki/Google the other (maybe main) coder - Leslie Benzies. R*

Any comments on a 15 year old bit of code would be quite interesting... (My brother & I are thinking of converting it to GLBasic).

*AMC*
Title: Re: BLIT command
Post by: AMC on 2010-Aug-21
Sorry Guys, I should have posted the reply I got from Gernot directly.
Here is his code...

CREATESCREEN 1,101,512,512 // make offscreen 1 512x512 and bind to sprite id 101
USESCREEN 1 // draw to sprite 101, offscreen 1
DRAWRECT 0,0,32,32,RGB(12,12,12) // draw
USESCREEN -1 // draw on back buffer
DRAWSPRITE 101, 55,55 // paste the rendered sprite
SHOWSCREEN
MOUSEWAIT

Hope my post helped others!

*AMC*