diff --git a/fcore/text-builder.sml b/fcore/text-builder.sml index f456dbe..7555c06 100644 --- a/fcore/text-builder.sml +++ b/fcore/text-builder.sml @@ -40,12 +40,10 @@ struct val textAcc = Vector.concat textAcc val bgAcc = Vector.concat bgAcc - - val textMsg = REDRAW_TEXT textAcc - val cursorMsg = REDRAW_CURSOR cursorAcc - val bgMsg = REDRAW_BG bgAcc + val vec = Vector.concat [textAcc, bgAcc, cursorAcc] + val drawMsg = DRAW_TEXT vec in - DRAW bgMsg :: DRAW textMsg :: DRAW cursorMsg :: msgs + DRAW drawMsg :: msgs end (* builds text from a string with char-wrap. diff --git a/message-types/draw-msg.sml b/message-types/draw-msg.sml index af56cf1..31bbb1e 100644 --- a/message-types/draw-msg.sml +++ b/message-types/draw-msg.sml @@ -1,8 +1,2 @@ structure DrawMsg = -struct - datatype t = - REDRAW_TEXT of Real32.real vector - | REDRAW_CURSOR of Real32.real vector - | REDRAW_BG of Real32.real vector - | YANK of string -end +struct datatype t = DRAW_TEXT of Real32.real vector | YANK of string end diff --git a/shell/gl-draw.sml b/shell/gl-draw.sml index 6e0e039..9d35041 100644 --- a/shell/gl-draw.sml +++ b/shell/gl-draw.sml @@ -1,7 +1,8 @@ structure GlDraw = struct open CML - open DrawMsg K + open DrawMsg + (* The name doesn't make it clear, but this structure * couples GLFW and OpenGL. * I'm not sure if I will use native windowing systems @@ -76,7 +77,7 @@ struct shellState val _ = Gles3.bufferData (vec, Vector.length vec, Gles3.STATIC_DRAW) - val newTextDrawLength = Vector.length vec div 5 + val newTextDrawLength = Vector.length vec div 6 in { textVertexBuffer = textVertexBuffer , textProgram = textProgram @@ -90,7 +91,7 @@ struct val {textVertexBuffer, textDrawLength, textProgram, window = _} = drawObject in - Gles3.drawArrays (Gles3.TRIANGLES, 0, drawLength) + Gles3.drawArrays (Gles3.TRIANGLES, 0, textDrawLength) end fun yank (shellState: t, str) = @@ -109,7 +110,7 @@ struct shellState in case msg of - DRAW vec => uploadText (shellState, textVec) + DRAW_TEXT textVec => uploadText (shellState, textVec) | YANK str => yank (shellState, str) end diff --git a/shell/gl-shaders.sml b/shell/gl-shaders.sml index aa45020..4c2e04b 100644 --- a/shell/gl-shaders.sml +++ b/shell/gl-shaders.sml @@ -1,6 +1,6 @@ structure GlShaders = struct - val xyrgbVertexShaderString = + val xyzRgbVertexShaderString = "#version 300 es\n\ \layout (location = 0) in vec3 apos;\n\ \layout (location = 1) in vec3 col;\n\