static void load_file(GtkWidget *w, GtkFileSelection *selector) { int texnum; gchar *filename; if(curr_obj < 0) { quick_message("No object selected."); gtk_widget_hide(GTK_WIDGET(selector)); return; } filename = gtk_file_selection_get_filename(selector); texnum = bind_tex(filename, 256, 256, 0); if(texnum == 0) { quick_message("Unable to load image."); gtk_widget_hide(GTK_WIDGET(selector)); return; } if(aw_object[curr_obj].texnum) glDeleteTextures(1, (GLuint*)&aw_object[curr_obj].texnum); aw_object[curr_obj].texnum = texnum; aw_object[curr_obj].object_changed = TRUE; gtk_widget_hide(GTK_WIDGET(selector)); gl_redraw_all(); }
void on_hidden_surface_removal_activate (GtkMenuItem *menuitem, gpointer user_data) { int j; hidden_surface_removal = !hidden_surface_removal; for(j = 0; j < num_objects; j++) aw_object[j].object_changed = TRUE; gl_redraw_all(); }
void color_changed(GtkWidget *w, GtkColorSelection *colorsel) { gdouble color[3]; gtk_color_selection_get_color(colorsel, color); if(curr_obj < 0) quick_message("No object selected."); aw_object[curr_obj].color[0] = color[0]; aw_object[curr_obj].color[1] = color[1]; aw_object[curr_obj].color[2] = color[2]; aw_object[curr_obj].object_changed = TRUE; gl_redraw_all(); }
void on_invert_normals_activate(GtkMenuItem *m, gpointer data) { BINV(aw_object[curr_obj].invert_normals); aw_object[curr_obj].object_changed = TRUE; gl_redraw_all(); }
void on_opengl_hidden_surface_removal_activate (GtkMenuItem *menuitem, gpointer user_data) { opengl_hidden_surface_removal = !opengl_hidden_surface_removal; gl_redraw_all(); }
void on_vertex_normals_activate (GtkMenuItem *menuitem, gpointer user_data) { int j; vertex_normals_on = !vertex_normals_on; for(j = 0; j < num_objects; j++) aw_object[j].object_changed = TRUE; gl_redraw_all(); }
void on_axes_activate (GtkMenuItem *menuitem, gpointer user_data) { axes_on = !axes_on; gl_redraw_all(); }
void on_lighting_activate (GtkMenuItem *menuitem, gpointer user_data) { int j; lighting_on = !lighting_on; for(j = 0; j < num_objects; j++) aw_object[j].object_changed = TRUE; gl_redraw_all(); }
void on_smooth_shading_activate (GtkMenuItem *menuitem, gpointer user_data) { int j; polygon_mode = SMOOTH; for(j = 0; j < num_objects; j++) aw_object[j].object_changed = TRUE; gl_redraw_all(); }
void on_wireframe_activate (GtkMenuItem *menuitem, gpointer user_data) { int j; polygon_mode = WIREFRAME; for(j = 0; j < num_objects; j++) aw_object[j].object_changed = TRUE; gl_redraw_all(); }