Page 1 of 1

RotateBrush() may destroy hardwarebrush

Posted: Mon Mar 18, 2019 7:28 pm
by lazi
There are two display height sized brushes. The first is created horizontally and then rotated, the second is created in the same size as the other after 90 degree rotation.
The rotated brush does not displayed on the GLGalore display.
Tested on OS4 and MOS and the results are the same.

Here is a test script.

Code: Select all

@REQUIRE "glgalore.hwp"
@DISPLAY {mode="windowed", title="test", borderless=False, width=800, height=600, nomodeswitch=False}

CreateBrush(101,600,120,#RED,{hardware=True})
CreateBrush(100,120,600,#RED,{hardware=True})

RotateBrush(101,0)

BeginDoubleBuffer(True)

game={  
		scroll = 0,
		}

Function p_draw()
	Cls
	game.scroll=Wrap(game.scroll-1,0,600)
	DisplayBrush(101,384,game.scroll)
	DisplayBrush(101,384,game.scroll-599)

	DisplayBrush(100,84,game.scroll)
	DisplayBrush(100,84,game.scroll-599)
	Flip
EndFunction

SetInterval(1,p_draw,1000/60)

Repeat
		 CheckEvent
Forever
             


Re: RotateBrush() may destroy hardwarebrush

Posted: Mon Mar 18, 2019 9:56 pm
by airsoftsoftwair
Can you test on Windows as well? :)

Re: RotateBrush() may destroy hardwarebrush

Posted: Mon Mar 18, 2019 10:10 pm
by lazi
Yes, testing in a minute!

Until then let me show you an even hair-raising case!
When the rotated brush displayed with {scalex=0.5, scaley=0.5} it is shown unrotated.

Code: Select all

@REQUIRE "glgalore.hwp"
@DISPLAY {mode="windowed", title="test", borderless=False, width=800, height=600, nomodeswitch=False}

CreateBrush(1,100,100,#RED,{hardware=False})

SelectBrush(1)
TextOut(#CENTER,#CENTER,"DEADBEEF")
EndSelect

CopyBrush(1,100,{hardware=True})
CopyBrush(1,101,{hardware=True})

RotateBrush(101,90)

BeginDoubleBuffer(True)

game={  
		scroll = 0,
		}

Function p_draw()
	Cls
	game.scroll=Wrap(game.scroll-1,0,600)
	DisplayBrush(101,384,game.scroll,{scalex=0.5,scaley=0.5})
	DisplayBrush(101,384,game.scroll-599,{scalex=0.5,scaley=0.5})

	DisplayBrush(101,584,game.scroll)
	DisplayBrush(101,584,game.scroll-599)

	DisplayBrush(100,84,game.scroll)
	DisplayBrush(100,84,game.scroll-599)
	Flip
EndFunction

SetInterval(1,p_draw,1000/60)

Repeat
		 CheckEvent
Forever
                     

Re: RotateBrush() may destroy hardwarebrush

Posted: Mon Mar 18, 2019 10:23 pm
by lazi
On windows they all works as expected.

For a clarification to the first example the rotate line should be: RotateBrush(101,0).

Re: RotateBrush() may destroy hardwarebrush

Posted: Tue Mar 19, 2019 6:29 pm
by airsoftsoftwair
Well, if it works on Windows chances are that those are bugs/limitations in MiniGL and TinyGL because the code is the same. I'll investigate when I have some time but all GL Galore issues that don't happen on Windows/macOS/Linux don't have a high priority because MiniGL and TinyGL have lots of limitations of course :)