Jump to content

Recommended Posts

Hoping I'm positing in a relative forum.

Right now I have created a menu system for a RPG I'm working on with the help of DirectX9. I was proud of it at first since I picked up DirectX9 programming a month and a half ago, with minimal C programming knowledge. Got the whole select the menu, draws over another, etc, things figured out. But now I've ceased operations since I hit a hurdle gfx-wise.

Currently I use Draw(MF_OptionsMenu_BG,... for the graphical background and use DrawTextA(d3dspt,... for the text. When I call three menus up my fps jumps from 60fps to around 30fps. I'm assuming that each frame draws the menu, the text, other smaller button gfx, etc, then the next menu over, ditto, ... with each frame draw. If this is true, which I don't see why it wouldn't be, then this is a lot of wasted cycles with redrawing of pixels over each other. I'm currently thinking of drawing to a buffer, manipulating the contents, and then using that finished product for a menu so I only have to update it once. Then clipping the appropriate portions and drawing called menus to a screen buffer, then filling in the unoccupied pixels with the 3d rendered background. This is the bst (untested) approach I can think of right now. Is this possible in DirectX9? Is there a better approach?

Notes: I was looking into closer-to-the-metal approaches and found a few things, like SVGA and some NVIDIA tuts, but the SVGA stuff is old and am uncertain if it is still included in graphics cards and NVIDIA only talks about 3d stuff, and not the kind of 2d stuff I'm looking to do. Am I looking in the wrong place or just interpreting the information wrong? If I'm going to go closer to the metal I want it to be as generalized as possible (between PCs).

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...