ogltk-3Dview

Name

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

Synopsis


#include <ogltk/view3D.h>


struct      ogltk_view3D;
GtkWidget*  ogltk_view3D_new                (gboolean direct,
                                             OGLTKConfigMode config,
                                             OGLTKRenderType render,
                                             gfloat near,
                                             gfloat far);
gboolean    ogltk_view3D_set_perspective    (ogltk_view3D *view3d,
                                             gfloat near,
                                             gfloat far);

Description

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

Perspective projections give the viewer the sense of depth with objects. This means that objects father away are smaller then the ones closer and objects with the same logical dimensions appear larger at the front then the back.

Details

struct ogltk_view3D

struct ogltk_view3D {

    ogltk_view              parent_instance;
    gfloat                  per_near;
    gfloat                  per_far;
};


ogltk_view3D_new ()

GtkWidget*  ogltk_view3D_new                (gboolean direct,
                                             OGLTKConfigMode config,
                                             OGLTKRenderType render,
                                             gfloat near,
                                             gfloat far);

Creates an OpenGL perspective 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

near :

Near clipping plane

far :

Far clipping plane

Returns :

*GtkWidget


ogltk_view3D_set_perspective ()

gboolean    ogltk_view3D_set_perspective    (ogltk_view3D *view3d,
                                             gfloat near,
                                             gfloat far);

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

view3d :

An ogltk 3D 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.