106 {0.90, 0.60, 1.00, 1.50, 1.00},
107 {0.80, 0.40, 1.00, 1.00, 1.00},
108 {0.35, 0.15, 1.00, 1.50, 1.00},
109 {0.50, 0.50, 0.50, 1.00, 0.50},
110 {0.50, 0.50, 0.50, 1.00, 0.75},
111 {0.35, 0.80, 1.00, 1.50, 1.00}};
122 "<u>Ambient occlusion:</u>",
123 "<u>Gamma correction:</u>",
128 "<u>Constant attenuation:</u>",
129 "<u>Linear attenuation:</u>",
130 "<u>Quadratic attenuation:</u>",
132 "<u>Inner cutoff:</u>",
133 "<u>Outer cutoff:</u>",
135 {
"<b>Fog color</b>"}};
137gchar *
lpos[3] = {
"x",
"y",
"z"};
138gchar *
cpos[3] = {
"r",
"g",
"b"};
151GtkWidget *
adv_box (GtkWidget *
box,
char *
lab,
int vspace,
int size,
float xalign)
237 for (i=0; i<ogl_lightning -> lights; i++)
262 GtkWidget * win =
dialogmodal (
"Remove light source(s)", GTK_WINDOW(ogl_edit -> win));
264 d_close = gtk_dialog_get_widget_for_response (GTK_DIALOG (win), GTK_RESPONSE_CLOSE);
268 str = g_strdup_printf (
"Please select the %d light sources to be removed: ",
val);
272 str = g_strdup_printf (
"Please select the %d light source to be removed: ",
val);
277 for (i=0; i<ogl_lightning -> lights; i++)
279 str = g_strdup_printf (
"Light N°%d", i+1);
300 g_debug (
"Light N°%d", i);
301 g_debug (
"Type= %d", source.
type);
340 new_light.
type = type;
341 new_light.
fix = (type != 1) ? 0 : 1;
343 new_light.
direction = vec3(0.0, 0.0, 0.0);
347 intensity *= exp (size/depth);
349 if (!
preferences && depth <= 50.0) intensity *= depth / 100.0;
350 new_light.
intensity = vec3 (intensity, intensity, intensity);
352 new_light.
spot_data = vec3 (20.0, 20.0, 20.0);
355 new_light.
position = vec3 (0.0, 0.0, 0.0);
356 new_light.
direction = vec3 (0.0, 0.0, -1.0);
360 new_light.
position = vec3 (depth*1.5, 0.0, 0.0);
364 float tan = (size * sqrt(2.0) / 2.0) / (depth - size);
365 float tetha = fabs(atanf (tan)) * 90.0 /
pi;
366 new_light.
spot_data = vec3 (tetha, tetha, tetha);
405 Light * new_sp = g_malloc (dima*
sizeof * new_sp);
406 for (j=0; j<dimb; j++)
435 this_light -> type = tid;
446 if (this_light -> type)
451 if (this_light -> type == 0 || this_light -> type == 2)
455 if (this_light -> type == 2)
536 for (i=0; i<num_lights; i++)
538 str = g_strdup_printf (
"Light N°%d", i+1);
542 gtk_widget_set_size_request (ogl_win -> lights, 100, -1);
543 g_signal_connect (G_OBJECT (ogl_win -> lights),
"changed", G_CALLBACK(
show_light_param), ogl_win);
544 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, ogl_win -> lights_box, ogl_win -> lights, FALSE, FALSE, 10);
564 view = (
glwin *)data;
566 this_lightning = & view -> anim -> last ->
img -> l_ghtning;
567 ogl_edit = view -> opengl_win;
575 gboolean delete_ligth;
576 i = this_lightning -> lights;
581 g_debug (
"ADDING_LIGHT_SOURCE:: val= %d, i= %d",
val, i);
585 g_free (this_lightning -> spot);
587 this_lightning -> lights =
val;
588 float pos = (
preferences) ? 20.0 : (this_proj -> cell.box[0].param[0][0] == 0.0) ? 20.0 : this_proj -> cell.box[0].param[0][0];
589 for (j=i; j<
val; j++)
599 g_debug (
"REMOVING_LIGHT_SOURCE:: val= %d, i= %d",
val, i);
605 for (k=0; k < i-
val; k++)
608 g_debug (
"REMOVING_LIGHT_SOURCES:: k= %d, ltr[%d]= %d", k, k, ltr[k]);
611 g_free (this_lightning -> spot);
612 this_lightning -> spot = g_malloc (
val*
sizeof*this_lightning -> spot);
616 delete_ligth = FALSE;
617 for (k=0; k< i-
val; k++)
619 if (j == ltr[k]) delete_ligth = TRUE;
628 this_lightning -> lights =
val;
630 g_debug (
"LIGHT(s) HAVE BEEN REMOVED:: NEW_LIGHTS_NUM= %d",
val);
641 view -> create_shaders[
LIGHT] = TRUE;
698 this_light -> attenuation.x = v;
701 this_light -> attenuation.y = v;
704 this_light -> attenuation.z = v;
707 this_light -> spot_data.x = v;
710 this_light -> spot_data.y = v;
713 this_light -> spot_data.z = v;
717 if (this_light -> show) view -> create_shaders[
LIGHT] = TRUE;
768 the_mat = & view -> anim -> last ->
img -> m_terial;
769 the_lightning = & view -> anim -> last ->
img -> l_ghtning;
770 the_fog = & view -> anim -> last ->
img -> f_g;
771 edit_ogl = view -> opengl_win;
784 else if (
id ->
b == 4)
788 else if (
id ->
b > 0 && edit_ogl)
797 set_data_pos (& the_lightning -> spot[li].direction,
id ->
c, v);
800 set_data_pos (& the_lightning -> spot[li].intensity,
id ->
c, v);
803 if (the_lightning -> spot[li].show && !
preferences) view -> create_shaders[
LIGHT] = TRUE;
841 ogl_ligthning = & view -> anim -> last ->
img -> l_ghtning;
851 view -> create_shaders[
LIGHT] = TRUE;
865G_MODULE_EXPORT
void show_this_light (GtkCheckButton * but, gpointer data)
882 view -> create_shaders[
LIGHT] = TRUE;
907 gtk_widget_set_size_request (sbox, 500, -1);
912 ogl_win -> pos_pointer[pid][i].a = ogl_win ->
proj;
913 ogl_win -> pos_pointer[pid][i].b = pid;
914 ogl_win -> pos_pointer[pid][i].c = i;
918 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, sbox, ogl_win -> entogl[pid][i], FALSE, FALSE, 0);
924 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, sbox, ogl_win -> light_show, FALSE, FALSE, 10);
942 GtkWidget *
hbox, * lhbox;
946 hbox =
bdv_box (
vbox,
"<b>Number of light sources</b>\n(add or remove lights - up to 10 sources)", 250, 0.0);
947 gtk_widget_set_size_request (
hbox, -1, 65);
950 gtk_widget_set_size_request (nlights, 25, -1);
951 GtkWidget * fix = gtk_fixed_new ();
953 gtk_fixed_put (GTK_FIXED (fix), nlights, 0, 20);
955 hbox =
bdv_box (
vbox,
"<b>Configure light source <sup>*</sup></b>", 250, 0.0);
960 bdv_box (
vbox,
"<b>Light configuration</b>", 250, 0.0);
964 gchar * ltype[3] = {
"Directional",
"Point",
"Spot"};
969 g_signal_connect (G_OBJECT (ogl_edit -> light_type),
"changed", G_CALLBACK(
set_light_type), ogl_edit);
972 add_box_child_start (GTK_ORIENTATION_HORIZONTAL,
hbox, gtk_label_new(
"Fixed by respect to: "), FALSE, FALSE, 10);
974 gchar * lfix[2] = {
"The viewer",
"The model"};
979 g_signal_connect (G_OBJECT (ogl_edit -> light_fix),
"changed", G_CALLBACK(
set_light_fix), ogl_edit);
982 float values[3] = {0.0, 0.0, 0.0};
985 ogl_edit -> light_b_coord[0] =
create_setting_pos (str, 130, 0.0, 1, 0, values, ogl_edit);
993 add_box_child_start (GTK_ORIENTATION_VERTICAL,
vbox,
create_setting_pos (str, 130, 0.0, 3, 2, values, ogl_edit), FALSE, FALSE, 0);
999 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);
1001 add_box_child_start (GTK_ORIENTATION_VERTICAL, ogl_edit -> advanced_light_box, lbox, FALSE, FALSE, 0);
1008 add_box_child_start (GTK_ORIENTATION_VERTICAL, lvbox, ogl_edit -> light_b_entry[i], FALSE, FALSE, 0);
1013 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, lhbox, ogl_edit -> light_entry[k], FALSE, FALSE, 10);
1014 if (i == 1)
add_box_child_start (GTK_ORIENTATION_HORIZONTAL, lhbox, gtk_label_new(
"°"), FALSE, FALSE, 0);
1022 append_comments (
vbox,
"<sup>*</sup>",
"Note that light N°1 must be a directional light");
1058 view = (
glwin *)data;
1059 ogl_edit = view -> opengl_win;
1060 the_mat = & view -> anim -> last ->
img -> m_terial;
1073 the_mat -> albedo = vec3(0.5, 0.5, 0.5);
1080 gtk_range_set_value (GTK_RANGE(ogl_edit -> m_scale[k]), the_mat ->
param[k+1]);
1096 the_mat -> predefine = k;
1126 view = (
glwin *)data;
1127 the_mat = & view -> anim -> last ->
img -> m_terial;
1128 ogl_edit = view -> opengl_win;
1131 the_mat -> predefine = i + 1;
1141 gtk_range_set_value (GTK_RANGE(ogl_edit -> m_scale[j]), the_mat ->
param[j+1]);
1197 edit_ogl = view -> opengl_win;
1198 the_mat = & view -> anim -> last ->
img -> m_terial;
1204 gtk_range_set_value (GTK_RANGE(edit_ogl -> m_scale[mid ->
b]), the_mat ->
param[mid ->
b + 1]);
1234G_MODULE_EXPORT gboolean
scroll_scale_param (GtkRange * range, GtkScrollType scroll, gdouble value, gpointer data)
1263G_MODULE_EXPORT gboolean
scroll_scale_quality (GtkRange * range, GtkScrollType scroll, gdouble value, gpointer data)
1282 set_quality ((
int)gtk_range_get_value (range), data);
1298 GtkWidget * fix = gtk_fixed_new ();
1300 gtk_fixed_put (GTK_FIXED (fix), lmodel, 0, 10);
1302 char * l_model[6] = {
"None",
"Phong",
"Blinn",
"Cook-Torrance-Blinn",
"Cook-Torrance-Beckmann",
"Cook-Torrance-GCX"};
1308 g_signal_connect (G_OBJECT (lmodel),
"changed", G_CALLBACK(
set_l_model), view);
1309 gtk_widget_set_size_request (lmodel, 200, -1);
1335 add_box_child_start (GTK_ORIENTATION_VERTICAL,
vbox, gtk_separator_new (GTK_ORIENTATION_HORIZONTAL), FALSE, FALSE, 20);
1349 g_signal_connect (G_OBJECT (ogl_edit -> templates),
"changed", G_CALLBACK(
set_template), view);
1350 gtk_widget_set_size_request (ogl_edit -> templates, 100, -1);
1353 add_box_child_start (GTK_ORIENTATION_VERTICAL,
vbox, gtk_separator_new (GTK_ORIENTATION_HORIZONTAL), FALSE, FALSE, 20);
1362 bdv_box (ogl_edit -> param_mat,
"<b>Material properties</b>", 250, -1);
1364 GtkWidget * m_fixed;
1373 m_fixed = gtk_fixed_new ();
1374 gtk_fixed_put (GTK_FIXED(m_fixed), ogl_edit -> m_entry[i], 0, 15);
1377 float values[] = {the_mat -> albedo.x, the_mat -> albedo.y, the_mat -> albedo.z};
1379 add_box_child_start (GTK_ORIENTATION_VERTICAL, ogl_edit -> param_mat,
create_setting_pos (
ogl_settings[0][0], 130, -1, 0, 0, values, ogl_edit), FALSE, FALSE, 20);
1406 this_fog = & view -> anim -> last ->
img -> f_g;
1407 ogl_edit = view -> opengl_win;
1417 v = this_fog -> depth[0];
1418 w = this_fog -> depth[1];
1419 if (fid ->
b == 1 && u < w)
1421 this_fog -> depth[0] = u;
1423 else if (fid ->
b == 2 && u > v)
1425 this_fog -> depth[1] = u;
1431 gtk_range_set_value (range, (gdouble) (w-0.1));
1435 gtk_range_set_value (range, (gdouble) (v+0.1));
1441 this_fog -> density = u;
1456G_MODULE_EXPORT gboolean
scroll_set_fog_param (GtkRange * range, GtkScrollType scroll, gdouble value, gpointer data)
1491 this_fog = & view -> anim -> last ->
img -> f_g;
1516 this_fog = & view -> anim -> last ->
img -> f_g;
1522 this_fog -> mode = fid;
1523 if (this_fog -> mode)
1526 if (this_fog -> mode == 1)
1571 GtkWidget *
box =
adv_box (
vbox,
"<b>Fog mode</b> ", 10, 150, 0.0);
1577 gtk_widget_set_size_request (fogmod, 200, -1);
1579 g_signal_connect (G_OBJECT (fogmod),
"changed", G_CALLBACK(
set_fog_mode), ogl_edit);
1585 box =
adv_box (ogl_edit -> param_fog,
"<b>Fog type</b> ", 5, 150, 0.0);
1589 gtk_widget_set_size_request (fogtype, 200, -1);
1591 g_signal_connect (G_OBJECT (fogtype),
"changed", G_CALLBACK(
set_fog_type), ogl_edit);
1594 ogl_edit -> dens_box =
adv_box (ogl_edit -> param_fog,
"<b>Fog density</b>", 10, 150.0, 0.0);
1595 ogl_edit -> fog_range[0] =
create_hscale (0.0, 1.0, 0.01, the_fog -> density, GTK_POS_TOP, 3,
1597 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, ogl_edit -> dens_box, ogl_edit -> fog_range[0], FALSE, FALSE, 0);
1599 char * depthfog[2] = {
"\t depth<sup>*</sup> start: ",
"\t depth<sup>*</sup> end: "};
1602 add_box_child_start (GTK_ORIENTATION_VERTICAL, ogl_edit -> param_fog, ogl_edit -> depth_box, FALSE, FALSE, 0);
1603 box =
adv_box (ogl_edit -> depth_box,
"<b>Fog depth</b>", 10, 150.0, 0.0);
1607 box =
adv_box (ogl_edit -> depth_box, depthfog[i], 5, 170, 0.0);
1608 ogl_edit -> fog_range[i+1] =
create_hscale (0.0, 100.0, 0.1, the_fog -> depth[i], GTK_POS_TOP, 2,
1612 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);
1614 float values[] = {the_fog ->
color.x, the_fog ->
color.y, the_fog ->
color.z};
1615 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);
1631 g_free (view -> opengl_win);
1632 view -> opengl_win = NULL;
1644G_MODULE_EXPORT gboolean
close_advanced (GtkWidget * window, gpointer data)
1655G_MODULE_EXPORT gboolean
close_advanced (GtkWidget * widg, GdkEvent * event, gpointer data)
1673 if (view -> opengl_win == NULL)
1675 view -> opengl_win = g_malloc0 (
sizeof*view -> opengl_win);
1676 view -> opengl_win ->
proj = view ->
proj;
1680 view -> opengl_win -> pointer[i].a = view ->
proj;
1681 view -> opengl_win -> pointer[i].b = i;
1683 gchar * str = g_strdup_printf (
"OpenGL material aspect and light settings - %s",
get_project_by_id(view ->
proj) -> name);
1684 view -> opengl_win -> win =
create_win (str, view -> win, FALSE, FALSE);
1687 gtk_window_set_resizable (GTK_WINDOW (view -> opengl_win -> win), TRUE);
1692 gtk_widget_set_size_request (
vbox, 580, 670);
1694 gtk_widget_set_size_request (
vbox, 580, 650);
1696 GtkWidget * notebook = gtk_notebook_new ();
1699 gtk_widget_set_vexpand (notebook, TRUE);
1702 gtk_notebook_append_page (GTK_NOTEBOOK(notebook),
materials_tab (view, view -> opengl_win, & view -> anim -> last ->
img -> m_terial),
markup_label(
"<b>Material aspect</b>", -1, -1, 0.0, 0.5));
1703 gtk_notebook_append_page (GTK_NOTEBOOK(notebook),
lights_tab (view, view -> opengl_win, & view -> anim -> last ->
img -> l_ghtning),
1704 markup_label(
"<b>Configure light sources</b>", -1, -1, 0.0, 0.5));
1705 gtk_notebook_append_page (GTK_NOTEBOOK(notebook),
fog_tab (view, view -> opengl_win, & view -> anim -> last ->
img -> f_g),
markup_label(
"<b>Configure fog</b>", -1, -1, 0.0, 0.5));
void label(cairo_t *cr, double val, int axe, int p, project *this_proj)
draw axis label
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 * dialogmodal(gchar *str, GtkWindow *parent)
Create a new dialog modal window.
gboolean is_the_widget_visible(GtkWidget *widg)
test if a GtkWidget exist, then return if it is visible or not
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
GtkWidget * bbox(GtkWidget *box, char *lab)
box creating routine, to help design faster elements for the GUI
void add_container_child(int type, GtkWidget *widg, GtkWidget *child)
Add a GtkWidget into another GtkWidget.
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.
#define TEMPLATES
Number of material templates.
struct box box
box layout data structure
Function declarations for the creation of the OpenGL window.
Messaging function declarations.
opengl_edition * pref_ogl_edit
Preference variable declarations.
Light * copy_light_sources(int dima, int dimb, Light *old_sp)
create a copy of a list of light sources
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
Light init_light_source(int type, float size, float depth)
initialize a light source
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
gchar * material_template[TEMPLATES]
G_MODULE_EXPORT gboolean scroll_scale_quality(GtkRange *range, GtkScrollType scroll, gdouble value, gpointer data)
update OpenGL quality - scroll callback
Light copy_light_source(Light old_sp)
create a copy of a light source
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
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]
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
G_MODULE_EXPORT void set_nlights(GtkEntry *res, gpointer data)
change the number of light(s) - entry
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
GLfloat template_parameters[TEMPLATES][5]
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
GtkWidget * lights_tab(glwin *view, opengl_edition *ogl_edit, Lightning *ogl_lightning)
OpenGL light(s) parameters tab.
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