Sign in to follow this  
sprezzatura

Simplest way to get a slider?

Recommended Posts

sprezzatura    109
What is the simplest way to show a slider control? I am not using DXUT, my understanding is that DXUT is an all-or-nothing proposition, you either use it for everything (device creation, etc), or not.

I would prefer not to get involved in adding a large library to my app.

I just want to the user to be able to slide the control up & down.

Thanks for your input.

Share this post


Link to post
Share on other sites
papulko    1418
I think this question needs a little clarification. For instance by slider, are you referring to a scrollbar ([url="http://msdn.microsoft.com/en-us/library/windows/desktop/bb787529(v=vs.85).aspx"]http://msdn.microsoft.com/en-us/library/windows/desktop/bb787529(v=vs.85).aspx[/url])? Also, what language are you using?

Share this post


Link to post
Share on other sites
sprezzatura    109
I'm using C++, Win32 API, DirectX 9.

Is the slider you refer to a regular control? I tried creating a modeless dialog that included a slider bar, but it doesn't show up. I assume that the PeekMessage loop is stealing all the cycles. Also, would a regular Windows dialog work in full-screen mode?

I'm thinking of something like this:
[sharedmedia=gallery:albums:547]

Based on the DXUT example, I assume you have to use a specially designed slider. I am reduced to drawing lines with D3DXCreateLine, tracking the mouse coordinates, doing a hit test for the thumbtrack. Kinda primitive.

Share this post


Link to post
Share on other sites
Radikalizm    4807
There are quite a few GUI libraries available for use with DirectX which could provide you with a slider widget, libraries like Rocket and CEGUI come to mind, but I'm not sure what their development state is now (it's been a while since I've used them)

Another option would be to create a very basic ui system yourself, so you can write your own slider widget. You'd still use basic functions to draw your slider, but you could provide some clean encapsulation for mouse events and logic.

Share this post


Link to post
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

Sign in to follow this