Simplest way to get a slider?

Started by
3 comments, last by sprezzatura 11 years, 5 months ago
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.
Advertisement
I think this question needs a little clarification. For instance by slider, are you referring to a scrollbar (http://msdn.microsoft.com/en-us/library/windows/desktop/bb787529(v=vs.85).aspx)? Also, what language are you using?
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.
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.

I gets all your texture budgets!

Thanks, I'll look into those libraries. Meanwhile, I wrote my own slider, it will do the job.

This topic is closed to new replies.

Advertisement