Log in or register to post comments

adding virtual buttons

March 7, 2012 - 6:06pm #1

Hi:
I modify the xml of imagetarjet.
I insert a textureFilenames
i give name the buttons
enum tagButtons {
BUTTON_1 = 1,
BUTTON_2 = 1 BUTTON_3 = 1 BUTTON_4 = 1 BUTTON_5 = 1 NUM_BUTTONS = 5
};

¿I need anything else?
Thank you.
Sorry for my english.

adding virtual buttons

January 30, 2013 - 1:23am #7

good to know!

adding virtual buttons

January 30, 2013 - 12:42am #6

MoSR is correct.

Re: adding virtual buttons

March 15, 2012 - 11:24am #5

Really really thank you.

Re: adding virtual buttons

March 12, 2012 - 10:17am #4

Hi Ruben,

I reproduced your mistake I believe - I made all the obvious changes and got the same crash.

But it turned out to simply be the length of the vbVertices array in renderFrameQCAR which is hard coded to 24 * 4 = 96. Change this to:

GLfloat vbVertices[NUM_BUTTONS * 24];

and you'll find the problem goes away. This array of vertices is used to draw the outlines of the virtual buttons.

Re: adding virtual buttons

March 8, 2012 - 7:42am #3

I get
EXC_BAD_ACCESS

The error is in this line
// Iterate through this target's virtual buttons:
for (int i = 0; i getNumVirtualButtons(); ++i) {

target->getNumVirtualButtons() has value"5" .
I dont understand nothing
I don´t need toggle buttons, only show 5 .

Tahnk you

Re: adding virtual buttons

March 8, 2012 - 2:55am #2

Hi Ruben,

(Assuming you're using SDK 1.5)

I believe that's all you need to do. Is it not working? If not, in what way is it not working?

If, like the other buttons in the sample app, you want to have a menu entry to toggle the new virtual button, then you'll also need to edit EAGLView.mm:VirtualButton_UpdateCallback and VBOverlayViewController.mm to add the menu entry.

Log in or register to post comments