diff --git a/panda/src/display/graphicsBuffer.cxx b/panda/src/display/graphicsBuffer.cxx index 5b21aa2a7c..8a7b517bea 100644 --- a/panda/src/display/graphicsBuffer.cxx +++ b/panda/src/display/graphicsBuffer.cxx @@ -30,11 +30,11 @@ TypeHandle GraphicsBuffer::_type_handle; GraphicsBuffer:: GraphicsBuffer(GraphicsPipe *pipe, const string &name, - const FrameBufferProperties &properties, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host) : - GraphicsOutput(pipe, name, properties, x_size, y_size, flags, gsg, host) + GraphicsOutput(pipe, name, fb_prop, win_prop, flags, gsg, host) { #ifdef DO_MEMORY_USAGE MemoryUsage::update_type(this, this); diff --git a/panda/src/display/graphicsBuffer.h b/panda/src/display/graphicsBuffer.h index 109dd22bb4..435fc5a4ad 100644 --- a/panda/src/display/graphicsBuffer.h +++ b/panda/src/display/graphicsBuffer.h @@ -35,8 +35,9 @@ class EXPCL_PANDA GraphicsBuffer : public GraphicsOutput { protected: GraphicsBuffer(GraphicsPipe *pipe, const string &name, - const FrameBufferProperties &properties, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host); diff --git a/panda/src/display/graphicsEngine.I b/panda/src/display/graphicsEngine.I index c76512462f..b9066561d8 100644 --- a/panda/src/display/graphicsEngine.I +++ b/panda/src/display/graphicsEngine.I @@ -99,15 +99,16 @@ close_gsg(GraphicsPipe *pipe, GraphicsStateGuardian *gsg) { INLINE GraphicsOutput *GraphicsEngine:: make_buffer(GraphicsStateGuardian *gsg, const string &name, int sort, int x_size, int y_size) { - FrameBufferProperties props = FrameBufferProperties::get_default(); - props.set_back_buffers(0); - props.set_stereo(0); - props.set_accum_bits(0); - props.set_multisamples(0); - props.set_force_hardware(0); - props.set_force_software(0); + FrameBufferProperties fb_props = FrameBufferProperties::get_default(); + fb_props.set_back_buffers(0); + fb_props.set_stereo(0); + fb_props.set_accum_bits(0); + fb_props.set_multisamples(0); + fb_props.set_force_hardware(0); + fb_props.set_force_software(0); GraphicsOutput *result = make_output(gsg->get_pipe(), name, sort, - props, x_size, y_size, + fb_props, + WindowProperties::size(x_size, y_size), GraphicsPipe::BF_refuse_window | GraphicsPipe::BF_fb_props_optional, gsg, NULL); @@ -122,9 +123,9 @@ make_buffer(GraphicsStateGuardian *gsg, const string &name, INLINE GraphicsOutput *GraphicsEngine:: make_parasite(GraphicsOutput *host, const string &name, int sort, int x_size, int y_size) { - FrameBufferProperties props; GraphicsOutput *result = make_output(host->get_pipe(), name, sort, - props, x_size, y_size, + FrameBufferProperties(), + WindowProperties::size(x_size, y_size), GraphicsPipe::BF_require_parasite | GraphicsPipe::BF_fb_props_optional, host->get_gsg(), host); diff --git a/panda/src/display/graphicsEngine.cxx b/panda/src/display/graphicsEngine.cxx index af3c13c313..ef8b72f273 100644 --- a/panda/src/display/graphicsEngine.cxx +++ b/panda/src/display/graphicsEngine.cxx @@ -205,8 +205,9 @@ get_threading_model() const { GraphicsOutput *GraphicsEngine:: make_output(GraphicsPipe *pipe, const string &name, int sort, - const FrameBufferProperties &prop, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host) { @@ -243,12 +244,13 @@ make_output(GraphicsPipe *pipe, // Simplify the input parameters. - if ((x_size==0) || (y_size == 0)) { + int x_size = 0, y_size = 0; + if (win_prop.has_size()) { + x_size = win_prop.get_x_size(); + y_size = win_prop.get_y_size(); + } else { flags |= GraphicsPipe::BF_size_track_host; } - if (flags & GraphicsPipe::BF_size_square) { - x_size = y_size = min(x_size, y_size); - } if (host != 0) { host = host->get_host(); } @@ -305,7 +307,7 @@ make_output(GraphicsPipe *pipe, ((flags&GraphicsPipe::BF_can_bind_every)==0)&& ((flags&GraphicsPipe::BF_rtt_cumulative)==0)) { if ((flags&GraphicsPipe::BF_fb_props_optional) || - (host->get_fb_properties().subsumes(prop))) { + (host->get_fb_properties().subsumes(fb_prop))) { can_use_parasite = true; } } @@ -319,7 +321,7 @@ make_output(GraphicsPipe *pipe, (can_use_parasite) && (x_size <= host->get_x_size())&& (y_size <= host->get_y_size())&& - (host->get_fb_properties().subsumes(prop))) { + (host->get_fb_properties().subsumes(fb_prop))) { ParasiteBuffer *buffer = new ParasiteBuffer(host, name, x_size, y_size, flags); buffer->_sort = sort; do_add_window(buffer, threading_model); @@ -332,7 +334,7 @@ make_output(GraphicsPipe *pipe, for (int retry=0; retry<10; retry++) { bool precertify = false; PT(GraphicsOutput) window = - pipe->make_output(name, prop, x_size, y_size, flags, gsg, host, retry, precertify); + pipe->make_output(name, fb_prop, win_prop, flags, gsg, host, retry, precertify); if (window != (GraphicsOutput *)NULL) { window->_sort = sort; if ((precertify) && (gsg != 0) && (window->get_gsg()==gsg)) { @@ -344,7 +346,7 @@ make_output(GraphicsPipe *pipe, open_windows(); if (window->is_valid()) { do_add_gsg(window->get_gsg(), pipe, threading_model); - if (window->get_fb_properties().subsumes(prop)) { + if (window->get_fb_properties().subsumes(fb_prop)) { return window; } else { if (flags & GraphicsPipe::BF_fb_props_optional) { diff --git a/panda/src/display/graphicsEngine.h b/panda/src/display/graphicsEngine.h index 369c9c62f4..22301a29df 100644 --- a/panda/src/display/graphicsEngine.h +++ b/panda/src/display/graphicsEngine.h @@ -71,10 +71,10 @@ PUBLISHED: GraphicsOutput *make_output(GraphicsPipe *pipe, const string &name, int sort, - const FrameBufferProperties &prop, - int x_size, int y_size, int flags, - GraphicsStateGuardian *gsg = 0, - GraphicsOutput *host = 0); + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, GraphicsStateGuardian *gsg = NULL, + GraphicsOutput *host = NULL); // Syntactic shorthand versions of make_output INLINE GraphicsOutput *make_buffer(GraphicsStateGuardian *gsg, diff --git a/panda/src/display/graphicsOutput.cxx b/panda/src/display/graphicsOutput.cxx index 55e7a0624e..d6df48f470 100644 --- a/panda/src/display/graphicsOutput.cxx +++ b/panda/src/display/graphicsOutput.cxx @@ -73,8 +73,9 @@ static CubeFaceDef cube_faces[6] = { GraphicsOutput:: GraphicsOutput(GraphicsPipe *pipe, const string &name, - const FrameBufferProperties &properties, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host) : _lock("GraphicsOutput"), @@ -87,12 +88,15 @@ GraphicsOutput(GraphicsPipe *pipe, _pipe = pipe; _gsg = gsg; _host = host; - _fb_properties = properties; + _fb_properties = fb_prop; _name = name; _creation_flags = flags; - _x_size = x_size; - _y_size = y_size; - _has_size = false; // Need to look into what this does. + _x_size = _y_size = 0; + _has_size = win_prop.has_size(); + if (_has_size) { + _x_size = win_prop.get_x_size(); + _y_size = win_prop.get_y_size(); + } _is_valid = false; _flip_ready = false; _cube_map_index = -1; @@ -738,7 +742,8 @@ make_texture_buffer(const string &name, int x_size, int y_size, GraphicsOutput *buffer = get_gsg()->get_engine()-> make_output(get_gsg()->get_pipe(), name, get_sort()-1, - props, x_size, y_size, GraphicsPipe::BF_refuse_window, + props, WindowProperties::size(x_size, y_size), + GraphicsPipe::BF_refuse_window, get_gsg(), get_host()); if (buffer != (GraphicsOutput *)NULL) { diff --git a/panda/src/display/graphicsOutput.h b/panda/src/display/graphicsOutput.h index 10f8ec4da8..3d203a8e83 100644 --- a/panda/src/display/graphicsOutput.h +++ b/panda/src/display/graphicsOutput.h @@ -64,8 +64,8 @@ class EXPCL_PANDA GraphicsOutput : public TypedWritableReferenceCount, public Dr protected: GraphicsOutput(GraphicsPipe *pipe, const string &name, - const FrameBufferProperties &properties, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host); diff --git a/panda/src/display/graphicsPipe.cxx b/panda/src/display/graphicsPipe.cxx index f9794bbf42..6c29fab5de 100644 --- a/panda/src/display/graphicsPipe.cxx +++ b/panda/src/display/graphicsPipe.cxx @@ -143,8 +143,9 @@ close_gsg(GraphicsStateGuardian *gsg) { //////////////////////////////////////////////////////////////////// PT(GraphicsOutput) GraphicsPipe:: make_output(const string &name, - const FrameBufferProperties &properties, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host, int retry, diff --git a/panda/src/display/graphicsPipe.h b/panda/src/display/graphicsPipe.h index 56a661c166..f77e907c38 100644 --- a/panda/src/display/graphicsPipe.h +++ b/panda/src/display/graphicsPipe.h @@ -32,6 +32,7 @@ class GraphicsWindow; class GraphicsBuffer; class GraphicsStateGuardian; class FrameBufferProperties; +class WindowProperties; class Texture; //////////////////////////////////////////////////////////////////// @@ -109,8 +110,9 @@ protected: virtual void close_gsg(GraphicsStateGuardian *gsg); virtual PT(GraphicsOutput) make_output(const string &name, - const FrameBufferProperties &properties, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host, int retry, diff --git a/panda/src/display/graphicsWindow.cxx b/panda/src/display/graphicsWindow.cxx index 40fd055661..094b83224d 100644 --- a/panda/src/display/graphicsWindow.cxx +++ b/panda/src/display/graphicsWindow.cxx @@ -38,11 +38,12 @@ TypeHandle GraphicsWindow::_type_handle; GraphicsWindow:: GraphicsWindow(GraphicsPipe *pipe, const string &name, - const FrameBufferProperties &properties, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host) : - GraphicsOutput(pipe, name, properties, x_size, y_size, flags, gsg, host), + GraphicsOutput(pipe, name, fb_prop, win_prop, flags, gsg, host), _input_lock("GraphicsWindow::_input_lock") { #ifdef DO_MEMORY_USAGE @@ -54,7 +55,7 @@ GraphicsWindow(GraphicsPipe *pipe, << "Creating new window " << get_name() << "\n"; } - _red_blue_stereo = red_blue_stereo && !properties.is_stereo(); + _red_blue_stereo = red_blue_stereo && !fb_prop.is_stereo(); if (_red_blue_stereo) { _left_eye_color_mask = parse_color_mask(red_blue_stereo_colors.get_word(0)); _right_eye_color_mask = parse_color_mask(red_blue_stereo_colors.get_word(1)); } @@ -66,6 +67,7 @@ GraphicsWindow(GraphicsPipe *pipe, _properties.set_cursor_hidden(false); request_properties(WindowProperties::get_default()); + request_properties(win_prop); _window_event = "window-event"; } diff --git a/panda/src/display/graphicsWindow.h b/panda/src/display/graphicsWindow.h index 886d6bce3d..d55ac6548f 100644 --- a/panda/src/display/graphicsWindow.h +++ b/panda/src/display/graphicsWindow.h @@ -42,8 +42,9 @@ class EXPCL_PANDA GraphicsWindow : public GraphicsOutput { protected: GraphicsWindow(GraphicsPipe *pipe, const string &name, - const FrameBufferProperties &properties, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host); diff --git a/panda/src/display/parasiteBuffer.cxx b/panda/src/display/parasiteBuffer.cxx index 2d9b708563..a575574a2b 100644 --- a/panda/src/display/parasiteBuffer.cxx +++ b/panda/src/display/parasiteBuffer.cxx @@ -32,7 +32,8 @@ ParasiteBuffer:: ParasiteBuffer(GraphicsOutput *host, const string &name, int x_size, int y_size, int flags) : GraphicsOutput(host->get_pipe(), name, host->get_fb_properties(), - x_size, y_size, flags, host->get_gsg(), host) + WindowProperties::size(x_size, y_size), flags, + host->get_gsg(), host) { #ifdef DO_MEMORY_USAGE MemoryUsage::update_type(this, this); diff --git a/panda/src/display/windowProperties.cxx b/panda/src/display/windowProperties.cxx index 8c9a6773d9..c2efbf5288 100644 --- a/panda/src/display/windowProperties.cxx +++ b/panda/src/display/windowProperties.cxx @@ -89,6 +89,20 @@ get_default() { return props; } +//////////////////////////////////////////////////////////////////// +// Function: WindowProperties::size +// Access: Published, Static +// Description: Returns a WindowProperties structure with only the +// size specified. The size is the only property that +// matters to buffers. +//////////////////////////////////////////////////////////////////// +WindowProperties WindowProperties:: +size(int x_size, int y_size) { + WindowProperties props; + props.set_size(x_size, y_size); + return props; +} + //////////////////////////////////////////////////////////////////// // Function: WindowProperties::operator == // Access: Published diff --git a/panda/src/display/windowProperties.h b/panda/src/display/windowProperties.h index ff27dede75..b5c7cdd0ac 100644 --- a/panda/src/display/windowProperties.h +++ b/panda/src/display/windowProperties.h @@ -44,6 +44,7 @@ PUBLISHED: INLINE ~WindowProperties(); static WindowProperties get_default(); + static WindowProperties size(int x_size, int y_size); bool operator == (const WindowProperties &other) const; INLINE bool operator != (const WindowProperties &other) const; diff --git a/panda/src/dxgsg8/dxTextureContext8.cxx b/panda/src/dxgsg8/dxTextureContext8.cxx index 39a51a300a..b483484e38 100644 --- a/panda/src/dxgsg8/dxTextureContext8.cxx +++ b/panda/src/dxgsg8/dxTextureContext8.cxx @@ -57,10 +57,6 @@ DXTextureContext8(PreparedGraphicsObjects *pgo, Texture *tex) : //////////////////////////////////////////////////////////////////// DXTextureContext8:: ~DXTextureContext8() { - if (dxgsg8_cat.is_spam()) { - dxgsg8_cat.spam() - << "Deleting texture context for " << get_texture()->get_name() << "\n"; - } delete_texture(); } diff --git a/panda/src/dxgsg8/wdxGraphicsBuffer8.cxx b/panda/src/dxgsg8/wdxGraphicsBuffer8.cxx index 2f78faff58..1341ffdeb9 100644 --- a/panda/src/dxgsg8/wdxGraphicsBuffer8.cxx +++ b/panda/src/dxgsg8/wdxGraphicsBuffer8.cxx @@ -43,11 +43,12 @@ TypeHandle wdxGraphicsBuffer8::_type_handle; wdxGraphicsBuffer8:: wdxGraphicsBuffer8(GraphicsPipe *pipe, const string &name, - const FrameBufferProperties &properties, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host): - GraphicsBuffer(pipe, name, properties, x_size, y_size, flags, gsg, host) + GraphicsBuffer(pipe, name, fb_prop, win_prop, flags, gsg, host) { // initialize all class members _cube_map_index = -1; diff --git a/panda/src/dxgsg8/wdxGraphicsBuffer8.h b/panda/src/dxgsg8/wdxGraphicsBuffer8.h index 01dbd4af6a..b8d40911c5 100644 --- a/panda/src/dxgsg8/wdxGraphicsBuffer8.h +++ b/panda/src/dxgsg8/wdxGraphicsBuffer8.h @@ -38,8 +38,9 @@ class EXPCL_PANDADX wdxGraphicsBuffer8 : public GraphicsBuffer { public: wdxGraphicsBuffer8(GraphicsPipe *pipe, const string &name, - const FrameBufferProperties &properties, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host); virtual ~wdxGraphicsBuffer8(); diff --git a/panda/src/dxgsg8/wdxGraphicsPipe8.cxx b/panda/src/dxgsg8/wdxGraphicsPipe8.cxx index 0468cca6a1..5e7432e65e 100644 --- a/panda/src/dxgsg8/wdxGraphicsPipe8.cxx +++ b/panda/src/dxgsg8/wdxGraphicsPipe8.cxx @@ -87,8 +87,9 @@ pipe_constructor() { //////////////////////////////////////////////////////////////////// PT(GraphicsOutput) wdxGraphicsPipe8:: make_output(const string &name, - const FrameBufferProperties &properties, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host, int retry, @@ -114,8 +115,8 @@ make_output(const string &name, ((flags&BF_can_bind_every)!=0)) { return NULL; } - return new wdxGraphicsWindow8(this, name, properties, - x_size, y_size, flags, gsg, host); + return new wdxGraphicsWindow8(this, name, fb_prop, win_prop, + flags, gsg, host); } // Second thing to try: a wdxGraphicsBuffer8 @@ -135,8 +136,8 @@ make_output(const string &name, (gsg->get_supports_render_texture())) { precertify = true; } - return new wdxGraphicsBuffer8(this, name, properties, - x_size, y_size, flags, gsg, host); + return new wdxGraphicsBuffer8(this, name, fb_prop, win_prop, + flags, gsg, host); } // Nothing else left to try. diff --git a/panda/src/dxgsg8/wdxGraphicsPipe8.h b/panda/src/dxgsg8/wdxGraphicsPipe8.h index 0f9cce8a0b..40bd56a06a 100644 --- a/panda/src/dxgsg8/wdxGraphicsPipe8.h +++ b/panda/src/dxgsg8/wdxGraphicsPipe8.h @@ -57,8 +57,9 @@ public: protected: virtual PT(GraphicsOutput) make_output(const string &name, - const FrameBufferProperties &properties, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host, int retry, diff --git a/panda/src/dxgsg8/wdxGraphicsWindow8.cxx b/panda/src/dxgsg8/wdxGraphicsWindow8.cxx index eca1db7bec..ca657a3b5f 100644 --- a/panda/src/dxgsg8/wdxGraphicsWindow8.cxx +++ b/panda/src/dxgsg8/wdxGraphicsWindow8.cxx @@ -41,11 +41,12 @@ TypeHandle wdxGraphicsWindow8::_type_handle; wdxGraphicsWindow8:: wdxGraphicsWindow8(GraphicsPipe *pipe, const string &name, - const FrameBufferProperties &properties, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host): - WinGraphicsWindow(pipe, name, properties, x_size, y_size, flags, gsg, host) + WinGraphicsWindow(pipe, name, fb_prop, win_prop, flags, gsg, host) { // dont actually create the window in the constructor. reason: // multi-threading requires panda C++ window object to exist in diff --git a/panda/src/dxgsg8/wdxGraphicsWindow8.h b/panda/src/dxgsg8/wdxGraphicsWindow8.h index ef00685ee5..f04e042d6c 100644 --- a/panda/src/dxgsg8/wdxGraphicsWindow8.h +++ b/panda/src/dxgsg8/wdxGraphicsWindow8.h @@ -36,8 +36,9 @@ class EXPCL_PANDADX wdxGraphicsWindow8 : public WinGraphicsWindow { public: wdxGraphicsWindow8(GraphicsPipe *pipe, const string &name, - const FrameBufferProperties &properties, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host); virtual ~wdxGraphicsWindow8(); diff --git a/panda/src/dxgsg9/dxTextureContext9.cxx b/panda/src/dxgsg9/dxTextureContext9.cxx index ace5591d0f..e6672b4402 100755 --- a/panda/src/dxgsg9/dxTextureContext9.cxx +++ b/panda/src/dxgsg9/dxTextureContext9.cxx @@ -61,11 +61,6 @@ DXTextureContext9(PreparedGraphicsObjects *pgo, Texture *tex) : //////////////////////////////////////////////////////////////////// DXTextureContext9:: ~DXTextureContext9() { - if (dxgsg9_cat.is_spam()) { - dxgsg9_cat.spam() - << "Deleting texture context for " << get_texture()->get_name() << "\n"; - } - if (_lru_page) { _lru_page -> _m.lru -> remove_page (_lru_page); diff --git a/panda/src/dxgsg9/wdxGraphicsBuffer9.cxx b/panda/src/dxgsg9/wdxGraphicsBuffer9.cxx index d51f5667a8..4fcb0941fb 100644 --- a/panda/src/dxgsg9/wdxGraphicsBuffer9.cxx +++ b/panda/src/dxgsg9/wdxGraphicsBuffer9.cxx @@ -43,11 +43,12 @@ TypeHandle wdxGraphicsBuffer9::_type_handle; wdxGraphicsBuffer9:: wdxGraphicsBuffer9(GraphicsPipe *pipe, const string &name, - const FrameBufferProperties &properties, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host): - GraphicsBuffer(pipe, name, properties, x_size, y_size, flags, gsg, host) + GraphicsBuffer(pipe, name, fb_prop, win_prop, flags, gsg, host) { // initialize all class members _cube_map_index = -1; diff --git a/panda/src/dxgsg9/wdxGraphicsBuffer9.h b/panda/src/dxgsg9/wdxGraphicsBuffer9.h index ca8285b213..5c19fed982 100644 --- a/panda/src/dxgsg9/wdxGraphicsBuffer9.h +++ b/panda/src/dxgsg9/wdxGraphicsBuffer9.h @@ -38,8 +38,9 @@ class EXPCL_PANDADX wdxGraphicsBuffer9 : public GraphicsBuffer { public: wdxGraphicsBuffer9(GraphicsPipe *pipe, const string &name, - const FrameBufferProperties &prop, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host); virtual ~wdxGraphicsBuffer9(); diff --git a/panda/src/dxgsg9/wdxGraphicsPipe9.cxx b/panda/src/dxgsg9/wdxGraphicsPipe9.cxx index f51e6542f2..1c648694c6 100755 --- a/panda/src/dxgsg9/wdxGraphicsPipe9.cxx +++ b/panda/src/dxgsg9/wdxGraphicsPipe9.cxx @@ -87,8 +87,9 @@ pipe_constructor() { //////////////////////////////////////////////////////////////////// PT(GraphicsOutput) wdxGraphicsPipe9:: make_output(const string &name, - const FrameBufferProperties &prop, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host, int retry, @@ -114,8 +115,8 @@ make_output(const string &name, ((flags&BF_can_bind_every)!=0)) { return NULL; } - return new wdxGraphicsWindow9(this, name, prop, - x_size, y_size, flags, gsg, host); + return new wdxGraphicsWindow9(this, name, fb_prop, win_prop, + flags, gsg, host); } // Second thing to try: a wdxGraphicsBuffer9 @@ -135,8 +136,8 @@ make_output(const string &name, (gsg->get_supports_render_texture())) { precertify = true; } - return new wdxGraphicsBuffer9(this, name, prop, - x_size, y_size, flags, gsg, host); + return new wdxGraphicsBuffer9(this, name, fb_prop, win_prop, + flags, gsg, host); } // Nothing else left to try. diff --git a/panda/src/dxgsg9/wdxGraphicsPipe9.h b/panda/src/dxgsg9/wdxGraphicsPipe9.h index 1bb131f53d..393e481b8b 100755 --- a/panda/src/dxgsg9/wdxGraphicsPipe9.h +++ b/panda/src/dxgsg9/wdxGraphicsPipe9.h @@ -57,8 +57,9 @@ public: protected: virtual PT(GraphicsOutput) make_output(const string &name, - const FrameBufferProperties &prop, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host, int retry, diff --git a/panda/src/dxgsg9/wdxGraphicsWindow9.cxx b/panda/src/dxgsg9/wdxGraphicsWindow9.cxx index ec6518c1ea..47861144ff 100755 --- a/panda/src/dxgsg9/wdxGraphicsWindow9.cxx +++ b/panda/src/dxgsg9/wdxGraphicsWindow9.cxx @@ -41,11 +41,12 @@ TypeHandle wdxGraphicsWindow9::_type_handle; wdxGraphicsWindow9:: wdxGraphicsWindow9(GraphicsPipe *pipe, const string &name, - const FrameBufferProperties &prop, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host): - WinGraphicsWindow(pipe, name, prop, x_size, y_size, flags, gsg, host) + WinGraphicsWindow(pipe, name, fb_prop, win_prop, flags, gsg, host) { // dont actually create the window in the constructor. reason: // multi-threading requires panda C++ window object to exist in diff --git a/panda/src/dxgsg9/wdxGraphicsWindow9.h b/panda/src/dxgsg9/wdxGraphicsWindow9.h index 0cd7b0a562..c7fbd6fb2d 100755 --- a/panda/src/dxgsg9/wdxGraphicsWindow9.h +++ b/panda/src/dxgsg9/wdxGraphicsWindow9.h @@ -36,8 +36,9 @@ class EXPCL_PANDADX wdxGraphicsWindow9 : public WinGraphicsWindow { public: wdxGraphicsWindow9(GraphicsPipe *pipe, const string &name, - const FrameBufferProperties &prop, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host); virtual ~wdxGraphicsWindow9(); diff --git a/panda/src/framework/windowFramework.cxx b/panda/src/framework/windowFramework.cxx index d6b1626baa..cb959b8b1b 100644 --- a/panda/src/framework/windowFramework.cxx +++ b/panda/src/framework/windowFramework.cxx @@ -161,7 +161,7 @@ open_window(const WindowProperties &props, GraphicsEngine *engine, GraphicsOutput *winout = engine->make_output(pipe, name, 0, FrameBufferProperties::get_default(), - 100, 100, GraphicsPipe::BF_require_window, + props, GraphicsPipe::BF_require_window, gsg, NULL); if (winout != (GraphicsOutput *)NULL) { diff --git a/panda/src/glstuff/glGraphicsBuffer_src.cxx b/panda/src/glstuff/glGraphicsBuffer_src.cxx index 8316931204..190f910e5c 100644 --- a/panda/src/glstuff/glGraphicsBuffer_src.cxx +++ b/panda/src/glstuff/glGraphicsBuffer_src.cxx @@ -26,11 +26,12 @@ TypeHandle CLP(GraphicsBuffer)::_type_handle; CLP(GraphicsBuffer):: CLP(GraphicsBuffer)(GraphicsPipe *pipe, const string &name, - const FrameBufferProperties &properties, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host) : - GraphicsBuffer(pipe, name, properties, x_size, y_size, flags, gsg, host) + GraphicsBuffer(pipe, name, fb_prop, win_prop, flags, gsg, host) { // An FBO doesn't have a back buffer. _draw_buffer_type = RenderBuffer::T_front; diff --git a/panda/src/glstuff/glGraphicsBuffer_src.h b/panda/src/glstuff/glGraphicsBuffer_src.h index 8832c79cc3..e47b98b68f 100644 --- a/panda/src/glstuff/glGraphicsBuffer_src.h +++ b/panda/src/glstuff/glGraphicsBuffer_src.h @@ -58,8 +58,9 @@ class EXPCL_GL CLP(GraphicsBuffer) : public GraphicsBuffer { public: CLP(GraphicsBuffer)(GraphicsPipe *pipe, const string &name, - const FrameBufferProperties &properties, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host); virtual ~CLP(GraphicsBuffer)(); diff --git a/panda/src/glxdisplay/glxGraphicsBuffer.cxx b/panda/src/glxdisplay/glxGraphicsBuffer.cxx index c8f97532af..00f48c1d2c 100644 --- a/panda/src/glxdisplay/glxGraphicsBuffer.cxx +++ b/panda/src/glxdisplay/glxGraphicsBuffer.cxx @@ -39,11 +39,12 @@ TypeHandle glxGraphicsBuffer::_type_handle; glxGraphicsBuffer:: glxGraphicsBuffer(GraphicsPipe *pipe, const string &name, - const FrameBufferProperties &properties, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host) : - GraphicsBuffer(pipe, name, properties, x_size, y_size, flags, gsg, host) + GraphicsBuffer(pipe, name, fb_prop, win_prop, flags, gsg, host) { glxGraphicsPipe *glx_pipe; DCAST_INTO_V(glx_pipe, _pipe); diff --git a/panda/src/glxdisplay/glxGraphicsBuffer.h b/panda/src/glxdisplay/glxGraphicsBuffer.h index 054637d6af..f79b071f4b 100644 --- a/panda/src/glxdisplay/glxGraphicsBuffer.h +++ b/panda/src/glxdisplay/glxGraphicsBuffer.h @@ -37,8 +37,9 @@ class glxGraphicsBuffer : public GraphicsBuffer { public: glxGraphicsBuffer(GraphicsPipe *pipe, const string &name, - const FrameBufferProperties &properties, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host); virtual ~glxGraphicsBuffer(); diff --git a/panda/src/glxdisplay/glxGraphicsPipe.cxx b/panda/src/glxdisplay/glxGraphicsPipe.cxx index 65ebbbafca..e7117b28fd 100644 --- a/panda/src/glxdisplay/glxGraphicsPipe.cxx +++ b/panda/src/glxdisplay/glxGraphicsPipe.cxx @@ -173,8 +173,9 @@ pipe_constructor() { //////////////////////////////////////////////////////////////////// PT(GraphicsOutput) glxGraphicsPipe:: make_output(const string &name, - const FrameBufferProperties &properties, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host, int retry, @@ -200,8 +201,8 @@ make_output(const string &name, ((flags&BF_can_bind_every)!=0)) { return NULL; } - return new glxGraphicsWindow(this, name, properties, - x_size, y_size, flags, gsg, host); + return new glxGraphicsWindow(this, name, fb_prop, win_prop, + flags, gsg, host); } // Second thing to try: a GLGraphicsBuffer @@ -217,10 +218,10 @@ make_output(const string &name, // Early failure - if we are sure that this buffer WONT // meet specs, we can bail out early. if ((flags & BF_fb_props_optional)==0) { - if ((properties.get_indexed_color() > 0)|| - (properties.get_back_buffers() > 0)|| - (properties.get_accum_bits() > 0)|| - (properties.get_multisamples() > 0)) { + if ((fb_prop.get_indexed_color() > 0)|| + (fb_prop.get_back_buffers() > 0)|| + (fb_prop.get_accum_bits() > 0)|| + (fb_prop.get_multisamples() > 0)) { return NULL; } } @@ -231,11 +232,11 @@ make_output(const string &name, (!glxgsg->needs_reset()) && (glxgsg->_supports_framebuffer_object) && (glxgsg->_glDrawBuffers != 0)&& - (properties.is_basic())) { + (fb_prop.is_basic())) { precertify = true; } - return new GLGraphicsBuffer(this, name, properties, - x_size, y_size, flags, gsg, host); + return new GLGraphicsBuffer(this, name, fb_prop, win_prop, + flags, gsg, host); } #ifdef HAVE_GLXFBCONFIG @@ -250,8 +251,8 @@ make_output(const string &name, ((flags&BF_can_bind_every)!=0)) { return NULL; } - return new glxGraphicsBuffer(this, name, properties, - x_size, y_size, flags, gsg, host); + return new glxGraphicsBuffer(this, name, fb_prop, win_prop, + flags, gsg, host); } #endif // HAVE_GLXFBCONFIG diff --git a/panda/src/glxdisplay/glxGraphicsPipe.h b/panda/src/glxdisplay/glxGraphicsPipe.h index 349548d381..6c0d625c17 100644 --- a/panda/src/glxdisplay/glxGraphicsPipe.h +++ b/panda/src/glxdisplay/glxGraphicsPipe.h @@ -114,8 +114,9 @@ public: protected: virtual PT(GraphicsOutput) make_output(const string &name, - const FrameBufferProperties &properties, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host, int retry, diff --git a/panda/src/glxdisplay/glxGraphicsWindow.cxx b/panda/src/glxdisplay/glxGraphicsWindow.cxx index 283a0476a6..6297e5f718 100644 --- a/panda/src/glxdisplay/glxGraphicsWindow.cxx +++ b/panda/src/glxdisplay/glxGraphicsWindow.cxx @@ -47,11 +47,12 @@ TypeHandle glxGraphicsWindow::_type_handle; glxGraphicsWindow:: glxGraphicsWindow(GraphicsPipe *pipe, const string &name, - const FrameBufferProperties &properties, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host) : - GraphicsWindow(pipe, name, properties, x_size, y_size, flags, gsg, host) + GraphicsWindow(pipe, name, fb_prop, win_prop, flags, gsg, host) { glxGraphicsPipe *glx_pipe; DCAST_INTO_V(glx_pipe, _pipe); diff --git a/panda/src/glxdisplay/glxGraphicsWindow.h b/panda/src/glxdisplay/glxGraphicsWindow.h index fbf11941f7..4e156036c6 100644 --- a/panda/src/glxdisplay/glxGraphicsWindow.h +++ b/panda/src/glxdisplay/glxGraphicsWindow.h @@ -34,8 +34,9 @@ class glxGraphicsWindow : public GraphicsWindow { public: glxGraphicsWindow(GraphicsPipe *pipe, const string &name, - const FrameBufferProperties &properties, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host); virtual ~glxGraphicsWindow(); diff --git a/panda/src/gobj/preparedGraphicsObjects.cxx b/panda/src/gobj/preparedGraphicsObjects.cxx index 78ef10d968..e86a19ecff 100644 --- a/panda/src/gobj/preparedGraphicsObjects.cxx +++ b/panda/src/gobj/preparedGraphicsObjects.cxx @@ -839,12 +839,18 @@ begin_frame(GraphicsStateGuardianBase *gsg, Thread *current_thread) { // First, release all the textures, geoms, and buffers awaiting // release. - Textures::iterator tci; - for (tci = _released_textures.begin(); - tci != _released_textures.end(); - ++tci) { - TextureContext *tc = (*tci); - gsg->release_texture(tc); + if (!_released_textures.empty()) { + cerr << "releasing " << _released_textures.size() + << " textures, gsg = " << gsg << "\n"; + Textures::iterator tci; + for (tci = _released_textures.begin(); + tci != _released_textures.end(); + ++tci) { + TextureContext *tc = (*tci); + cerr << "releasing texture " << tc << ": " << tc->_texture << "\n"; + gsg->release_texture(tc); + } + cerr << "done releasing textures\n"; } _released_textures.clear(); diff --git a/panda/src/mesadisplay/osMesaGraphicsBuffer.cxx b/panda/src/mesadisplay/osMesaGraphicsBuffer.cxx index 552be74013..c80d06b93b 100644 --- a/panda/src/mesadisplay/osMesaGraphicsBuffer.cxx +++ b/panda/src/mesadisplay/osMesaGraphicsBuffer.cxx @@ -31,11 +31,12 @@ TypeHandle OsMesaGraphicsBuffer::_type_handle; OsMesaGraphicsBuffer:: OsMesaGraphicsBuffer(GraphicsPipe *pipe, const string &name, - const FrameBufferProperties &properties, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host) : - GraphicsBuffer(pipe, name, properties, x_size, y_size, flags, gsg, host) + GraphicsBuffer(pipe, name, fb_prop, win_prop, flags, gsg, host) { _type = GL_UNSIGNED_BYTE; _draw_buffer_type = RenderBuffer::T_front; diff --git a/panda/src/mesadisplay/osMesaGraphicsBuffer.h b/panda/src/mesadisplay/osMesaGraphicsBuffer.h index f203b23b25..80a0df601e 100644 --- a/panda/src/mesadisplay/osMesaGraphicsBuffer.h +++ b/panda/src/mesadisplay/osMesaGraphicsBuffer.h @@ -34,8 +34,9 @@ class EXPCL_PANDAMESA OsMesaGraphicsBuffer : public GraphicsBuffer { public: OsMesaGraphicsBuffer(GraphicsPipe *pipe, const string &name, - const FrameBufferProperties &properties, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host); virtual ~OsMesaGraphicsBuffer(); diff --git a/panda/src/mesadisplay/osMesaGraphicsPipe.cxx b/panda/src/mesadisplay/osMesaGraphicsPipe.cxx index 9dd5fea34b..01d5cc3ac4 100644 --- a/panda/src/mesadisplay/osMesaGraphicsPipe.cxx +++ b/panda/src/mesadisplay/osMesaGraphicsPipe.cxx @@ -79,8 +79,9 @@ pipe_constructor() { //////////////////////////////////////////////////////////////////// PT(GraphicsOutput) OsMesaGraphicsPipe:: make_output(const string &name, - const FrameBufferProperties &properties, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host, int retry, @@ -101,8 +102,8 @@ make_output(const string &name, ((flags&BF_rtt_cumulative)!=0)) { return NULL; } - return new OsMesaGraphicsBuffer(this, name, properties, - x_size, y_size, flags, gsg, host); + return new OsMesaGraphicsBuffer(this, name, fb_prop, win_prop, + flags, gsg, host); } // Nothing else left to try. diff --git a/panda/src/mesadisplay/osMesaGraphicsPipe.h b/panda/src/mesadisplay/osMesaGraphicsPipe.h index 5c15dcbcf2..fa0f8c82b8 100644 --- a/panda/src/mesadisplay/osMesaGraphicsPipe.h +++ b/panda/src/mesadisplay/osMesaGraphicsPipe.h @@ -47,8 +47,9 @@ public: protected: virtual PT(GraphicsOutput) make_output(const string &name, - const FrameBufferProperties &properties, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host, int retry, diff --git a/panda/src/osxdisplay/osxGraphicsBuffer.cxx b/panda/src/osxdisplay/osxGraphicsBuffer.cxx index 4447951e41..e97149f892 100644 --- a/panda/src/osxdisplay/osxGraphicsBuffer.cxx +++ b/panda/src/osxdisplay/osxGraphicsBuffer.cxx @@ -32,11 +32,12 @@ TypeHandle osxGraphicsBuffer::_type_handle; osxGraphicsBuffer:: osxGraphicsBuffer(GraphicsPipe *pipe, const string &name, - const FrameBufferProperties &properties, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host) : - GraphicsBuffer(pipe, name, properties, x_size, y_size, flags, gsg, host) + GraphicsBuffer(pipe, name, fb_prop, win_prop, flags, gsg, host) { osxGraphicsPipe *osx_pipe; DCAST_INTO_V(osx_pipe, _pipe); diff --git a/panda/src/osxdisplay/osxGraphicsBuffer.h b/panda/src/osxdisplay/osxGraphicsBuffer.h index 6b286c7cbc..ef183eef5d 100644 --- a/panda/src/osxdisplay/osxGraphicsBuffer.h +++ b/panda/src/osxdisplay/osxGraphicsBuffer.h @@ -36,8 +36,9 @@ class EXPCL_PANDAGL osxGraphicsBuffer : public GraphicsBuffer { public: osxGraphicsBuffer(GraphicsPipe *pipe, const string &name, - const FrameBufferProperties &properties, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host); virtual ~osxGraphicsBuffer(); diff --git a/panda/src/osxdisplay/osxGraphicsPipe.cxx b/panda/src/osxdisplay/osxGraphicsPipe.cxx index dde22bbad8..733d2ec074 100644 --- a/panda/src/osxdisplay/osxGraphicsPipe.cxx +++ b/panda/src/osxdisplay/osxGraphicsPipe.cxx @@ -74,8 +74,9 @@ pipe_constructor() { //////////////////////////////////////////////////////////////////// PT(GraphicsOutput) osxGraphicsPipe:: make_output(const string &name, - const FrameBufferProperties &properties, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host, int retry, @@ -100,8 +101,8 @@ make_output(const string &name, ((flags&BF_can_bind_every)!=0)) { return NULL; } - return new osxGraphicsWindow(this, name, properties, - x_size, y_size, flags, gsg, host); + return new osxGraphicsWindow(this, name, fb_prop, win_prop, + flags, gsg, host); } // // Second thing to try: a glGraphicsBuffer @@ -117,7 +118,7 @@ make_output(const string &name, // return NULL; // } // } - // return new glGraphicsBuffer(this, name, x_size, y_size, flags, gsg, host); + // return new glGraphicsBuffer(this, name, fb_prop, win_prop, flags, gsg, host); // } // Third thing to try: an osxGraphicsBuffer @@ -130,8 +131,8 @@ make_output(const string &name, ((flags&BF_can_bind_every)!=0)) { return NULL; } - return new osxGraphicsBuffer(this, name, properties, - x_size, y_size, flags, gsg, host); + return new osxGraphicsBuffer(this, name, fb_prop, win_prop, + flags, gsg, host); } */ // Nothing else left to try. diff --git a/panda/src/osxdisplay/osxGraphicsPipe.h b/panda/src/osxdisplay/osxGraphicsPipe.h index 82c71ccf24..7683b47f8e 100644 --- a/panda/src/osxdisplay/osxGraphicsPipe.h +++ b/panda/src/osxdisplay/osxGraphicsPipe.h @@ -37,8 +37,9 @@ public: protected: virtual PT(GraphicsOutput) make_output(const string &name, - const FrameBufferProperties &properties, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host, int retry, diff --git a/panda/src/osxdisplay/osxGraphicsWindow.cxx b/panda/src/osxdisplay/osxGraphicsWindow.cxx index 1a3ac8432e..e6a844d189 100644 --- a/panda/src/osxdisplay/osxGraphicsWindow.cxx +++ b/panda/src/osxdisplay/osxGraphicsWindow.cxx @@ -435,11 +435,12 @@ static int id_seed = 100; osxGraphicsWindow:: osxGraphicsWindow(GraphicsPipe *pipe, const string &name, - const FrameBufferProperties &properties, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host) : - GraphicsWindow(pipe, name, properties, x_size, y_size, flags, gsg, host), + GraphicsWindow(pipe, name, fb_prop, win_prop, flags, gsg, host), _osx_window(NULL), _is_fullsreen(false), #ifdef HACK_SCREEN_HASH_CONTEXT diff --git a/panda/src/osxdisplay/osxGraphicsWindow.h b/panda/src/osxdisplay/osxGraphicsWindow.h index 0b0290499c..e19d36b077 100644 --- a/panda/src/osxdisplay/osxGraphicsWindow.h +++ b/panda/src/osxdisplay/osxGraphicsWindow.h @@ -41,8 +41,9 @@ class osxGraphicsWindow : public GraphicsWindow { public: osxGraphicsWindow(GraphicsPipe *pipe, const string &name, - const FrameBufferProperties &properties, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host); virtual ~osxGraphicsWindow(); diff --git a/panda/src/wgldisplay/wglGraphicsBuffer.cxx b/panda/src/wgldisplay/wglGraphicsBuffer.cxx index b8bb36a6ab..18a6c2aedb 100644 --- a/panda/src/wgldisplay/wglGraphicsBuffer.cxx +++ b/panda/src/wgldisplay/wglGraphicsBuffer.cxx @@ -35,11 +35,12 @@ TypeHandle wglGraphicsBuffer::_type_handle; wglGraphicsBuffer:: wglGraphicsBuffer(GraphicsPipe *pipe, const string &name, - const FrameBufferProperties &properties, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host) : - GraphicsBuffer(pipe, name, properties, x_size, y_size, flags, gsg, host) + GraphicsBuffer(pipe, name, fb_prop, win_prop, flags, gsg, host) { _pbuffer = (HPBUFFERARB)0; _pbuffer_dc = (HDC)0; diff --git a/panda/src/wgldisplay/wglGraphicsBuffer.h b/panda/src/wgldisplay/wglGraphicsBuffer.h index 17561dd4c1..9506310aa4 100644 --- a/panda/src/wgldisplay/wglGraphicsBuffer.h +++ b/panda/src/wgldisplay/wglGraphicsBuffer.h @@ -43,8 +43,9 @@ class EXPCL_PANDAGL wglGraphicsBuffer : public GraphicsBuffer { public: wglGraphicsBuffer(GraphicsPipe *pipe, const string &name, - const FrameBufferProperties &properties, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host); virtual ~wglGraphicsBuffer(); diff --git a/panda/src/wgldisplay/wglGraphicsPipe.cxx b/panda/src/wgldisplay/wglGraphicsPipe.cxx index 3a37fe9df7..1f848ba03c 100644 --- a/panda/src/wgldisplay/wglGraphicsPipe.cxx +++ b/panda/src/wgldisplay/wglGraphicsPipe.cxx @@ -108,8 +108,9 @@ pipe_constructor() { //////////////////////////////////////////////////////////////////// PT(GraphicsOutput) wglGraphicsPipe:: make_output(const string &name, - const FrameBufferProperties &properties, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host, int retry, @@ -136,14 +137,14 @@ make_output(const string &name, return NULL; } if ((flags & BF_fb_props_optional)==0) { - if ((properties.get_aux_rgba() > 0)|| - (properties.get_aux_hrgba() > 0)|| - (properties.get_aux_float() > 0)) { + if ((fb_prop.get_aux_rgba() > 0)|| + (fb_prop.get_aux_hrgba() > 0)|| + (fb_prop.get_aux_float() > 0)) { return NULL; } } - return new wglGraphicsWindow(this, name, properties, - x_size, y_size, flags, gsg, host); + return new wglGraphicsWindow(this, name, fb_prop, win_prop, + flags, gsg, host); } // Second thing to try: a GLGraphicsBuffer @@ -159,10 +160,10 @@ make_output(const string &name, // Early failure - if we are sure that this buffer WONT // meet specs, we can bail out early. if ((flags & BF_fb_props_optional)==0) { - if ((properties.get_indexed_color() > 0)|| - (properties.get_back_buffers() > 0)|| - (properties.get_accum_bits() > 0)|| - (properties.get_multisamples() > 0)) { + if ((fb_prop.get_indexed_color() > 0)|| + (fb_prop.get_back_buffers() > 0)|| + (fb_prop.get_accum_bits() > 0)|| + (fb_prop.get_multisamples() > 0)) { return NULL; } } @@ -173,11 +174,11 @@ make_output(const string &name, (!wglgsg->needs_reset()) && (wglgsg->_supports_framebuffer_object) && (wglgsg->_glDrawBuffers != 0)&& - (properties.is_basic())) { + (fb_prop.is_basic())) { precertify = true; } - return new GLGraphicsBuffer(this, name, properties, - x_size, y_size, flags, gsg, host); + return new GLGraphicsBuffer(this, name, fb_prop, win_prop, + flags, gsg, host); } // Third thing to try: a wglGraphicsBuffer @@ -193,9 +194,9 @@ make_output(const string &name, // Early failure - if we are sure that this buffer WONT // meet specs, we can bail out early. if ((flags & BF_fb_props_optional) == 0) { - if ((properties.get_aux_rgba() > 0)|| - (properties.get_aux_rgba() > 0)|| - (properties.get_aux_float() > 0)) { + if ((fb_prop.get_aux_rgba() > 0)|| + (fb_prop.get_aux_rgba() > 0)|| + (fb_prop.get_aux_float() > 0)) { return NULL; } } @@ -205,12 +206,12 @@ make_output(const string &name, (wglgsg->is_valid()) && (!wglgsg->needs_reset()) && (wglgsg->pfnum_supports_pbuffer()) && - (wglgsg->get_fb_properties().subsumes(properties))&& + (wglgsg->get_fb_properties().subsumes(fb_prop))&& (wglgsg->get_fb_properties().is_single_buffered())) { precertify = true; } - return new wglGraphicsBuffer(this, name, properties, - x_size, y_size, flags, gsg, host); + return new wglGraphicsBuffer(this, name, fb_prop, win_prop, + flags, gsg, host); } // Nothing else left to try. diff --git a/panda/src/wgldisplay/wglGraphicsPipe.h b/panda/src/wgldisplay/wglGraphicsPipe.h index 7b50e38719..30073735c0 100644 --- a/panda/src/wgldisplay/wglGraphicsPipe.h +++ b/panda/src/wgldisplay/wglGraphicsPipe.h @@ -40,8 +40,9 @@ public: protected: virtual PT(GraphicsOutput) make_output(const string &name, - const FrameBufferProperties &properties, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host, int retry, diff --git a/panda/src/wgldisplay/wglGraphicsWindow.cxx b/panda/src/wgldisplay/wglGraphicsWindow.cxx index 807b98b948..7c2106ba2a 100644 --- a/panda/src/wgldisplay/wglGraphicsWindow.cxx +++ b/panda/src/wgldisplay/wglGraphicsWindow.cxx @@ -133,11 +133,12 @@ GetAvailVidMem() { wglGraphicsWindow:: wglGraphicsWindow(GraphicsPipe *pipe, const string &name, - const FrameBufferProperties &properties, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host) : - WinGraphicsWindow(pipe, name, properties, x_size, y_size, flags, gsg, host) + WinGraphicsWindow(pipe, name, fb_prop, win_prop, flags, gsg, host) { _hdc = (HDC)0; } diff --git a/panda/src/wgldisplay/wglGraphicsWindow.h b/panda/src/wgldisplay/wglGraphicsWindow.h index 0ed1b36cfb..adc7e03457 100644 --- a/panda/src/wgldisplay/wglGraphicsWindow.h +++ b/panda/src/wgldisplay/wglGraphicsWindow.h @@ -31,8 +31,9 @@ class EXPCL_PANDAGL wglGraphicsWindow : public WinGraphicsWindow { public: wglGraphicsWindow(GraphicsPipe *pipe, const string &name, - const FrameBufferProperties &properties, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host); virtual ~wglGraphicsWindow(); diff --git a/panda/src/windisplay/winGraphicsWindow.cxx b/panda/src/windisplay/winGraphicsWindow.cxx index 123623ab1a..bcd4c637d8 100644 --- a/panda/src/windisplay/winGraphicsWindow.cxx +++ b/panda/src/windisplay/winGraphicsWindow.cxx @@ -82,11 +82,12 @@ static tRegisterRawInputDevices pRegisterRawInputDevices; WinGraphicsWindow:: WinGraphicsWindow(GraphicsPipe *pipe, const string &name, - const FrameBufferProperties &properties, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host) : - GraphicsWindow(pipe, name, properties, x_size, y_size, flags, gsg, host) + GraphicsWindow(pipe, name, fb_prop, win_prop, flags, gsg, host) { initialize_input_devices(); _hWnd = (HWND)0; diff --git a/panda/src/windisplay/winGraphicsWindow.h b/panda/src/windisplay/winGraphicsWindow.h index 617f8ae834..736cd97caf 100644 --- a/panda/src/windisplay/winGraphicsWindow.h +++ b/panda/src/windisplay/winGraphicsWindow.h @@ -43,8 +43,9 @@ class EXPCL_PANDAWIN WinGraphicsWindow : public GraphicsWindow { public: WinGraphicsWindow(GraphicsPipe *pipe, const string &name, - const FrameBufferProperties &properties, - int x_size, int y_size, int flags, + const FrameBufferProperties &fb_prop, + const WindowProperties &win_prop, + int flags, GraphicsStateGuardian *gsg, GraphicsOutput *host); virtual ~WinGraphicsWindow();