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>"
137gchar *
lpos[3] = {
"x",
"y",
"z"};
138gchar *
cpos[3] = {
"r",
"g",
"b"};
150GtkWidget *
adv_box (GtkWidget * box,
char *
lab,
int size,
float xalign)
173 if (gtk_check_button_get_active (but))
185 if (gtk_toggle_button_get_active (but))
221 for (i=0; i<
img -> lights; i++)
224 if (gtk_check_button_get_active (GTK_CHECK_BUTTON(
light_but[i])))
226 if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(
light_but[i])))
250 GtkWidget * win =
dialogmodal (
"Remove light source(s)", GTK_WINDOW(ogl_edit -> win));
252 d_close = gtk_dialog_get_widget_for_response (GTK_DIALOG (win), GTK_RESPONSE_CLOSE);
256 str = g_strdup_printf (
"Please select the %d light sources to be removed: ",
val);
260 str = g_strdup_printf (
"Please select the %d light source to be removed: ",
val);
265 for (i=0; i<
img -> lights; i++)
267 str = g_strdup_printf (
"Light N°%d", i+1);
288 g_debug (
"Light N°%d", i);
289 g_debug (
"Type= %d", source.
type);
327 new_light.
type = type;
328 new_light.
fix = (type != 1) ? 0 : 1;
330 new_light.
direction = vec3(0.0, 0.0, 0.0);
335 intensity *= exp (
val/vbl);
337 if (vbl <= 50.0) intensity *= vbl / 100.0;
339 new_light.
intensity = vec3 (intensity, intensity, intensity);
341 new_light.
spot_data = vec3 (20.0, 20.0, 20.0);
344 new_light.
position = vec3 (0.0, 0.0, 0.0);
345 new_light.
direction = vec3 (0.0, 0.0, -1.0);
349 new_light.
position = vec3 (vbl*1.5, 0.0, 0.0);
353 float tan = (
val * sqrt(2.0) / 2.0) / (vbl -
val);
354 float tetha = fabs(atanf (tan)) * 90.0 /
pi;
355 new_light.
spot_data = vec3 (tetha, tetha, tetha);
394 Light * new_sp = g_malloc (dima*
sizeof * new_sp);
395 for (j=0; j<dimb; j++)
424 this_light -> type = tid;
430 if ((i == 0 && this_light -> type != 0) || (i == 1 && this_light -> type != 1))
441 if (this_light -> type != 0)
459 gtk_combo_box_set_active (GTK_COMBO_BOX(ogl_win -> light_type), this_light -> type);
460 gtk_combo_box_set_active (GTK_COMBO_BOX(ogl_win -> light_fix), this_light -> fix);
478 gtk_check_button_set_active (GTK_CHECK_BUTTON(ogl_win -> light_show), this_light -> show);
480 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(ogl_win -> light_show), this_light -> show);
494 int li = gtk_combo_box_get_active (box);
511 for (i=0; i<this_image -> lights; i++)
513 str = g_strdup_printf (
"Light N°%d", i+1);
517 gtk_widget_set_size_request (ogl_win -> lights, 100, -1);
518 g_signal_connect (G_OBJECT (ogl_win -> lights),
"changed", G_CALLBACK(
show_light_param), ogl_win);
519 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, ogl_win -> lights_box, ogl_win -> lights, FALSE, FALSE, 10);
535 image * this_image = view -> anim -> last ->
img;
536 gboolean delete_ligth;
537 i = this_image -> lights;
542 g_debug (
"ADDING_LIGHT_SOURCE:: val= %d, i= %d",
val, i);
546 g_free (this_image -> l_ght);
548 this_image -> lights =
val;
549 float pos = (this_proj -> cell.box[0].param[0][0] == 0.0) ? 20.0 : this_proj -> cell.box[0].param[0][0];
550 for (j=i; j<
val; j++)
552 this_image -> l_ght[j] =
init_light_source (0, pos, this_proj -> modelgl -> p_moy);
560 g_debug (
"REMOVING_LIGHT_SOURCE:: val= %d, i= %d",
val, i);
566 for (k=0; k < i-
val; k++)
569 g_debug (
"REMOVING_LIGHT_SOURCES:: k= %d, ltr[%d]= %d", k, k, ltr[k]);
572 g_free (this_image -> l_ght);
573 this_image -> l_ght = g_malloc (
val*
sizeof*this_image -> l_ght);
577 delete_ligth = FALSE;
578 for (k=0; k< i-
val; k++)
580 if (j == ltr[k]) delete_ligth = TRUE;
589 this_image -> lights =
val;
591 g_debug (
"LIGHT(s) HAVE BEEN REMOVED:: NEW_LIGHTS_NUM= %d",
val);
596 view -> create_shaders[
LIGHT] = TRUE;
600 gtk_combo_box_set_active (GTK_COMBO_BOX(view -> opengl_win -> lights), 0);
647 if (view -> opengl_win)
649 int li = gtk_combo_box_get_active (GTK_COMBO_BOX(view -> opengl_win -> lights));
650 Light * this_light = & view -> anim -> last ->
img -> l_ght[li];
656 this_light -> attenuation.x = v;
659 this_light -> attenuation.y = v;
662 this_light -> attenuation.z = v;
665 this_light -> spot_data.x = v;
668 this_light -> spot_data.y = v;
671 this_light -> spot_data.z = v;
675 if (this_light -> show) view -> create_shaders[
LIGHT] = TRUE;
719 image * this_image = view -> anim -> last ->
img;
724 else if (
id ->
b == 4)
728 else if (
id ->
b > 0 && view -> opengl_win)
730 int li = gtk_combo_box_get_active (GTK_COMBO_BOX(view -> opengl_win -> lights));
737 set_data_pos (& this_image -> l_ght[li].direction,
id ->
c, v);
740 set_data_pos (& this_image -> l_ght[li].intensity,
id ->
c, v);
743 if (this_image -> l_ght[li].show) view -> create_shaders[
LIGHT] = TRUE;
760 int li = gtk_combo_box_get_active (GTK_COMBO_BOX(ogl_win -> lights));
761 int ti = gtk_combo_box_get_active (box);
777 int li = gtk_combo_box_get_active (GTK_COMBO_BOX(ogl_win -> lights));
778 view -> anim -> last ->
img -> l_ght[li].fix = gtk_combo_box_get_active (box);
779 view -> create_shaders[
LIGHT] = TRUE;
792G_MODULE_EXPORT
void show_this_light (GtkCheckButton * but, gpointer data)
807 int li = gtk_combo_box_get_active (GTK_COMBO_BOX(ogl_win -> lights));
809 view -> anim -> last ->
img -> l_ght[li].show = gtk_check_button_get_active (but);
811 view -> anim -> last ->
img -> l_ght[li].show = gtk_toggle_button_get_active (but);
813 view -> create_shaders[
LIGHT] = TRUE;
831 if (pid != 0)
abox (setting_pos,
settings[(pid < 4) ? 1 : 2][lid], 0);
837 ogl_win -> pos_pointer[pid][i].a = ogl_win ->
proj;
838 ogl_win -> pos_pointer[pid][i].b = pid;
839 ogl_win -> pos_pointer[pid][i].c = i;
840 if (pid > 0 && pid < 3)
849 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, box, ogl_win -> entogl[pid][i], FALSE, FALSE, 0);
855 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, box, ogl_win -> light_show, FALSE, FALSE, 15);
871 image * this_image = view -> anim -> last ->
img;
873 GtkWidget *
hbox, * lhbox;
878 GtkWidget * box =
abox (
vbox,
"Number of light sources:\n(add or remove lights - up to 10 sources)", 10);
879 gtk_widget_set_size_request (box, -1, 65);
882 gtk_widget_set_size_request (nlights, 25, -1);
883 GtkWidget * fix = gtk_fixed_new ();
885 gtk_fixed_put (GTK_FIXED (fix), nlights, 0, 10);
886 box =
abox (
vbox,
"Configure light source:", 0);
888 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, box, ogl_edit -> lights_box, FALSE, FALSE, 10);
891 add_box_child_start (GTK_ORIENTATION_VERTICAL,
vbox, gtk_label_new (
"Note: it is mandatory for light N°1 to be a directional light"), FALSE, FALSE, 10);
893 box =
abox (
vbox,
"Light configuration: ", 0);
897 gchar * ltype[3] = {
"Directional",
"Point",
"Spot"};
902 g_signal_connect (G_OBJECT (ogl_edit -> light_type),
"changed", G_CALLBACK(
set_light_type), ogl_edit);
905 add_box_child_start (GTK_ORIENTATION_HORIZONTAL,
hbox, gtk_label_new(
"Fixed by respect to: "), FALSE, FALSE, 10);
907 gchar * lfix[2] = {
"The viewer",
"The model"};
912 g_signal_connect (G_OBJECT (ogl_edit -> light_fix),
"changed", G_CALLBACK(
set_light_fix), ogl_edit);
915 float values[3] = {0.0, 0.0, 0.0};
926 add_box_child_start (GTK_ORIENTATION_VERTICAL, ogl_edit -> advanced_light_box,
markup_label(
"<b>Advanced parameters:</b>", -1, -1, 0.1, 0.65), FALSE, FALSE, 25);
937 lhbox =
adv_box (ogl_edit -> light_b_entry[i],
settings[1][k+3], 170, 0.0);
938 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, lhbox, ogl_edit -> light_entry[k], FALSE, FALSE, 10);
939 if (i == 1)
add_box_child_start (GTK_ORIENTATION_HORIZONTAL, lhbox, gtk_label_new(
"°"), FALSE, FALSE, 5);
944 gtk_combo_box_set_active (GTK_COMBO_BOX(ogl_edit -> lights), 0);
974 i = gtk_combo_box_get_active (GTK_COMBO_BOX(view -> opengl_win ->
templates));
976 j = gtk_check_button_get_active (but);
978 j = gtk_toggle_button_get_active (but);
984 gtk_combo_box_set_active (GTK_COMBO_BOX(view -> opengl_win ->
templates), i);
991 view -> anim -> last ->
img -> m_terial.predefine = k;
1009 Material * mat = & view -> anim -> last ->
img -> m_terial;
1010 i = gtk_combo_box_get_active (box);
1019 mat -> predefine = i + 1;
1035 view -> anim -> last ->
img -> m_terial.param[0] = gtk_combo_box_get_active (box);
1051 Material * mat = & view -> anim -> last ->
img -> m_terial;
1053 if (view -> opengl_win)
1056 gtk_range_set_value (GTK_RANGE(view -> opengl_win -> m_scale[mid ->
b]), mat ->
param[mid ->
b + 1]);
1086G_MODULE_EXPORT gboolean
scroll_scale_param (GtkRange * range, GtkScrollType scroll, gdouble value, gpointer data)
1115G_MODULE_EXPORT gboolean
scroll_scale_quality (GtkRange * range, GtkScrollType scroll, gdouble value, gpointer data)
1119 update_menu_bar ((
glwin *)data);
1134 set_quality ((
int)gtk_range_get_value (range), data);
1136 update_menu_bar ((
glwin *)data);
1153 Material * this_material = & view -> anim -> last ->
img -> m_terial;
1155 GtkWidget * box =
adv_box (
vbox,
"<b>Quality</b>: ", 100, 1.0);
1160 GtkWidget * fix = gtk_fixed_new ();
1162 gtk_fixed_put (GTK_FIXED (fix), lmodel, 0, 10);
1164 char * l_model[6] = {
"None",
"Phong",
"Blinn",
"Cook-Torrance-Blinn",
"Cook-Torrance-Beckmann",
"Cook-Torrance-GCX"};
1169 g_signal_connect (G_OBJECT (lmodel),
"changed", G_CALLBACK(
set_l_model), view);
1170 gtk_widget_set_size_request (lmodel, 100, -1);
1171 gtk_combo_box_set_active (GTK_COMBO_BOX(lmodel), this_material ->
param[0]);
1173 add_box_child_start (GTK_ORIENTATION_VERTICAL,
vbox, gtk_separator_new (GTK_ORIENTATION_HORIZONTAL), FALSE, FALSE, 10);
1177 box =
abox (
vbox,
"<b>Templates</b>: ", 0);
1183 gtk_combo_box_set_active (GTK_COMBO_BOX(ogl_edit ->
templates), this_material -> predefine-1);
1185 gtk_widget_set_size_request (ogl_edit ->
templates, 100, -1);
1187 add_box_child_start (GTK_ORIENTATION_VERTICAL,
vbox, gtk_separator_new (GTK_ORIENTATION_HORIZONTAL), FALSE, FALSE, 10);
1193 box =
abox (ogl_edit -> param_mat,
"Material properties: ", 0);
1195 box =
abox (ogl_edit -> param_mat,
"Material properties: ", 5);
1197 GtkWidget * m_fixed;
1203 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, box, ogl_edit -> m_scale[i], FALSE, FALSE, 10);
1206 m_fixed = gtk_fixed_new ();
1207 gtk_fixed_put (GTK_FIXED(m_fixed), ogl_edit -> m_entry[i], 0, 15);
1210 float values[] = {this_material -> albedo.x,
1211 this_material -> albedo.y,
1212 this_material -> albedo.z};
1237 Fog * this_fog = & view -> anim -> last ->
img -> f_g;
1241 v = this_fog -> depth[0];
1242 w = this_fog -> depth[1];
1243 if (fid ->
b == 1 && u < w)
1245 this_fog -> depth[0] = u;
1247 else if (fid ->
b == 2 && u > v)
1249 this_fog -> depth[1] = u;
1251 else if (view -> opengl_win)
1255 gtk_range_set_value (range, (gdouble) (w-0.1));
1259 gtk_range_set_value (range, (gdouble) (v+0.1));
1265 this_fog -> density = u;
1280G_MODULE_EXPORT gboolean
scroll_set_fog_param (GtkRange * range, GtkScrollType scroll, gdouble value, gpointer data)
1310 Fog * this_fog = & view -> anim -> last ->
img -> f_g;
1311 this_fog -> based = gtk_combo_box_get_active (GTK_COMBO_BOX(widg));
1325 Fog * this_fog = & view -> anim -> last ->
img -> f_g;
1326 this_fog -> mode = fid;
1327 if (this_fog -> mode)
1330 if (this_fog -> mode == 1)
1372 Fog * this_fog = & view -> anim -> last ->
img -> f_g;
1376 GtkWidget * box =
abox (
vbox,
"Select fog mode:", 10);
1382 gtk_widget_set_size_request (fogmod, 100, -1);
1383 gtk_combo_box_set_active (GTK_COMBO_BOX(fogmod), this_fog -> mode);
1384 g_signal_connect (G_OBJECT (fogmod),
"changed", G_CALLBACK(
set_fog_mode), view);
1390 box =
abox (ogl_edit -> param_fog,
" Fog type: ", 0.0);
1394 gtk_widget_set_size_request (fogtype, 100, -1);
1395 gtk_combo_box_set_active (GTK_COMBO_BOX(fogtype), this_fog -> based);
1396 g_signal_connect (G_OBJECT (fogtype),
"changed", G_CALLBACK(
set_fog_type), view);
1399 ogl_edit -> dens_box =
abox (ogl_edit -> param_fog,
" Fog density: ", 0.0);
1400 ogl_edit -> fog_range[0] =
create_hscale (0.0, 1.0, 0.0001, this_fog -> density, GTK_POS_LEFT, 5,
1402 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, ogl_edit -> dens_box, ogl_edit -> fog_range[0], FALSE, FALSE, 0);
1404 char * depthfog[2] = {
"\t depth<sup>*</sup> start: ",
"\t depth<sup>*</sup> end: "};
1407 add_box_child_start (GTK_ORIENTATION_VERTICAL, ogl_edit -> param_fog, ogl_edit -> depth_box, FALSE, FALSE, 0);
1408 box =
abox (ogl_edit -> depth_box,
" Fog depth: ", 0.0);
1412 box =
adv_box (ogl_edit -> depth_box, depthfog[i], 170, 0.0);
1413 ogl_edit -> fog_range[i+1] =
create_hscale (0.0, 100.0, 0.1, this_fog -> depth[i], GTK_POS_LEFT, 2,
1415 add_box_child_start (GTK_ORIENTATION_HORIZONTAL, box, ogl_edit -> fog_range[i+1], FALSE, FALSE, 0);
1417 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);
1419 float values[] = {this_fog ->
color.x,
1420 this_fog ->
color.y,
1421 this_fog ->
color.z};
1438 g_free (view -> opengl_win);
1439 view -> opengl_win = NULL;
1451G_MODULE_EXPORT gboolean
close_advanced (GtkWidget * window, gpointer data)
1462G_MODULE_EXPORT gboolean
close_advanced (GtkWidget * widg, GdkEvent * event, gpointer data)
1480 if (view -> opengl_win == NULL)
1482 view -> opengl_win = g_malloc0 (
sizeof*view -> opengl_win);
1483 view -> opengl_win ->
proj = view ->
proj;
1487 view -> opengl_win -> pointer[i].a = view ->
proj;
1488 view -> opengl_win -> pointer[i].b = i;
1490 gchar * str = g_strdup_printf (
"OpenGL material aspect and light settings - %s",
get_project_by_id(view ->
proj) -> name);
1491 view -> opengl_win -> win =
create_win (str, view -> win, FALSE, FALSE);
1494 gtk_window_set_resizable (GTK_WINDOW (view -> opengl_win -> win), TRUE);
1499 gtk_widget_set_size_request (
vbox, 650 , 650);
1501 gtk_widget_set_size_request (
vbox, 650 , 630);
1503 GtkWidget * notebook = gtk_notebook_new ();
1506 gtk_widget_set_vexpand (notebook, TRUE);
1509 gtk_notebook_append_page (GTK_NOTEBOOK(notebook),
materials_tab (view, view -> opengl_win),
markup_label(
"<b>Material aspect</b>", -1, -1, 0.0, 0.5));
1510 gtk_notebook_append_page (GTK_NOTEBOOK(notebook),
lights_tab (view, view -> opengl_win),
markup_label(
"<b>Configure light sources</b>", -1, -1, 0.0, 0.5));
1511 gtk_notebook_append_page (GTK_NOTEBOOK(notebook),
fog_tab (view, view -> opengl_win),
markup_label(
"<b>Configure fog</b>", -1, -1, 0.0, 0.5));
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
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
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
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
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)
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)
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
GtkWidget * abox(GtkWidget *box, char *lab, int vspace)
box creating routine, to help design faster elements for the GUI
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.
Function declarations for the creation of the OpenGL window.
Messaging function 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
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
int * light_source_to_be_removed(int val, image *img, opengl_edition *ogl_edit)
remove light source(s) - creating the dialog
G_MODULE_EXPORT void set_fog_type(GtkWidget *widg, gpointer data)
set OpenGL 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
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 init_light_source(int type, float val, float vbl)
initialize a light source
GtkWidget * materials_tab(glwin *view, opengl_edition *ogl_edit)
OpenGL material parameters tab.
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
G_MODULE_EXPORT void show_this_light(GtkToggleButton *but, gpointer data)
show / hide this light callback GTK3
GtkWidget * fog_tab(glwin *view, opengl_edition *ogl_edit)
OpenGL fog parameters tab.
G_MODULE_EXPORT gboolean scroll_set_fog_param(GtkRange *range, GtkScrollType scroll, gdouble value, gpointer data)
update OpenGL fog parameter - scroll callback
GtkWidget * lights_tab(glwin *view, opengl_edition *ogl_edit)
OpenGL light(s) parameters tab.
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 create_lights_combo(image *this_image, opengl_edition *ogl_win)
create light combo box
void update_light_data(int li, opengl_edition *ogl_win)
update light data
GtkWidget * create_setting_pos(int pid, int lid, float *values, opengl_edition *ogl_win)
create OpenGL setting entries table
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
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
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
void setup_fog_dialogs(glwin *view, int fid)
update OpenGL fog tab based of fog type
void param_has_changed(gpointer data, double val)
update OpenGL material parameter
G_MODULE_EXPORT gboolean scroll_scale_param(GtkRange *range, GtkScrollType scroll, gdouble value, gpointer data)
update OpenGL material parameter - scroll callback
GtkWidget * adv_box(GtkWidget *box, char *lab, int size, float xalign)
create a box with markup label
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