From 546fadae92db13069e199a464a63a8df7b2c46ea Mon Sep 17 00:00:00 2001 From: Hugh Sanderson Date: Thu, 4 May 2023 23:37:09 +0800 Subject: [PATCH] Allow point size to be specified in program constructor --- src/nme/gl/ProgramTPosCol.hx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/nme/gl/ProgramTPosCol.hx b/src/nme/gl/ProgramTPosCol.hx index ebd9567bb..a91aa60f7 100644 --- a/src/nme/gl/ProgramTPosCol.hx +++ b/src/nme/gl/ProgramTPosCol.hx @@ -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); @@ -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)