by m8f » Sun Nov 14, 2021 8:24 am
This happens only on OpenGL and OpenGL ES render backends, and only on Hardware Accelerated render mode.
Manjaro Linux x86_64, 5.13.19-2-MANJARO, NVidia 470.63.01.
Checked on GZDoom 4.7.1 and Git master (commit 01b825b18).
If a texture is drawn with Screen.DrawShape after Screen.Screen.drawTexture
in the same function - it's drawn as a black rectangle.

- black.png (27.59 KiB) Viewed 4331 times
Code: Select all
override
void renderOverlay(RenderEvent event)
{
{
Screen.drawTexture( TexMan.checkForTexture("pista0")
, false
, 200
, 200
, DTA_CenterOffset , true
, DTA_DestWidthF , 116
, DTA_DestHeightF , 60
);
}
{
let shape = new("Shape2D");
shape.pushVertex((-0.5, -0.5));
shape.pushVertex(( 0.5, -0.5));
shape.pushVertex(( 0.5, 0.5));
shape.pushVertex((-0.5, 0.5));
shape.pushCoord((0, 0));
shape.pushCoord((1, 0));
shape.pushCoord((1, 1));
shape.pushCoord((0, 1));
shape.pushTriangle(0, 1, 2);
shape.pushTriangle(0, 2, 3);
let transformation = new("Shape2DTransform");
transformation.scale((116, 60));
transformation.translate((200, 400));
shape.setTransform(transformation);
Screen.drawShape(TexMan.checkForTexture("pista0"), false, shape);
}
}
If I put Screen.drawTexture at the end, everything is drawn correctly.
Runnable example:
This happens only on OpenGL and OpenGL ES render backends, and only on Hardware Accelerated render mode.
Manjaro Linux x86_64, 5.13.19-2-MANJARO, NVidia 470.63.01.
Checked on GZDoom 4.7.1 and Git master (commit 01b825b18).
If a texture is drawn with Screen.DrawShape after Screen.Screen.drawTexture [b]in the same function[/b] - it's drawn as a black rectangle.
[attachment=1]black.png[/attachment]
[code] override
void renderOverlay(RenderEvent event)
{
{
Screen.drawTexture( TexMan.checkForTexture("pista0")
, false
, 200
, 200
, DTA_CenterOffset , true
, DTA_DestWidthF , 116
, DTA_DestHeightF , 60
);
}
{
let shape = new("Shape2D");
shape.pushVertex((-0.5, -0.5));
shape.pushVertex(( 0.5, -0.5));
shape.pushVertex(( 0.5, 0.5));
shape.pushVertex((-0.5, 0.5));
shape.pushCoord((0, 0));
shape.pushCoord((1, 0));
shape.pushCoord((1, 1));
shape.pushCoord((0, 1));
shape.pushTriangle(0, 1, 2);
shape.pushTriangle(0, 2, 3);
let transformation = new("Shape2DTransform");
transformation.scale((116, 60));
transformation.translate((200, 400));
shape.setTransform(transformation);
Screen.drawShape(TexMan.checkForTexture("pista0"), false, shape);
}
}[/code]
If I put Screen.drawTexture at the end, everything is drawn correctly.
Runnable example: [attachment=0]black-shape.pk3[/attachment]