How do you set up a menu system (buttons with a click) in C ++ / directx?

I am convinced that pointers to functions will be needed to assign functions to images that will be used as buttons, but I can not find decent resources on this.

How to configure button menu in C ++? For example, with buttons to save, load, exit, new.

edit: I am not worried about portability for this example. I would rather do it myself than use a predefined framework. It will only run on Windows machines.

+3
source share
3 answers

GUI, GUI (, ), " ", , , .

, . .

, , , .., , , , , .

, , ):

if ( mouseWasClicked == true )
{
    if (( mouseX > startButton.minX && mouseX < startButton.maxX ) && 
        ( mouseY > startButton.minY && startButton.maxY < mouseY) )
    {
        loadGame();
    }
}

GUI, CEGUI, . CEGUI , Qt. , .

, , , , .

+5

, .. DirectX SDK , , .

, - CEGUI. Crazy Eddie GUI , , , , .. DirectX.

+4

, - , .

, Qt, -, , . , , .

0

Source: https://habr.com/ru/post/1724304/


All Articles