ogltk-2Dview

Name

ogltk-2Dview -- A 2D OpenGL View.

Synopsis


#include <ogltk/view2D.h>


struct      ogltk_view2D;
GtkWidget*  ogltk_view2D_new                (gboolean direct,
                                             OGLTKConfigMode config,
                                             OGLTKRenderType render);
gboolean    ogltk_view2D_set_orth           (ogltk_view2D *view2d,
                                             gfloat near,
                                             gfloat far);
gboolean    ogltk_view2D_set_ratio          (ogltk_view2D *view2d,
                                             gfloat ratio);

Description

This modules creates and returns a visible GTK widget which provides an OpenGL orthographic view.

Othrographic projections gives all objects the same size to the viewer. This means that objects father away are the same size as the ones closer.

Details

struct ogltk_view2D

struct ogltk_view2D {

    ogltk_view              parent_instance;
    
    gfloat                  orth_near;
    gfloat                  orth_far;
    
    gfloat                  view_ratio;
    
};


ogltk_view2D_new ()

GtkWidget*  ogltk_view2D_new                (gboolean direct,
                                             OGLTKConfigMode config,
                                             OGLTKRenderType render);

Creates an OpenGL orthographic window to which it's to be placed in a GTK Application.

direct :

Enable direct drawing

config :

A Bitmask of fields for window characteristics

render :

Color Rendering type

Returns :

*GtkWidget


ogltk_view2D_set_orth ()

gboolean    ogltk_view2D_set_orth           (ogltk_view2D *view2d,
                                             gfloat near,
                                             gfloat far);

Set the near and far clipping planes for the orthographic view.

view2d :

An ogltk 2D view object.

near :

Specify which material property should follow the current color.

far :

Specify which sides should follow the current color

Returns :

TRUE if clipping planes have been set.


ogltk_view2D_set_ratio ()

gboolean    ogltk_view2D_set_ratio          (ogltk_view2D *view2d,
                                             gfloat ratio);

Set the view ratio to be calculated when the window is resized.

view2d :

An ogltk 2D view object.

ratio :

Specify which sides should follow the current color

Returns :

TRUE if ratio has been set.