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 |
} |