101 {0.90, 0.60, 0.99, 1.50, 1.00},
102 {0.80, 0.40, 0.99, 1.00, 1.00},
103 {0.35, 0.15, 0.99, 1.50, 1.00},
104 {0.50, 0.50, 0.99, 1.00, 0.50},
105 {0.50, 0.50, 0.99, 1.00, 0.75},
106 {0.35, 0.80, 0.99, 1.50, 1.00}};
117 i18n(
"Ambient occlusion"),
118 i18n(
"Gamma correction"),
123 i18n(
"Constant attenuation"),
124 i18n(
"Linear attenuation"),
125 i18n(
"Quadratic attenuation"),
127 i18n(
"Inner cutoff"),
128 i18n(
"Outer cutoff"),
130 {
i18n(
"<b>Fog color</b>")}};
132gchar *
lpos[3] = {
"x",
"y",
"z"};
133gchar *
cpos[3] = {
"r",
"g",
"b"};
146GtkWidget *
adv_box (GtkWidget *
box,
char *
lab,
int vspace,
int size,
float xalign)
233 for (i=0; i<ogl_lightning -> lights; i++)
244 gchar * str = g_strdup_printf (_(
"You must select %d light source(s) to be removed !"),
status);
266 str = g_strdup_printf (_(
"Please select the %d light sources to be removed: "),
val);
270 str = g_strdup_printf (_(
"Please select the light source to be removed: "));
272 GtkWidget * win =
message_dialogmodal (str, _(
"Remove light source(s)"), GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE, ogl_edit -> win);
274 d_close = gtk_dialog_get_widget_for_response (GTK_DIALOG (win), GTK_RESPONSE_CLOSE);
278 for (i=0; i<ogl_lightning -> lights; i++)
280 str = g_strdup_printf (_(
"Light N°%d"), i+1);
301 g_debug (
"Light N°%d", i);
302 g_debug (
"Type= %d", source.
type);
338 Light * new_light = g_malloc0(
sizeof*new_light);
339 new_light -> type = type;
340 new_light -> fix = (type != 1) ? 0 : 1;
341 new_light -> show = 0;
342 new_light -> intensity = vec3(0.0, 0.0, 0.0);
343 new_light -> direction = vec3(0.0, 0.0, 0.0);
344 new_light ->
position = vec3(0.0, 0.0, 0.0);
345 new_light -> attenuation = vec3(0.0, 0.0, 0.0);
349 new_light ->
position = vec3 (0.0, 0.0, 0.0);
350 new_light -> direction = vec3 (0.5, 1.0, 0.7);
351 new_light -> attenuation = vec3 (1.0, 0.0, 0.0);
355 new_light -> intensity = vec3 (1.2, 1.1, 1.0);
356 new_light ->
position = vec3 (0.0, 0.0, size * 0.8);
357 new_light -> attenuation = vec3 (1.0, 0.01 / size, 0.001 / (size * size));
361 new_light -> intensity = vec3 (1.5, 1.4, 1.3);
362 new_light ->
position = vec3 (0.0, 0.0, size * 0.5);
363 new_light -> direction = vec3 (0.0, 0.0, -1.0);
364 new_light -> attenuation = vec3 (1.0, 0.01 / size, 0.001 / (size * size));
365 new_light -> spot_data = vec3 (45.0, 5.0, 8.0);
379 Light * new_sp = g_malloc0(
sizeof*new_sp);
380 new_sp -> type = old_sp -> type;
381 new_sp -> fix = old_sp -> fix;
382 new_sp -> show = old_sp -> show;
384 new_sp -> direction = old_sp -> direction;
385 new_sp -> intensity = old_sp -> intensity;
386 new_sp -> attenuation = old_sp -> attenuation;
387 new_sp -> spot_data = old_sp -> spot_data;
403 Light ** new_sp = g_malloc0(dima*
sizeof * new_sp);
404 for (j=0; j<dimb; j++)
425 this_light -> type = tid;
436 if (this_light -> type)
441 if (this_light -> type == 0 || this_light -> type == 2)
445 if (this_light -> type == 2)
518 for (i=0; i<num_lights; i++)
520 str = g_strdup_printf (_(
"Light N°%d"), i+1);
524 gtk_widget_set_size_request (ogl_win -> lights, 100, -1);
525 g_signal_connect (G_OBJECT (ogl_win -> lights),
"changed", G_CALLBACK(
show_light_param), ogl_win);
526 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, ogl_win -> lights_box, ogl_win -> lights, FALSE, FALSE, 10);
546 view = (
glwin *)data;
548 this_lightning = & view -> anim -> last ->
img -> l_ghtning;
549 ogl_edit = view -> opengl_win;
557 i = this_lightning -> lights;
562 g_debug (
"ADDING_LIGHT_SOURCE:: val= %d, i= %d",
val, i);
566 g_free (this_lightning -> spot);
568 this_lightning -> lights =
val;
569 for (j=i; j<
val; j++)
579 g_debug (
"REMOVING_LIGHT_SOURCE:: val= %d, i= %d",
val, i);
585 g_free (this_lightning -> spot);
586 this_lightning -> spot = g_malloc0(
val*
sizeof*this_lightning -> spot);
599 g_debug (
"REMOVING_LIGHT_SOURCES:: j= %d, ltr[%d]= %d", j, j, ltr[j]);
604 this_lightning -> lights =
val;
606 g_debug (
"LIGHT(s) HAVE BEEN REMOVED:: NEW_LIGHTS_NUM= %d",
val);
657 this_light -> attenuation.x = v;
660 this_light -> attenuation.y = v;
663 this_light -> attenuation.z = v;
666 this_light -> spot_data.x = v;
669 this_light -> spot_data.y = v;
672 this_light -> spot_data.z = v;
676 if (this_light -> show) view -> create_shaders[
LIGHT] = TRUE;
727 the_mat = & view -> anim -> last ->
img -> m_terial;
728 the_lightning = & view -> anim -> last ->
img -> l_ghtning;
729 the_fog = & view -> anim -> last ->
img -> f_g;
730 edit_ogl = view -> opengl_win;
743 else if (
id -> b == 4)
747 else if (
id -> b > 0 && edit_ogl)
756 set_data_pos (& the_lightning -> spot[li] -> direction,
id -> c, v);
759 set_data_pos (& the_lightning -> spot[li] -> intensity,
id -> c, v);
762 if (the_lightning -> spot[li] -> show && !
preferences) view -> create_shaders[
LIGHT] = TRUE;
800 ogl_ligthning = & view -> anim -> last ->
img -> l_ghtning;
810 view -> create_shaders[
LIGHT] = TRUE;
824G_MODULE_EXPORT
void show_this_light (GtkCheckButton * but, gpointer data)
840 view -> anim -> last ->
img -> l_ghtning.spot[li] -> show =
button_get_status ((GtkWidget *)but);
841 view -> create_shaders[
LIGHT] = TRUE;
866 gtk_widget_set_size_request (sbox, 500, -1);
871 ogl_win -> pos_pointer[pid][i].a = ogl_win ->
proj;
872 ogl_win -> pos_pointer[pid][i].b = pid;
873 ogl_win -> pos_pointer[pid][i].c = i;
877 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, sbox, ogl_win -> entogl[pid][i], FALSE, FALSE, 0);
883 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, sbox, ogl_win -> light_show, FALSE, FALSE, 10);
901 GtkWidget *
hbox, * lhbox;
905 hbox =
bdv_box (
vbox, _(
"<b>Number of light sources</b>\n(add or remove lights - up to 10 sources)"), 250, 0.0);
906 gtk_widget_set_size_request (
hbox, -1, 65);
909 gtk_widget_set_size_request (nlights, 25, -1);
910 GtkWidget * fix = gtk_fixed_new ();
912 gtk_fixed_put (GTK_FIXED (fix), nlights, 0, 20);
914 hbox =
bdv_box (
vbox, _(
"<b>Configure light source <sup>*</sup></b>"), 250, 0.0);
919 bdv_box (
vbox, _(
"<b>Light configuration</b>"), 250, 0.0);
926 g_signal_connect (G_OBJECT (ogl_edit -> light_type),
"changed", G_CALLBACK(
set_light_type), ogl_edit);
929 add_box_child_start (GTK_ORIENTATION_HORIZONTAL,
hbox, gtk_label_new(_(
"Fixed by respect to: ")), FALSE, FALSE, 10);
933 g_signal_connect (G_OBJECT (ogl_edit -> light_fix),
"changed", G_CALLBACK(
set_light_fix), ogl_edit);
936 float values[3] = {0.0, 0.0, 0.0};
939 ogl_edit -> light_b_coord[0] =
create_setting_pos (str, 130, 0.0, 1, 0, values, ogl_edit);
943 str = g_strdup_printf (
"<u>%s:</u>", _(
ogl_settings[1][1]));
944 ogl_edit -> light_b_coord[1] =
create_setting_pos (str, 130, 0.0, 2, 1, values, ogl_edit);
949 add_box_child_start (GTK_ORIENTATION_VERTICAL,
vbox,
create_setting_pos (str, 130, 0.0, 3, 2, values, ogl_edit), FALSE, FALSE, 0);
955 add_box_child_start (GTK_ORIENTATION_VERTICAL, ogl_edit -> advanced_light_box,
markup_label(_(
"<b>Advanced parameters</b>"), -1, -1, 0.1, 0.5), FALSE, FALSE, 10);
957 add_box_child_start (GTK_ORIENTATION_VERTICAL, ogl_edit -> advanced_light_box, lbox, FALSE, FALSE, 0);
964 add_box_child_start (GTK_ORIENTATION_VERTICAL, lvbox, ogl_edit -> light_b_entry[i], FALSE, FALSE, 0);
968 str = g_strdup_printf (
"<u>%s:</u>", _(
ogl_settings[1][k+3]));
969 lhbox =
adv_box (ogl_edit -> light_b_entry[i], str, 0, 170, 0.0);
971 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, lhbox, ogl_edit -> light_entry[k], FALSE, FALSE, 10);
972 if (i == 1)
add_box_child_start (GTK_ORIENTATION_HORIZONTAL, lhbox, gtk_label_new(
"°"), FALSE, FALSE, 0);
980 append_comments (
vbox,
"<sup>*</sup>", _(
"Note that light N°1 must be a directional light"));
983 append_comments (
vbox,
"<sup>**</sup>", _(
"Position and attenuation will be corrected based on model depth"));
1018 view = (
glwin *)data;
1019 ogl_edit = view -> opengl_win;
1020 the_mat = & view -> anim -> last ->
img -> m_terial;
1033 the_mat -> albedo = vec3(0.5, 0.5, 0.5);
1040 gtk_range_set_value (GTK_RANGE(ogl_edit -> m_scale[k]), the_mat ->
param[k+1]);
1056 the_mat -> predefine = k;
1086 view = (
glwin *)data;
1087 the_mat = & view -> anim -> last ->
img -> m_terial;
1088 ogl_edit = view -> opengl_win;
1091 the_mat -> predefine = i + 1;
1101 gtk_range_set_value (GTK_RANGE(ogl_edit -> m_scale[j]), the_mat ->
param[j+1]);
1132 view -> anim -> last ->
img ->
render = 0;
1199 edit_ogl = view -> opengl_win;
1200 the_mat = & view -> anim -> last ->
img -> m_terial;
1206 gtk_range_set_value (GTK_RANGE(edit_ogl -> m_scale[mid -> b]), the_mat ->
param[mid -> b + 1]);
1236G_MODULE_EXPORT gboolean
scroll_scale_param (GtkRange * range, GtkScrollType scroll, gdouble value, gpointer data)
1265G_MODULE_EXPORT gboolean
scroll_scale_quality (GtkRange * range, GtkScrollType scroll, gdouble value, gpointer data)
1284 set_quality ((
int)gtk_range_get_value (range), data);
1300 GtkWidget * fix = gtk_fixed_new ();
1302 gtk_fixed_put (GTK_FIXED (fix), rmodel, 0, 10);
1306 g_signal_connect (G_OBJECT (rmodel),
"changed", G_CALLBACK(
set_r_model), view);
1307 gtk_widget_set_size_request (rmodel, 110, -1);
1310 ogl_edit -> render_fix = gtk_fixed_new ();
1311 gtk_fixed_put (GTK_FIXED (fix), ogl_edit -> render_fix, 130, 0);
1313 gtk_fixed_put (GTK_FIXED (ogl_edit -> render_fix), quality_scale, 20, 0);
1317 gtk_fixed_put (GTK_FIXED (ogl_edit -> render_fix), fmodel, 120, 10);
1321 g_signal_connect (G_OBJECT (fmodel),
"changed", G_CALLBACK(
set_f_model), view);
1322 gtk_widget_set_size_request (fmodel, 100, -1);
1340 GtkWidget * fix = gtk_fixed_new ();
1342 gtk_fixed_put (GTK_FIXED (fix), lmodel, 0, 10);
1344 char * l_model[6] = {
i18n(
"None"),
"Phong",
"Blinn",
"Cook-Torrance-Blinn",
"Cook-Torrance-Beckmann",
"Cook-Torrance-GCX"};
1350 g_signal_connect (G_OBJECT (lmodel),
"changed", G_CALLBACK(
set_l_model), view);
1351 gtk_widget_set_size_request (lmodel, 200, -1);
1372 gchar * str = g_strdup_printf (
"<b>%s</b> ", _(
"Quality"));
1377 str = g_strdup_printf (
"<b>%s</b> ", _(
"Lightning model"));
1381 add_box_child_start (GTK_ORIENTATION_VERTICAL,
vbox, gtk_separator_new (GTK_ORIENTATION_HORIZONTAL), FALSE, FALSE, 20);
1388 str = g_strdup_printf (
"<b>%s</b> ", _(
"Templates"));
1392 i18n(
"Brushed Metal"),
1393 i18n(
"Shiny Metal"),
1395 i18n(
"Transparent"),
1396 i18n(
"Translucent"),
1404 g_signal_connect (G_OBJECT (ogl_edit -> templates),
"changed", G_CALLBACK(
set_template), view);
1405 gtk_widget_set_size_request (ogl_edit -> templates, 100, -1);
1408 add_box_child_start (GTK_ORIENTATION_VERTICAL,
vbox, gtk_separator_new (GTK_ORIENTATION_HORIZONTAL), FALSE, FALSE, 20);
1417 bdv_box (ogl_edit -> param_mat, _(
"<b>Material properties</b>"), 250, -1);
1419 GtkWidget * m_fixed;
1422 str = g_strdup_printf (
"<u>%s:</u>", _(
ogl_settings[0][i+1]));
1423 box =
adv_box (ogl_edit -> param_mat, str, 0, 130, 0.0);
1430 m_fixed = gtk_fixed_new ();
1431 gtk_fixed_put (GTK_FIXED(m_fixed), ogl_edit -> m_entry[i], 0, 15);
1434 float values[] = {the_mat -> albedo.x, the_mat -> albedo.y, the_mat -> albedo.z};
1435 str = g_strdup_printf (
"<u>%s:</u>", _(
ogl_settings[0][0]));
1436 add_box_child_start (GTK_ORIENTATION_VERTICAL, ogl_edit -> param_mat,
create_setting_pos (str, 130, -1, 0, 0, values, ogl_edit), FALSE, FALSE, 10);
1466 this_fog = & view -> anim -> last ->
img -> f_g;
1467 ogl_edit = view -> opengl_win;
1477 v = this_fog -> depth[0];
1478 w = this_fog -> depth[1];
1479 if (fid -> b == 1 && u < w)
1481 this_fog -> depth[0] = u;
1483 else if (fid -> b == 2 && u > v)
1485 this_fog -> depth[1] = u;
1491 gtk_range_set_value (range, (gdouble) (w-0.1));
1495 gtk_range_set_value (range, (gdouble) (v+0.1));
1501 this_fog -> density = u;
1516G_MODULE_EXPORT gboolean
scroll_set_fog_param (GtkRange * range, GtkScrollType scroll, gdouble value, gpointer data)
1551 this_fog = & view -> anim -> last ->
img -> f_g;
1576 this_fog = & view -> anim -> last ->
img -> f_g;
1582 this_fog -> mode = fid;
1585 if (this_fog -> mode)
1588 if (this_fog -> mode == 1)
1633 GtkWidget *
box =
adv_box (
vbox, _(
"<b>Fog mode</b> "), 10, 150, 0.0);
1639 gtk_widget_set_size_request (fogmod, 200, -1);
1641 g_signal_connect (G_OBJECT (fogmod),
"changed", G_CALLBACK(
set_fog_mode), ogl_edit);
1647 box =
adv_box (ogl_edit -> param_fog, _(
"<b>Fog type</b> "), 5, 150, 0.0);
1651 gtk_widget_set_size_request (
fogtype, 200, -1);
1657 ogl_edit -> dens_box =
adv_box (ogl_edit -> param_fog, _(
"<b>Fog density</b>"), 10, 150.0, 0.0);
1658 ogl_edit -> fog_range[0] =
create_hscale (0.0, 1.0, 0.01, the_fog -> density, GTK_POS_TOP, 3,
1660 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, ogl_edit -> dens_box, ogl_edit -> fog_range[0], FALSE, FALSE, 0);
1662 gchar * depthfog[2] = {_(
"\t depth<sup>*</sup> start: "), _(
"\t depth<sup>*</sup> end: ")};
1665 add_box_child_start (GTK_ORIENTATION_VERTICAL, ogl_edit -> param_fog, ogl_edit -> depth_box, FALSE, FALSE, 0);
1666 box =
adv_box (ogl_edit -> depth_box, _(
"<b>Fog depth</b>"), 10, 150.0, 0.0);
1670 box =
adv_box (ogl_edit -> depth_box, depthfog[i], 5, 170, 0.0);
1671 ogl_edit -> fog_range[i+1] =
create_hscale (0.0, 100.0, 0.1, the_fog -> depth[i], GTK_POS_TOP, 2,
1675 add_box_child_start (GTK_ORIENTATION_VERTICAL, ogl_edit -> depth_box,
markup_label(_(
"* % of the OpenGL model depth."), -1, -1, 0.5, 0.5) , FALSE, FALSE, 5);
1677 float values[] = {the_fog ->
color.x, the_fog ->
color.y, the_fog ->
color.z};
1678 add_box_child_start (GTK_ORIENTATION_VERTICAL, ogl_edit -> param_fog,
create_setting_pos (_(
ogl_settings[2][0]), 130, 0.0, 4, 0, values, ogl_edit), FALSE, FALSE, 5);
1694 g_free (view -> opengl_win);
1695 view -> opengl_win = NULL;
1707G_MODULE_EXPORT gboolean
close_advanced (GtkWidget * window, gpointer data)
1718G_MODULE_EXPORT gboolean
close_advanced (GtkWidget * widg, GdkEvent * event, gpointer data)
1736 if (view -> opengl_win == NULL)
1738 view -> opengl_win = g_malloc0(
sizeof*view -> opengl_win);
1739 view -> opengl_win ->
proj = view ->
proj;
1743 view -> opengl_win -> pointer[i].a = view ->
proj;
1744 view -> opengl_win -> pointer[i].b = i;
1746 gchar * str = g_strdup_printf (_(
"OpenGL material aspect and light settings - %s"),
get_project_by_id(view ->
proj) -> name);
1747 view -> opengl_win -> win =
create_win (str, view -> win, FALSE, FALSE);
1750 gtk_window_set_resizable (GTK_WINDOW (view -> opengl_win -> win), TRUE);
1755 GtkWidget * notebook = gtk_notebook_new ();
1757 gtk_widget_set_size_request (notebook, 580, 670);
1759 gtk_widget_set_size_request (notebook, 580, 670);
1763 gtk_widget_set_vexpand (notebook, TRUE);
1766 gtk_notebook_append_page (GTK_NOTEBOOK(notebook),
materials_tab (view, view -> opengl_win, & view -> anim -> last ->
img -> m_terial),
1767 markup_label(_(
"<b>Material aspect</b>"), -1, -1, 0.0, 0.5));
1768 gtk_notebook_append_page (GTK_NOTEBOOK(notebook),
lights_tab (view, view -> opengl_win, & view -> anim -> last ->
img -> l_ghtning),
1769 markup_label(_(
"<b>Configure light sources</b>"), -1, -1, 0.0, 0.5));
1770 gtk_notebook_append_page (GTK_NOTEBOOK(notebook),
fog_tab (view, view -> opengl_win, & view -> anim -> last ->
img -> f_g),
1771 markup_label(_(
"<b>Configure fog</b>"), -1, -1, 0.0, 0.5));
void init_default_shaders(glwin *view)
re-initialize the default OpenGL shaders
int * allocint(int val)
allocate an int * pointer
double string_to_double(gpointer string)
convert string to double
Global variable declarations Global convenience function declarations Global data structure defin...
void run_this_gtk_dialog(GtkWidget *dial, GCallback handler, gpointer data)
run a GTK (3 and 4) basic GtkDialog
int combo_get_active(GtkWidget *combo)
retrieve the active item's position
GtkWidget * create_entry(GCallback handler, int dim, int cdim, gboolean key_release, gpointer data)
Create a GtkEntry.
void update_entry_double(GtkEntry *entry, double doubleval)
update the content of a GtkEntry as double
void append_comments(GtkWidget *vbox, gchar *symbol, gchar *legend)
append comments to a vertical box
GtkWidget * create_win(gchar *str, GtkWidget *parent, gboolean modal, gboolean resiz)
create a new GtkWindow
void combo_set_active(GtkWidget *combo, int pos)
set the active item's position
GtkWidget * add_vbox_to_layout(GtkWidget *layout, int size_x, int size_y)
Insert a vertical GtkBox in a GtkLatout then send back the GtkBox.
const gchar * entry_get_text(GtkEntry *entry)
get the text in a GtkEntry
void add_gtk_close_event(GtkWidget *widg, GCallback handler, gpointer data)
add a close event signal and callback to a GtkWidget
void button_set_status(GtkWidget *button, int status)
set status of check / toggle button
void add_global_option(GtkWidget *vbox, tint *oid)
add a button to update global user preferences
GtkWidget * spin_button(GCallback handler, double value, double start, double end, double step, int digits, int dim, gpointer data)
create a spin button
GtkWidget * check_button(gchar *text, int dimx, int dimy, gboolean state, GCallback handler, gpointer data)
create a check button
GtkWidget * create_combo()
create a GtkCombox widget, note deprecated in GTK4
GtkWidget * dialog_get_content_area(GtkWidget *widg)
prepare GtkWidget to insert content in a GtkDialog window
GtkWidget * markup_label(gchar *text, int dimx, int dimy, float ax, float ay)
create a GtkLabel with pango markup
void add_box_child_start(int orientation, GtkWidget *widg, GtkWidget *child, gboolean expand, gboolean fill, int padding)
Add a GtkWidget in a GtkBox at the initial position.
void widget_set_sensitive(GtkWidget *widg, gboolean sensitive)
Set sensitivity for a GtkWidget, ensuring it is a GtkWidget.
void destroy_this_dialog(GtkDialog *dialog)
destroy a GtkDialog
GtkWidget * create_hbox(int spacing)
create a GtkBox with horizontal orientation
void combo_text_append(GtkWidget *combo, gchar *text)
append text in GtkComboBox widget
GtkWidget * create_layout(int x, int y)
create a GtkLayout / GtkFixed widget
GtkWidget * destroy_this_widget(GtkWidget *widg)
destroy a GtkWidget
GtkWidget * create_hscale(float min, float max, float delta, float val, int pos, int round, int size, GCallback handler, GCallback scroll_handler, gpointer data)
create an horizontal scale GtkWidget
void add_container_child(int type, GtkWidget *widg, GtkWidget *child)
Add a GtkWidget into another GtkWidget.
GtkWidget * message_dialogmodal(gchar *message, gchar *title, GtkMessageType mtype, GtkButtonsType buttons, GtkWidget *parent)
create a modal (cannot be ignored) message window
void hide_the_widgets(GtkWidget *widg)
hide GtkWidget
GtkWidget * create_vbox(int spacing)
create a GtkBox with vertical orientation
int button_get_status(GtkWidget *button)
get status of check / toggle button
void show_the_widgets(GtkWidget *widg)
show GtkWidget
project * get_project_by_id(int p)
get project pointer using id number
void update(glwin *view)
update the rendering of the OpenGL window
Variable declarations related to the OpenGL window Function declarations related to the OpenGL wind...
#define DEFAULT_INTENSITY
Default light intensity.
gchar * material_template[TEMPLATES]
void init_shaders(glwin *view)
initialize all the OpenGL shaders
#define TEMPLATES
Number of material templates.
GLfloat template_parameters[TEMPLATES][5]
Function declarations for the creation of the OpenGL window.
void show_warning(char *warning, GtkWidget *win)
show warning
Messaging function declarations.
opengl_edition * pref_ogl_edit
GtkWidget * lights_tab(glwin *view, opengl_edition *ogl_edit, Lightning *the_light)
OpenGL light(s) parameters tab.
GtkWidget * materials_tab(glwin *view, opengl_edition *ogl_edit, Material *the_mat)
OpenGL material parameters tab.
G_MODULE_EXPORT gboolean scroll_scale_quality(GtkRange *range, GtkScrollType scroll, gdouble value, gpointer data)
update OpenGL quality - scroll callback
GtkWidget * fog_tab(glwin *view, opengl_edition *ogl_edit, Fog *the_fog)
OpenGL fog parameters tab.
GtkWidget * lightning_fix(glwin *view, Material *this_material)
G_MODULE_EXPORT void scale_quality(GtkRange *range, gpointer data)
update OpenGL quality - range callback
Preference variable declarations.
Light * init_light_source(int type, float size)
initialize a light source
G_MODULE_EXPORT void set_f_model(GtkComboBox *box, gpointer data)
change OpenGL filling model
G_MODULE_EXPORT void set_light_fix(GtkComboBox *box, gpointer data)
set light fix callback
void print_light_source(Light source, int i)
print light source data
G_MODULE_EXPORT void set_use_template_toggle(GtkToggleButton *but, gpointer data)
use or not OpenGL material template callback GTK3
GtkWidget * materials_tab(glwin *view, opengl_edition *ogl_edit, Material *the_mat)
OpenGL material parameters tab.
G_MODULE_EXPORT void set_object_pos(GtkEntry *res, gpointer data)
set object position
G_MODULE_EXPORT void set_nlights_spin(GtkSpinButton *res, gpointer data)
change the number of light(s) - spin button
void set_quality(int q, glwin *view)
set OpenGL quality
G_MODULE_EXPORT void set_template(GtkComboBox *box, gpointer data)
change the OpenGL material template
G_MODULE_EXPORT void set_fog_mode(GtkWidget *widg, gpointer data)
set fog mode callback
G_MODULE_EXPORT void set_fog_type(GtkWidget *widg, gpointer data)
set OpenGL fog type
void setup_fog_dialogs(opengl_edition *ogl_edit, int fid)
update OpenGL fog tab based of fog type
void fog_param_changed(gpointer data, GLfloat u, GtkRange *range)
update OpenGL fog parameter
G_MODULE_EXPORT void opengl_advanced(GtkWidget *widg, gpointer data)
create OpenGL rendering advanced window
int * light_source_to_be_removed(int val, Lightning *ogl_lightning, opengl_edition *ogl_edit)
remove light source(s) - creating the dialog
G_MODULE_EXPORT gboolean scroll_scale_quality(GtkRange *range, GtkScrollType scroll, gdouble value, gpointer data)
update OpenGL quality - scroll callback
G_MODULE_EXPORT void update_mat_param(GtkEntry *res, gpointer data)
update OpenGL material parameter - entry
GtkWidget * fog_tab(glwin *view, opengl_edition *ogl_edit, Fog *the_fog)
OpenGL fog parameters tab.
G_MODULE_EXPORT void show_this_light(GtkToggleButton *but, gpointer data)
show / hide this light callback GTK3
G_MODULE_EXPORT gboolean scroll_set_fog_param(GtkRange *range, GtkScrollType scroll, gdouble value, gpointer data)
update OpenGL fog parameter - scroll callback
void close_advanced_opengl(gpointer data)
close OpenGL rendering window free data
void show_active_light_data(opengl_edition *ogl_win, int lid, int tid)
show active light data
G_MODULE_EXPORT void show_light_param(GtkComboBox *box, gpointer data)
update light parameters based on light id in combo box
void update_light_data(int li, opengl_edition *ogl_win)
update light data
GtkWidget * rendering_fix(glwin *view, opengl_edition *ogl_edit)
G_MODULE_EXPORT gboolean close_advanced(GtkWidget *widg, GdkEvent *event, gpointer data)
close OpenGL rendering advanced window callback GTK3
G_MODULE_EXPORT void scale_param(GtkRange *range, gpointer data)
update OpenGL material parameter - range callback
gchar * ogl_settings[3][10]
Light ** copy_light_sources(int dima, int dimb, Light **old_sp)
create a copy of a list of light sources
GtkWidget * lightning_fix(glwin *view, Material *this_material)
GtkWidget * create_setting_pos(gchar *lab, int size, float xalign, int pid, int lid, float *values, opengl_edition *ogl_win)
create OpenGL setting entries table
void set_data_pos(vec3_t *vect, int pos, double v)
modify a vector component
G_MODULE_EXPORT void set_fog_param(GtkRange *range, gpointer data)
update OpenGL fog parameter - range callback
G_MODULE_EXPORT void update_light_param(GtkEntry *res, gpointer data)
update light parameter
G_MODULE_EXPORT void toggled_delete_ligth(GtkToggleButton *but, gpointer data)
toggle delete light callback GTK3
void add_remove_lights(int val, gpointer data)
add or remove lights
GtkWidget * adv_box(GtkWidget *box, char *lab, int vspace, int size, float xalign)
create a box with markup label
G_MODULE_EXPORT void scale_quality(GtkRange *range, gpointer data)
update OpenGL quality - range callback
G_MODULE_EXPORT void set_l_model(GtkComboBox *box, gpointer data)
change OpenGL lightning model
GtkWidget * bdv_box(GtkWidget *box, char *lab, int size, float xalign)
create a box with markup label
void param_has_changed(gpointer data, double val)
update OpenGL material parameter
G_MODULE_EXPORT void set_r_model(GtkComboBox *box, gpointer data)
change OpenGL rendering model
GtkWidget * lights_tab(glwin *view, opengl_edition *ogl_edit, Lightning *ogl_lightning)
OpenGL light(s) parameters tab.
Light * copy_light_source(Light *old_sp)
create a copy of a light source
G_MODULE_EXPORT gboolean scroll_scale_param(GtkRange *range, GtkScrollType scroll, gdouble value, gpointer data)
update OpenGL material parameter - scroll callback
G_MODULE_EXPORT void set_light_type(GtkComboBox *box, gpointer data)
set light type callback
G_MODULE_EXPORT void run_light_source_to_be_removed(GtkDialog *win, gint response_id, gpointer data)
remove light source(s) - running the dialog
void create_lights_combo(int num_lights, opengl_edition *ogl_win)
create light combo box