mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 18:31:55 -04:00
*** empty log message ***
This commit is contained in:
parent
2e298544c8
commit
71f9ef76a2
@ -8,7 +8,7 @@ class Loader:
|
||||
"""Loader class: contains method to load models, sounds and code"""
|
||||
|
||||
notify = directNotify.newCategory("Loader")
|
||||
notify.setVerbose(1)
|
||||
# notify.setVerbose(1)
|
||||
|
||||
# special methods
|
||||
def __init__(self, base):
|
||||
|
@ -276,15 +276,23 @@ void toggle_texture(NodeAttributes &initial_state) {
|
||||
}
|
||||
|
||||
void take_snapshot(GraphicsWindow *win, const string &name) {
|
||||
PixelBuffer p;
|
||||
GraphicsStateGuardian* g = win->get_gsg();
|
||||
const RenderBuffer& r = g->get_render_buffer(RenderBuffer::T_front);
|
||||
GraphicsStateGuardian* gsg = win->get_gsg();
|
||||
const RenderBuffer& rb = gsg->get_render_buffer(RenderBuffer::T_front);
|
||||
|
||||
p.set_xsize(win->get_width());
|
||||
p.set_ysize(win->get_height());
|
||||
p._image = PTA_uchar(win->get_width() * win->get_height() + 3);
|
||||
// p.set_xsize(win->get_width());
|
||||
// p.set_ysize(win->get_height());
|
||||
// p._image = PTA_uchar(win->get_width() * win->get_height() * 3);
|
||||
|
||||
p.copy(g, g->get_current_display_region(), r);
|
||||
CPT(DisplayRegion) dr = gsg->get_current_display_region();
|
||||
nassertv(dr != (DisplayRegion *)NULL);
|
||||
|
||||
int width = dr->get_pixel_width();
|
||||
int height = dr->get_pixel_height();
|
||||
|
||||
PixelBuffer p(width, height, 3, 1, PixelBuffer::T_unsigned_byte,
|
||||
PixelBuffer::F_rgb);
|
||||
|
||||
p.copy(gsg, dr, rb);
|
||||
p.write(name.c_str());
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user