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
|
struct
|
||||||
val xSpace = 12
|
val xSpace = 12
|
||||||
val xSpace3 = xSpace * 3
|
val xSpace3 = xSpace * 3
|
||||||
@@ -169,7 +175,7 @@ buildTextString ( startIdx, rStrHd, [], 5, 5, 5
|
|||||||
Vector.concat acc
|
Vector.concat acc
|
||||||
end
|
end
|
||||||
|
|
||||||
fun startBuildTextLineGap
|
fun build
|
||||||
(startLine, lineGap: LineGap.t, windowWidth, windowHeight) =
|
(startLine, lineGap: LineGap.t, windowWidth, windowHeight) =
|
||||||
let
|
let
|
||||||
val lineGap = LineGap.goToLine (startLine, lineGap)
|
val lineGap = LineGap.goToLine (startLine, lineGap)
|
||||||
@@ -157,6 +157,7 @@ typedef Pointer Objptr;
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
MLLIB_PUBLIC(void mltonFramebufferSizeCallback (Int32 x0, Int32 x1);)
|
||||||
|
|
||||||
#undef MLLIB_PRIVATE
|
#undef MLLIB_PRIVATE
|
||||||
#undef MLLIB_PUBLIC
|
#undef MLLIB_PUBLIC
|
||||||
|
|||||||
@@ -14,4 +14,7 @@ struct
|
|||||||
val (RELEASE, _) =
|
val (RELEASE, _) =
|
||||||
_symbol "RELEASE" public : ( unit -> int ) * ( int -> unit );
|
_symbol "RELEASE" public : ( unit -> int ) * ( int -> unit );
|
||||||
val RELEASE = RELEASE ()
|
val RELEASE = RELEASE ()
|
||||||
|
|
||||||
|
val exportFramebufferSizeCallback =
|
||||||
|
_export "mltonFramebufferSizeCallback" public : (int * int -> unit) -> unit;
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -19,11 +19,11 @@ struct
|
|||||||
val _ = Gles3.loadGlad ()
|
val _ = Gles3.loadGlad ()
|
||||||
|
|
||||||
(* upload text vector *)
|
(* 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 lineGap = ioToLineGap (io, LineGap.empty)
|
||||||
val _ = TextIO.closeIn io
|
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.create window
|
||||||
val shellState = GlDraw.uploadText (shellState, textVec)
|
val shellState = GlDraw.uploadText (shellState, textVec)
|
||||||
|
|
||||||
|
|||||||
2
shf.mlb
2
shf.mlb
@@ -5,7 +5,7 @@ lib/brolib-sml/src/line_gap.sml
|
|||||||
lib/cozette-sml/fonts/cozette-ascii.mlb
|
lib/cozette-sml/fonts/cozette-ascii.mlb
|
||||||
|
|
||||||
(* FUNCTIONAL CORE *)
|
(* FUNCTIONAL CORE *)
|
||||||
fcore/buffer.sml
|
fcore/text-builder.sml
|
||||||
|
|
||||||
(* IMPERATIVE SHELL *)
|
(* IMPERATIVE SHELL *)
|
||||||
$(SML_LIB)/basis/mlton.mlb
|
$(SML_LIB)/basis/mlton.mlb
|
||||||
|
|||||||
Reference in New Issue
Block a user