module Application:Provides a unified interface to the one-instance aspects of SDL, such as setting the video mode and waiting for events. An example of how to get this up and running:sig..end
let renderer = new default_renderer in
renderer#set_scene_root (new some_scene_node_to_display ) ;
display_singleton#set_renderer (renderer :> renderer) ;
display_singleton#set_video_mode ~width:640 ~height:480 ;
display_singleton#event_loop
If you want to get started with one line of code, try
open FatCaml.Application
simply_display (new some_scene_node_to_display)
exception Done
class virtual renderer :object..end
val null_renderer : rendererclass virtual display_singleton_type :object..end
val display_singleton : display_singleton_typeclass camera_perspective_renderer :object..end
class default_renderer :camera_perspective_renderer
class ortho_pixel_renderer :unit ->object..end
class overlay_renderer :renderer list ->object..end
renderer's on top of each other.
class column_renderer :object..end
class camera_marker :?camera:Scene.camera -> unit ->object..end
val simply_display : ?distance:float -> ?textures:bool -> Scene.scene_node -> unitExample:
open FatCaml.Texture
open FatCaml.Primitives
let main () =
let texture = load_gl_texture "foo.png" in
let cube = make_cube ~texture 3.0 in
simply_display ~textures:true cube
let _ = main ()
distance : position on the Z axis. Defaults to 10.0.textures : enable texture rendering. Defaults to false.