Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

DirectX - How to use Windows scrollbars w/ DX?

Posted on 2004-07-31
3
Medium Priority
?
1,123 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 17

Accepted Solution

by:
davebytes earned 500 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

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…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

610 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