Solved

DirectX - How to use Windows scrollbars w/ DX?

Posted on 2004-07-31
3
1,111 Views
Last Modified: 2013-12-26
Hello All -

I'm working on a "traditional" board game style, map based, strategy game.  Developing w/ VC++ & DirectX.  I have an image representing the game board and want to display it in the client window area of a windowed (not full screen) app.  I can get the image to show up, but can't figure out how to get the image (which is larger than the window size) to scroll in response to scroll bars.  I don't want to have to "compute" the new window view area each time I scroll if I don't have to.  Anyone have tips / tutorials on how to do this?  I've read a lot of the online tutorials that go as far as "and there's your sphere on the screen", but don't really discuss how to integrate the UI functionailty with the DirectX object's appearance/behavior.

Thanks,
 
- Jason
0
Comment
Question by:jsoloff
3 Comments
 
LVL 17

Accepted Solution

by:
davebytes earned 125 total points
ID: 11726786
I'd start with getting it to respond to say arrow-keys, for panning the board properly, and keeping track of what area is currently visible.  You need to shift the viewport every frame while an arrow key is held, some given amount.

If you can do that, then 'attaching' to the scrollbars is really tracking events from the scrollbars, and mapping them into panning the board to the matching position.  Yes, you do it either every frame while the scrollbar is changing, or when the scroll thumb is released (though live-dragging should be simple at that point).

-d
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is RenderMan: RenderMan is a not any particular piece of software. RenderMan is an industry standard, defining set of rules that any rendering software should use, to be RenderMan-compliant. Pixar's RenderMan is a flagship implementation of …
Artificial Intelligence comes in many forms, and for game developers, Path-Finding is an important ability for making an NPC (Non-Playable Character) maneuver through terrain.  A* is a particularly easy way to approach it.  I’ll start with the algor…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now