DirectX performance in a partial window

Started by
2 comments, last by DBX 19 years, 6 months ago
I'm writing a program in VB.net (VStudio 2005 beta 1 if it makes any difference) which does some directx drawing in windowed (not full screen) mode. It does the drawing on the window itself, but I need to add controls to allow for user input, etc. Option A is to do everything in directx on the window itself (writing GUI code), Option B is to have the directx drawing done in, say, a picturebox (which I've just got working so I know it's possible!) and the other controls are standard VB ones around it. Option A will take much longer than Option B, *but* is there much of a performance hit doing it this way? I'm not doing the latest whizzy FPS game so ultimate performance isn't an issue, but I do want to know whether I'm heading down a complete blind alley... Hmmm, just thought of Option C which is to have the controls in a completely separate window - which is a valid option as I plan to have lots of windows doing various things... Please - no 'use c#' or 'use c++ instead' comments - VB is it for now! [headshake] [smile]
Advertisement
VB ftw! It depends on your program and who will be using it. If you're talking about input like data entry then you should go with some standard VB controls or I hear there's some built in standard GUI controls in DX9. For input like player controls you should definately not have to click buttons or type in "move forward" into a text box. Use form_keydown's and the likes or if you have a little more time just use direct input. It's really not that hard to get standard input support with direct input.

If you're trying to educate yourself, which would you most benefit from?
______________________________Perry Butler aka iosysiosys Website | iosys Music | iosys Engine
Thanks for the reply, I'll try to explain a bit further.

I'm definitely going to be using DirectInput to control whats going on in the graphical area of the screen and general control (zooming, time compression, shortcut to a save/load dialog and so on).

There will be a lot of possible data input required - say there are 50 spaceships each of which has it's orders, status, targets, etc ,etc. Plus formations which can contain those ships, each with their own orders, status, etc. And 50 planets, each with status, production orders, etc, etc. Now that's a lot of possible input required, and status information to display - so large an amount that creating the screens for displaying on the directx part of the display will be a vast undertaking, but using VB's forms designer will be (comparitively) simple and straightforward.

(note - only a few elements will be rendered at any one time, but the rest will be 'out there' in the game universe).

So, anybody got any idea whether combining a directx 'portal' with standard windows controls is much slower (from a FPS/rendering point of view - maybe I didn't make that clear) than doing everything in the rendering window? [smile]
There shouldn't be a problem at all with rendering in one window (or control) and having a standard Windows interface alongside. You're not stressing the system with a complicated rendering engine, just make sure you limit the frame rate you render at so as not to hog all the cpu time from the gui.

If you have the DX9c SDK you could make use of the new GUI controls, but as you are familiar with the standard VB ones that is what I'd probably stick with.

So my recommendation is for option B, and forsee no significant performance hits for your case.

This topic is closed to new replies.

Advertisement