module Antialias:Antialiasing helper functions. Used by implementations ofsig..end
Application.renderer.
These functions are pulled straight from the OpenGL Red Book.
*** Note: this isn't right. I need to get this working again *** Or does it? Could it be my card doesn't support accum buffer? Is that even possible? What the heck is going on???
inherit renderer
val mutable antialiasing = NotAntialiased
val mutable root_node = new some_node_to_render
val mutable camera = null_camera
val mutable ext_viewport = (width=640 ;
height=480 ;
near=0.1 ;
far=100.0 }
method render =
GlClear.clear [`color ; `depth ] ;
let f () =
GlMat.load_identity () ;
camera#transform_gl_matrix ;
root_node#draw_scene ;
()
in begin match antialiasing with
NotAntialiased -> antialias f ext_viewport 1
| Antialiased n -> antialias f ext_viewport n
end ;
Sdlgl.swap_buffers () ;
()
val acc_frustrum : left:float ->
right:float ->
bottom:float ->
top:float ->
near:float ->
far:float ->
jitter_x:float ->
jitter_y:float ->
eye_x:float ->
eye_y:float -> focus:float -> viewport_w:int -> viewport_h:int -> unitval pi : floatval jitter_list : int -> (float * float) listval acc_perspective : fovy:float ->
aspect:float ->
near:float ->
far:float ->
jitter_x:float ->
jitter_y:float ->
eye_x:float ->
eye_y:float -> focus:float -> viewport_w:int -> viewport_h:int -> unittype ext_viewport = {
|
width : |
(* | Height in pixels. | *) |
|
height : |
(* | Near clipping distance in world coordinates. | *) |
|
near : |
(* | Far clipping distace in world coordinates. | *) |
|
far : |
val accumulate : (float * float -> 'a) -> int -> unitrender_fun passes times,
using the accumulation buffer to create
and antialiased rendering.