Hi Guys,
Just wondering if I am looking to make some tools for WIndows (3d editor, particle editor) is the Charles Petzold book still the best thing to go by?
Not interest in Windows 8 programming, just xp 7.
Thanks
Hi Guys,
Just wondering if I am looking to make some tools for WIndows (3d editor, particle editor) is the Charles Petzold book still the best thing to go by?
Not interest in Windows 8 programming, just xp 7.
Thanks
For the types of tools you mention, as they appear to have little to do with the Windows API, Petzold's likely to be as good as any for bitmaps, etc.
You don't mention what sort of 3D objects you may want to code an editor for, but there are probably better options than the Windows API for that purpose - e.g., an existing 3D editor such as Blender, etc. Unless your intent is for intellectual exercise and you really want to code your own "tool," something like OpenGL or Direct3D may be a better choice.
If you are asking about how to make GUIs for desktop applications, I really like Qt.
Here's a screenshot of a 2D tile-based editor I'm working on using Qt. The center of the editor uses a different API for drawing (SFML and OpenGL); you can make widgets be OpenGL-drawn as well as have Qt-drawn widgets.
Qt is also cross-platform for Windows, OSX, and Linux. Supposedly it's also recently gained cross-platformness for iOS and Android, but I'm not sure how well it works.
Thanks for the information guys. I had worked on some tools back in the day but it was a combination of win32 and directx. I will look into some of the things you suggest like QT.
It is mainly as a hobbyist thing on the side. The one thing that I've always disliked is having to rely on learning someone else's tool, someone else's file format, and just when I get stuck on something having to wait for response or not getting a response.
Also when I say 3d editor it would be the standard 3 2d windows with one 3d window. There are other options, but I've always wanted to make my own as mentioned above :).
Thanks Guys :)
If your tool is Windows only, you might consider using C# and winforms (or possibly even WPF). It's a much nicer language than C++ to build UIs in and you can still interface with your C++ engine code easily enough using C++/CLI.
If you are asking about how to make GUIs for desktop applications, I really like Qt.
Here's a screenshot of a 2D tile-based editor I'm working on using Qt. The center of the editor uses a different API for drawing (SFML and OpenGL); you can make widgets be OpenGL-drawn as well as have Qt-drawn widgets.
Qt is also cross-platform for Windows, OSX, and Linux. Supposedly it's also recently gained cross-platformness for iOS and Android, but I'm not sure how well it works.
If you don't stop talking about how awesome Qt is, I may have to start using it. I didn't realize it had a built-in GUI API. Is that something like Swing for C++? And how does it do on the cross-platform issues like Look-and-Feel and input handling?
This is me getting Qt and QtCreator confused. But I wasn't thinking about the Qt GUI stuff being enabled with QtCreator. Looks like some powerful stuff.
If you are asking about how to make GUIs for desktop applications, I really like Qt.
Here's a screenshot of a 2D tile-based editor I'm working on using Qt. The center of the editor uses a different API for drawing (SFML and OpenGL); you can make widgets be OpenGL-drawn as well as have Qt-drawn widgets.
Qt is also cross-platform for Windows, OSX, and Linux. Supposedly it's also recently gained cross-platformness for iOS and Android, but I'm not sure how well it works.
If you don't stop talking about how awesome Qt is, I may have to start using it. I didn't realize it had a built-in GUI API. Is that something like Swing for C++? And how does it do on the cross-platform issues like Look-and-Feel and input handling?
This is me getting Qt and QtCreator confused. But I wasn't thinking about the Qt GUI stuff being enabled with QtCreator. Looks like some powerful stuff.
If you don't stop talking about how awesome Qt is, I may have to start using it. I didn't realize it had a built-in GUI API. Is that something like Swing for C++? And how does it do on the cross-platform issues like Look-and-Feel and input handling?
There's the Qt libraries, and then later on they made QtCreator, which is an IDE (a really good one, as far as non-Visual Studio IDEs go), that includes things like a great GUI wizard builder. Qt can supposedly be used with other IDEs like Visual Studio, but it may require jumping through some hoops to get it working (they run a preprocessor on parts of the .cpp files to enable some features).
Qt (the API, which pre-dates the IDE) includes a huge number of cross-platform libraries using a consistent interface, kinda like Boost, but is most famous for it's GUI stuff. Apart from using the wizard, you can also easily create the GUIs programmatically, either manually positioning widgets, or (a better idea) using nested 'layouts', to automatically organize widgets horizontally, vertically, in grids, or so on.
QWidget *window = new QWidget;
QPushButton *button1 = new QPushButton("One");
QPushButton *button2 = new QPushButton("Two");
QPushButton *button3 = new QPushButton("Three");
QPushButton *button4 = new QPushButton("Four");
QPushButton *button5 = new QPushButton("Five");
QHBoxLayout *layout = new QHBoxLayout;
layout->addWidget(button1);
layout->addWidget(button2);
layout->addWidget(button3);
layout->addWidget(button4);
layout->addWidget(button5);
window->setLayout(layout);
window->show();
(Note: Qt uses alot of calls to 'new', but manages the pointers to free them, so you use few, if any, calls to 'delete'.
In this example, 'window' will end up owning the pointers to the QPushButtons, because 'window' becomes their parent)
Cross-platform look-and-feel is handled by "styles". The widgets are often native widgets (so you can do things like get the HWND on Windows, if needed), and look native on whatever platform you are on, by Qt choosing, at runtime, the proper style without you doing anything. However, you can also tell Qt to use a specific style if you want.
Some of the layouts and widgets also rearrange things automaticly (which you can override) for different platforms - like placing OSX 'Ok' and 'Cancel' buttons in the proper location compared to Window's 'OK' and 'Cancel' buttons.
In addition to overall application 'styles', which can be difficult to customize, each individual widget can be styled using a domain-specific language called 'style sheets', inspired by CSS (but nowhere near as unwieldy and butchered as CSS) to theme things exactly as you want. I'm not a fan of CSS, but I like Qt's stylesheets.
In the screenshot I previously posted, the top tabbar/filemenu and the toolbar at the bottom are examples of where I used stylesheets to make them look 20% cooler. Also note that the "Notes" button in the lower-right is different (in appearance only) from the native Windows-themed buttons half an inch above it. Both are QPushButtons. Same as the icon-only and icon-and-text buttons on the bottom bar - all are QPushButtons by styled different and optionally assigned icons.
Here's a screenshot I manually touched up a month or so ago, showing how I use different drawing techniques for different parts of the editor.
And, ofcourse, you can have custom QWidget-derived widgets that uses Qt's QPainter class to draw it manually, or you can use OpenGL or DirectX to draw one or more widgets.
The only downside is, Qt works well for desktop applications like game editors, but isn't fast enough for things like 3D or 2D games that require smooth motions and high framerates. Qt is fast and responsive, but most of the frametime is stolen by Qt itself, so my 2D RPG won't be compiled with Qt, just SFML (OpenGL under the hood), but my editor is made in Qt, using SFML (and OpenGL) to draw the game view.
Qt uses signals-and-slots for sending messages between widgets (which works very well, but took me some time to get used to), and widgets also have virtual event functions that can be overridden for things like mouse movement, drag-and-drop, or repainting events.
Qt has a bit of a learning curve, since there are so many features and the libraries are so huge, but you can knock up GUI interfaces very quickly, either for mock-ups or for actual applications, so you can focus on coding the actual features behind the UI (or you can waste hours nitpicking your interface to make it look "cooler" like I do, instead of getting actual work done. ).