Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set the graphics context width and height by the Vizkit3DWidget constructor #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Vizkit3DWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ void Vizkit3DConfig::setCameraManipulator(QStringList const& manipulator)
return getWidget()->setCameraManipulator(id);
}

Vizkit3DWidget::Vizkit3DWidget( QWidget* parent,const QString &world_name,bool auto_update)
Vizkit3DWidget::Vizkit3DWidget( QWidget* parent,int width,int height,const QString &world_name,bool auto_update)
: QWidget(parent)
, env_plugin(NULL)
{
Expand Down Expand Up @@ -233,7 +233,7 @@ Vizkit3DWidget::Vizkit3DWidget( QWidget* parent,const QString &world_name,bool a
root = createSceneGraph(world_name);

// create osg widget
QWidget* widget = addViewWidget(createGraphicsWindow(0,0,800,600), root);
QWidget* widget = addViewWidget(createGraphicsWindow(0,0,width,height), root);
widget->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
widget->setObjectName(QString("View Widget"));
splitter->addWidget(widget);
Expand Down
3 changes: 2 additions & 1 deletion src/Vizkit3DWidget.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ namespace vizkit3d
static osg::Vec3d const DEFAULT_UP;

friend class VizPluginBase;
Vizkit3DWidget(QWidget* parent = 0,const QString &world_name = "world_osg",bool auto_update = true);
Vizkit3DWidget(QWidget* parent = 0, int width = 800, int height = 600,
const QString &world_name = "world_osg",bool auto_update = true);

/** Defined to avoid unnecessary dependencies in the headers
*
Expand Down