Scalebrush on hardware brush buggy

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

Scalebrush on hardware brush buggy

Post by lazi »

OS4, old Radeon, minigl.
On a glgalore display the scaled hardware brushes don't display at all if a part of the brush leaves out of the display.

If ScaleBrush() preceeds CopyBrush(src,dest,{hardware=true]) the brush is ok and displays even partly.
If ScaleBrush() targets a hardware brush, then the brush only displays if no cropping needed at displayed position.

Code: Select all

@REQUIRE "glgalore.hwp"
@DISPLAY 1,{mode="windowed", width=1280, height=720}
BeginDoubleBuffer(True)

CreateTextObject(1,"Hello Hollywood!")

ConvertToBrush(#TEXTOBJECT,1,1)

ScaleBrush(1,120,32)
CopyBrush(1,10,{hardware=True})

CopyBrush(1,20,{hardware=True})
ScaleBrush(20,130,32)

DisplayBrush(10,0,0)
DisplayBrush(10,-10,64)

DisplayBrush(20,0,128)
DisplayBrush(20,-10,172)

Flip
WaitLeftMouse  
In the example, the last two DisplayBrush() should stamp the scaled hardware brush, but the last one shows nothing because the x coordinate is out of the display area.
It is maybe connecting to the similar RotateBrush() problem discribed here: viewtopic.php?f=25&t=2103

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

Re: Scalebrush on hardware brush buggy

Post by airsoftsoftwair »

Does it work correctly on Windows?

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

Re: Scalebrush on hardware brush buggy

Post by lazi »

Ok, ok, I know that miniGL bugs are no-go!

To be understand the problem, could you give me some rough details what happens when the script has a ScaleBrush() function with hardware brush on a GLgalore display?

Checked the display adapter plugin and the GfxBase SDK, but it is over my current knowledge.

A bit more investigation of the problem revealed that if the scaled hw brush then copied to a new hw brush, it is displayed even partly overscreen.
However it shows that the brush is not really scaled, but cropped or looped.
Image

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

Re: Scalebrush on hardware brush buggy

Post by airsoftsoftwair »

lazi wrote:
Tue Aug 18, 2020 1:16 pm
Ok, ok, I know that miniGL bugs are no-go!
I'm not saying that it's a MiniGL bug but if it works on Windows, then it most definitely is ;)
lazi wrote:
Tue Aug 18, 2020 1:16 pm
To understand the problem, could you give me some rough details what happens when the script has a ScaleBrush() function with hardware brush on a GLgalore display?

Checked the display adapter plugin and the GfxBase SDK, but it is over my current knowledge.

A bit more investigation of the problem revealed that if the scaled hw brush then copied to a new hw brush, it is displayed even partly overscreen.
However it shows that the brush is not really scaled, but cropped or looped.
Image
Technically, hardware brushes managed by GL Galore are OpenGL textures and since GL Galore is just supporting OpenGL 1.x, AFAIR all those textures must be power-of-two textures, i.e. both the pixel width and the pixel height must be a power of two. From the image you posted it looks like your brushes use some arbitrary dimensions so you might be in for some trouble because OpenGL expects textures to be power of two...

Post Reply