/*
* CINELERRA
* Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
- *
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
+ *
*/
#include "bcpbuffer.h"
{
#ifdef HAVE_GL
int ww = (w + 3) & ~3, hh = (h + 3) & ~3;
+ BC_WindowBase *current_window = BC_WindowBase::get_synchronous()->current_window;
+ window_id = current_window->get_id();
+
+ pbuffer = BC_WindowBase::get_synchronous()->get_pbuffer(ww, hh, &glx_context);
+ if( pbuffer ) return;
+
int pb_attrs[] = {
GLX_PBUFFER_WIDTH, ww,
GLX_PBUFFER_HEIGHT, hh,
None
};
- BC_WindowBase *current_window = BC_WindowBase::get_synchronous()->current_window;
Display *dpy = current_window->get_display();
GLXFBConfig *fb_cfgs = current_window->glx_pbuffer_fb_configs();
int nfb_cfgs = current_window->n_fbcfgs_pbuffer;
// __LINE__, current_config, visinfo, BC_Resources::error, pbuffer);
if( pbuffer ) {
- window_id = current_window->get_id();
glx_context = glXCreateContext(dpy, visinfo, current_window->glx_win_context, 1);
- BC_WindowBase::get_synchronous()->put_pbuffer(w, h, pbuffer, glx_context);
+ BC_WindowBase::get_synchronous()->put_pbuffer(ww, hh, pbuffer, glx_context);
}
else
printf("BC_PBuffer::create_pbuffer: failed\n");