a bit of scaffolding to prepare for adding resize callback + message types
This commit is contained in:
4
fcore/app-type.sml
Normal file
4
fcore/app-type.sml
Normal file
@@ -0,0 +1,4 @@
|
||||
structure AppType =
|
||||
struct
|
||||
|
||||
end
|
||||
@@ -1,4 +1,10 @@
|
||||
structure Buffer =
|
||||
signature TEXT_BUILDER =
|
||||
sig
|
||||
val build: int * LineGap.t * int * int
|
||||
-> Real32.real vector * LineGap.t
|
||||
end
|
||||
|
||||
structure TextBuilder :> TEXT_BUILDER =
|
||||
struct
|
||||
val xSpace = 12
|
||||
val xSpace3 = xSpace * 3
|
||||
@@ -169,7 +175,7 @@ buildTextString ( startIdx, rStrHd, [], 5, 5, 5
|
||||
Vector.concat acc
|
||||
end
|
||||
|
||||
fun startBuildTextLineGap
|
||||
fun build
|
||||
(startLine, lineGap: LineGap.t, windowWidth, windowHeight) =
|
||||
let
|
||||
val lineGap = LineGap.goToLine (startLine, lineGap)
|
||||
@@ -157,6 +157,7 @@ typedef Pointer Objptr;
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
MLLIB_PUBLIC(void mltonFramebufferSizeCallback (Int32 x0, Int32 x1);)
|
||||
|
||||
#undef MLLIB_PRIVATE
|
||||
#undef MLLIB_PUBLIC
|
||||
|
||||
@@ -14,4 +14,7 @@ struct
|
||||
val (RELEASE, _) =
|
||||
_symbol "RELEASE" public : ( unit -> int ) * ( int -> unit );
|
||||
val RELEASE = RELEASE ()
|
||||
|
||||
val exportFramebufferSizeCallback =
|
||||
_export "mltonFramebufferSizeCallback" public : (int * int -> unit) -> unit;
|
||||
end
|
||||
|
||||
@@ -19,11 +19,11 @@ struct
|
||||
val _ = Gles3.loadGlad ()
|
||||
|
||||
(* upload text vector *)
|
||||
val io = TextIO.openIn "fcore/buffer.sml"
|
||||
val io = TextIO.openIn "fcore/text-builder.sml"
|
||||
val lineGap = ioToLineGap (io, LineGap.empty)
|
||||
val _ = TextIO.closeIn io
|
||||
|
||||
val (textVec, _) = Buffer.startBuildTextLineGap (0, lineGap, 1920, 1080)
|
||||
val (textVec, _) = TextBuilder.build (0, lineGap, 1920, 1080)
|
||||
val shellState = GlDraw.create window
|
||||
val shellState = GlDraw.uploadText (shellState, textVec)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user