SFML community forums
Help => Window => Topic started by: Train on August 26, 2009, 03:22:25 am
-
Is it possible to embed a rendering window inside a window?
As in a viewport inside a map editor.
Like this
(http://www.dbarnes.com/game-map-editor/simple-game-map-editor-1.png)
-
You would want to use something like wxWidgets to make the window and the controls on the left, then integrate that with a SFML OpenGL rendering on the right. You can read the tutorial (http://www.sfml-dev.org/tutorials/1.5/graphics-wxwidgets.php) on how to do with with wxWidgets, you can use other GUI libraries as well.
-
yay, exactly what I wanted....but now I remember how much I hate w32's window code
-
Aldo it would be easier and more efective using QT (or wxWidgets), you could also make your own gui in sfml and use views to create the different maps ....
http://www.sfml-dev.org/tutorials/1.5/graphics-views.php
We used the views for our first editor but atm we are switching to qt to manage/edit texture maps, scripts, shaders and so on ...
-
@Meltra Bour : QT == QuickTime ; Qt == nokia's lib.
-
If you just want to separate drawing areas, the sf::View class has been improved in SFML 2 to allow that.
Otherwise, using SFML together with Qt or wxWidgets will do the job.
-
Switched to Qt but am having a few issues
My EditorCanvas extends QSFMLCanvas
and when i do
class Editor : public QMainWindow
{
public:
....
private:
EditorCanvas canvas;
}
and then do
canvas = EditorCanvas(...)
I get
Error 2 error C2248: 'QTimer::operator =' : cannot access private member declared in class 'QTimer' c:\documents and settings\administrator\my documents\visual studio 2008\projects\sfmlengine\sfmlengine\QSFMLCanvas.h 27
also, since Editor extends QMainWindow, should I pass this as the parent of EditorCanvas?
-
Widgets are not copyable, you should declare a pointer (EditorCanvas*) and allocate it using new. Then Qt will take care about deleting the instance for you, if it has a parent widget.
-
should the Editor be considered its parent?
-
If the EditorCanvas is a sub-widget of the Editor, then yes.