RotateBrush() may destroy hardwarebrush

Discuss OpenGL® programming with the GL Galore plugin here
Post Reply
User avatar
lazi
Posts: 363
Joined: Thu Feb 24, 2011 11:08 pm

RotateBrush() may destroy hardwarebrush

Post by lazi » Mon Mar 18, 2019 7:28 pm

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
             


User avatar
airsoftsoftwair
Posts: 3192
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: RotateBrush() may destroy hardwarebrush

Post by airsoftsoftwair » Mon Mar 18, 2019 9:56 pm

Can you test on Windows as well? :)

User avatar
lazi
Posts: 363
Joined: Thu Feb 24, 2011 11:08 pm

Re: RotateBrush() may destroy hardwarebrush

Post by lazi » Mon Mar 18, 2019 10:10 pm

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
                     

User avatar
lazi
Posts: 363
Joined: Thu Feb 24, 2011 11:08 pm

Re: RotateBrush() may destroy hardwarebrush

Post by lazi » Mon Mar 18, 2019 10:23 pm

On windows they all works as expected.

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

User avatar
airsoftsoftwair
Posts: 3192
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: RotateBrush() may destroy hardwarebrush

Post by airsoftsoftwair » Tue Mar 19, 2019 6:29 pm

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 :)

Post Reply