Skip to content

Commit

Permalink
Allow point size to be specified in program constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugh Sanderson committed May 4, 2023
1 parent a1ec639 commit 546fada
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/nme/gl/ProgramTPosCol.hx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ProgramTPosCol extends ProgramBase
var clipped:Bool;
var prog:GLProgram;

public function new(inVertices:Float32Array, inColours:Int32Array, inPrim:Int, inPrimCount:Int,inClipped=false)
public function new(inVertices:Float32Array, inColours:Int32Array, inPrim:Int, inPrimCount:Int,inClipped=false, pointSize=1.0)
{
super(inPrim, inPrimCount);

Expand Down Expand Up @@ -60,6 +60,14 @@ class ProgramTPosCol extends ProgramBase
" vec4 p4 = vec4(pos, 1.0);" +
" gl_Position = mvp * p4;";

if (inPrim==GL.POINTS)
{
var val = "" + pointSize;
if (val.indexOf(".")<0)
val += ".0";
vertShader += " gl_PointSize = " + val + ";";
}

if (clipped)
{
if (fakeClip)
Expand Down

0 comments on commit 546fada

Please sign in to comment.