Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 28712 | Differences between
and this patch

Collapse All | Expand All

(-)3ddesktop-0.2.5/3ddeskd.cpp (-8 / +8 lines)
Lines 1392-1398 Link Here
1392
1392
1393
            if (msgmgr.msg.reload)
1393
            if (msgmgr.msg.reload)
1394
                cfg->reload();
1394
                cfg->reload();
1395
1395
                
1396
            if (GLWin.grab_screenshot_data() < 0) {
1396
            if (GLWin.grab_screenshot_data() < 0) {
1397
                msgout (ERROR, "couldn't grab screen image\n");
1397
                msgout (ERROR, "couldn't grab screen image\n");
1398
                end_program(-1);
1398
                end_program(-1);
Lines 1401-1407 Link Here
1401
            face_set->load_texture_data(current_col + (current_row * col_count), 
1401
            face_set->load_texture_data(current_col + (current_row * col_count), 
1402
                                        cfg->texture_size,
1402
                                        cfg->texture_size,
1403
                                        GLWin.get_screenshot_data_ptr() );
1403
                                        GLWin.get_screenshot_data_ptr() );
1404
            
1405
            continue;  // don't activate
1404
            continue;  // don't activate
1406
            
1405
            
1407
            break;
1406
            break;
Lines 1421-1427 Link Here
1421
                        msgout (DEBUG, "acquire sleep is %d\n", msgmgr.msg.acquire_sleep);
1420
                        msgout (DEBUG, "acquire sleep is %d\n", msgmgr.msg.acquire_sleep);
1422
                        sleep_ms (msgmgr.msg.acquire_sleep);
1421
                        sleep_ms (msgmgr.msg.acquire_sleep);
1423
                    }
1422
                    }
1424
                    
1423
1425
                    if (GLWin.grab_screenshot_data() < 0) {
1424
                    if (GLWin.grab_screenshot_data() < 0) {
1426
                        msgout (ERROR, "couldn't grab screen image\n");
1425
                        msgout (ERROR, "couldn't grab screen image\n");
1427
                        end_program(-1);
1426
                        end_program(-1);
Lines 1984-1991 Link Here
1984
1983
1985
                vdesks.set_vdesktop (j, i);
1984
                vdesks.set_vdesktop (j, i);
1986
1985
1987
                if (cfg->options->acquire > 1) 
1986
                if (cfg->options->acquire > 1) {
1987
                    msgout (DEBUG, "sleeping", cfg->options->acquire);   
1988
                    sleep_ms (cfg->options->acquire);
1988
                    sleep_ms (cfg->options->acquire);
1989
                }
1989
                
1990
                
1990
                if (GLWin.grab_screenshot_data() < 0) {
1991
                if (GLWin.grab_screenshot_data() < 0) {
1991
                    msgout (ERROR, "couldn't grab screen image\n");
1992
                    msgout (ERROR, "couldn't grab screen image\n");
Lines 1995-2013 Link Here
1995
                face_set->load_texture_data(j + (i * col_count), 
1996
                face_set->load_texture_data(j + (i * col_count), 
1996
                                            cfg->texture_size,
1997
                                            cfg->texture_size,
1997
                                            GLWin.get_screenshot_data_ptr() );
1998
                                            GLWin.get_screenshot_data_ptr() );
1999
                                            
1998
            }
2000
            }
1999
        }
2001
        }
2000
2001
        // go back to current
2002
        // go back to current
2002
        vdesks.set_vdesktop (current_col, current_row);
2003
        vdesks.set_vdesktop (current_col, current_row);
2003
2004
2004
    }
2005
    }
2005
2006
	
2006
    load_digits();
2007
    load_digits();
2007
2008
2008
    em.add_event (ENTRY_MOVEMENT_START, entry_move_start_hook, NULL, 1);
2009
    em.add_event (ENTRY_MOVEMENT_START, entry_move_start_hook, NULL, 1);
2009
    em.add_event (EXIT_MOVEMENT_START, exit_move_start_hook, NULL, 1);
2010
    em.add_event (EXIT_MOVEMENT_START, exit_move_start_hook, NULL, 1);                 
2010
                      
2011
} //  END initialize_3ddesktop
2011
} //  END initialize_3ddesktop
2012
2012
2013
2013
(-)3ddesktop-0.2.5/3ddesktop.conf (-1 / +5 lines)
Lines 33-45 Link Here
33
#                          (for debuggin: not really usable at this time)
33
#                          (for debuggin: not really usable at this time)
34
#   early_desktop_switch - When desktop is switched (default true)
34
#   early_desktop_switch - When desktop is switched (default true)
35
#   disable_keys_in_goto - Disable keys while in an automated "goto" (default true)
35
#   disable_keys_in_goto - Disable keys while in an automated "goto" (default true)
36
36
#   compression		 - enables texture compression, which saves about
37
#			   16MB of resident memory at the default
38
#			   texturesize
37
#
39
#
38
# Examples (uncomment to use)
40
# Examples (uncomment to use)
39
#
41
#
40
42
41
#texturesize 512
43
#texturesize 512
42
44
45
#compression 1
46
43
#wm          kde2
47
#wm          kde2
44
48
45
49
(-)3ddesktop-0.2.5/config.hpp (-3 / +7 lines)
Lines 72-78 Link Here
72
    char name[50];
72
    char name[50];
73
73
74
    // bits/bools on/off
74
    // bits/bools on/off
75
    int acquire : 1;
75
    int compression : 1; // texture compression
76
//    int acquire : 1;	 //acquire needs more than 1 bit (10<acquire<3000). initialised as int below.
76
    int show_fps : 1;
77
    int show_fps : 1;
77
    int show_digits : 1;
78
    int show_digits : 1;
78
    int do_fullscreen : 1;
79
    int do_fullscreen : 1;
Lines 99-105 Link Here
99
#else
100
#else
100
    char base_dir[PATH_MAX];
101
    char base_dir[PATH_MAX];
101
#endif
102
#endif
102
103
    int acquire;
103
    int random_fun_delay;    // 15
104
    int random_fun_delay;    // 15
104
105
105
    float animation_speed;  // ms between animations
106
    float animation_speed;  // ms between animations
Lines 147-152 Link Here
147
        __early_desktop_switch = 1;
148
        __early_desktop_switch = 1;
148
        __disable_keys_in_goto = 1;
149
        __disable_keys_in_goto = 1;
149
150
151
	compression = 0;	//disable texture-compression by default, could be slow on older boxen
150
        acquire = 0;
152
        acquire = 0;
151
        show_fps = 0;
153
        show_fps = 0;
152
        show_digits = 1;
154
        show_digits = 1;
Lines 325-330 Link Here
325
		end_program(-1);  // should I ignore this error?
327
		end_program(-1);  // should I ignore this error?
326
		break;
328
		break;
327
	    }
329
	    }
330
	} else if (strcmp(option, "compression") == 0) {
331
	    compression = get_boolean (value);   //could be nice to be able to select the type of compression
332
						//(COMPRESSED_RGBA_S3TC_DXT1_EXT, DXT3, DXT5,...)
328
333
329
	} else if (strcmp(option, "fastest") == 0) {
334
	} else if (strcmp(option, "fastest") == 0) {
330
	    use_context_switch = get_boolean (value);
335
	    use_context_switch = get_boolean (value);
Lines 441-447 Link Here
441
446
442
        } else if (strcmp(option, "disable_keys_in_goto") == 0) {
447
        } else if (strcmp(option, "disable_keys_in_goto") == 0) {
443
            __disable_keys_in_goto = get_boolean (value);
448
            __disable_keys_in_goto = get_boolean (value);
444
445
	}
449
	}
446
450
447
	return 0;  // success
451
	return 0;  // success
(-)3ddesktop-0.2.5/face.hpp (-2 / +3 lines)
Lines 238-245 Link Here
238
        
238
        
239
        glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER, MIN_FILTER);
239
        glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER, MIN_FILTER);
240
        glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER, MAX_FILTER);
240
        glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER, MAX_FILTER);
241
        
241
        if (cfg->options->compression == 0)
242
        gluBuild2DMipmaps(GL_TEXTURE_2D, 3, texture_size, texture_size, GL_RGBA, GL_UNSIGNED_BYTE, data);
242
        	gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, texture_size, texture_size, GL_RGBA, GL_UNSIGNED_BYTE, data);
243
        	else gluBuild2DMipmaps(GL_TEXTURE_2D, GL_COMPRESSED_RGBA, texture_size, texture_size, GL_RGBA, GL_UNSIGNED_BYTE, data);
243
    }
244
    }
244
245
245
};
246
};
(-)3ddesktop-0.2.5/win.cpp (-23 / +15 lines)
Lines 91-97 Link Here
91
91
92
GLWindow::~GLWindow() {
92
GLWindow::~GLWindow() {
93
    if (screenshot_data)
93
    if (screenshot_data)
94
        delete screenshot_data;
94
	delete screenshot_data;
95
}
95
}
96
96
97
int GLWindow::open_display() 
97
int GLWindow::open_display() 
Lines 129-135 Link Here
129
    imlib_context_set_anti_alias(1);
129
    imlib_context_set_anti_alias(1);
130
    imlib_context_set_blend(0);
130
    imlib_context_set_blend(0);
131
131
132
    img = imlib_create_image(screen_width, screen_height);
132
 //   img = imlib_create_image(screen_width, screen_height);
133
133
134
    XSetErrorHandler(X_errors_handler);
134
    XSetErrorHandler(X_errors_handler);
135
135
Lines 501-507 Link Here
501
            msgout (ERROR, "out of memory\n");
501
            msgout (ERROR, "out of memory\n");
502
            end_program(-1);
502
            end_program(-1);
503
        }
503
        }
504
504
        img = imlib_create_image(screen_width, screen_height);
505
        imgfinal = imlib_create_image(cfg->texture_size, cfg->texture_size);
505
        imgfinal = imlib_create_image(cfg->texture_size, cfg->texture_size);
506
506
507
    }
507
    }
Lines 554-560 Link Here
554
554
555
        }
555
        }
556
    }
556
    }
557
557
    imlib_free_image();
558
    imlib_context_set_image(img);
559
    imlib_free_image();
558
    return 0;
560
    return 0;
559
}
561
}
560
562
Lines 569-593 Link Here
569
            end_program(-1);
571
            end_program(-1);
570
        }
572
        }
571
573
572
        imgfinal = imlib_create_image(cfg->texture_size, cfg->texture_size);
574
        // imgfinal = imlib_create_image(cfg->texture_size, cfg->texture_size);
573
    }
575
    }
574
576
    img = imlib_create_image_from_drawable((Pixmap)0,0,0,screen_width,screen_height,1);
575
    /* set the display , visual, colormap and drawable we are using */
577
   
576
    imlib_context_set_image(img);
578
    imlib_context_set_image(img);
577
    imlib_copy_drawable_to_image((Pixmap)0, //Pixmap mask, 
579
    imgfinal = imlib_create_cropped_scaled_image(0,0,screen_width,screen_height,cfg->texture_size,cfg->texture_size);  
578
                                 0, 0, //int x, int y, 
580
    imlib_context_set_image(imgfinal);	   
579
                                 screen_width, //int width, int height,
580
                                 screen_height,
581
                                 0, 0, //int destination_x, int destination_y,
582
                                 1 ); //char need_to_grab_x);
583
584
    imlib_context_set_image(imgfinal);
585
    imlib_image_clear();
586
587
    imlib_blend_image_onto_image(img, 0, 
588
                                 0, 0, screen_width, screen_height, 
589
                                 0, 0, cfg->texture_size, cfg->texture_size);
590
591
    unsigned int *tmp = imlib_image_get_data();
581
    unsigned int *tmp = imlib_image_get_data();
592
582
593
    int w = imlib_image_get_width();
583
    int w = imlib_image_get_width();
Lines 610-620 Link Here
610
            screenshot_data[offset + 1] = (tmp[img_offset] >> 8) & 0xff;
600
            screenshot_data[offset + 1] = (tmp[img_offset] >> 8) & 0xff;
611
            screenshot_data[offset + 2] =  tmp[img_offset] & 0xff;
601
            screenshot_data[offset + 2] =  tmp[img_offset] & 0xff;
612
            screenshot_data[offset + 3] = (tmp[img_offset] >> 24) & 0xff;
602
            screenshot_data[offset + 3] = (tmp[img_offset] >> 24) & 0xff;
613
603
	    
614
615
        }
604
        }
616
    }
605
    }
617
606
607
    imlib_free_image();			// saves ~ 10MB of res. Mem @1024x1024 texture_size
608
    imlib_context_set_image(img);
609
    imlib_free_image();
618
    return 0;
610
    return 0;
619
}
611
}

Return to bug 28712